Home
last modified time | relevance | path

Searched refs:mLocationManager (Results 1 – 25 of 61) sorted by relevance

123

/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/
DWifiWakeupPreferenceControllerTest.java54 private LocationManager mLocationManager; field in WifiWakeupPreferenceControllerTest
66 mController.mLocationManager = mLocationManager; in setUp()
71 doReturn(true).when(mLocationManager).isLocationEnabled(); in setUp()
84 when(mLocationManager.isLocationEnabled()).thenReturn(false); in getAvailabilityStatus_fragmentIsNullAndLocationDisabled_returnDisabled()
100 when(mLocationManager.isLocationEnabled()).thenReturn(true); in setChecked_mFragmentIsNullLocationEnable_wifiWakeupEnable()
113 doReturn(true).when(mLocationManager).isLocationEnabled(); in setChecked_scanEnableLocationEnable_wifiWakeupEnable()
125 doReturn(true).when(mLocationManager).isLocationEnabled(); in updateState_wifiWakeupEnableScanningDisable_wifiWakeupDisabled()
139 doReturn(true).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetCheckedWhenWakeupSettingEnabled()
175 doReturn(false).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetUncheckedWhenWakeupSettingEnabledNoLocation()
188 doReturn(false).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetUncheckedWhenWakeupSettingDisabledLocationEnabled()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/location/
DTopLevelLocationPreferenceControllerTest.java38 private LocationManager mLocationManager; field in TopLevelLocationPreferenceControllerTest
44 mLocationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); in setUp()
54 mLocationManager.setLocationEnabledForUser(false, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOff_shouldReturnStringForOff()
63 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOn_shouldPreservePreviousText()
67 mLocationManager.setLocationEnabledForUser(false, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOn_shouldPreservePreviousText()
69 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOn_shouldPreservePreviousText()
78 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsOne_shouldShowSingularString()
88 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsGreaterThanOne_shouldShowPluralString()
DAppLocationPermissionPreferenceControllerTest.java39 private LocationManager mLocationManager; field in AppLocationPermissionPreferenceControllerTest
52 mLocationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); in setUp()
73 mLocationManager.setLocationEnabledForUser(false, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOff_shouldReturnStringForOff()
81 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOn_shouldReturnLoadingString()
89 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsOne_shouldShowSingularString()
102 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsGreaterThanOne_shouldShowPluralString()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/wifi/preferences/
DWifiWakeupTogglePreferenceControllerTest.java72 private LocationManager mLocationManager; field in WifiWakeupTogglePreferenceControllerTest
86 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
108 when(mLocationManager.isLocationEnabled()).thenReturn(false); in handlePreferenceClicked_locationDisabled_launchFragment()
118 when(mLocationManager.isLocationEnabled()).thenReturn(true); in handlePreferenceClicked_wifiWakeupEnabled_disablesWifiWakeup()
132 when(mLocationManager.isLocationEnabled()).thenReturn(true); in handlePreferenceClicked_wifiScanningDisabled_showsDialog()
146 when(mLocationManager.isLocationEnabled()).thenReturn(true); in handlePreferenceClicked_wifiScanningEnabled_wifiWakeupDisabled_enablesWifiWakeup()
161 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onCreate_wifiWakeupEnabled_wifiScanningEnabled_locationEnabled_isChecked()
173 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onCreate_wifiWakeupDisabled_wifiScanningEnabled_locationEnabled_isNotChecked()
185 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onCreate_wifiWakeupEnabled_wifiScanningDisabled_locationEnabled_isNotChecked()
197 when(mLocationManager.isLocationEnabled()).thenReturn(false); in onCreate_wifiWakeupEnabled_wifiScanningEnabled_locationDisabled_isNotChecked()
[all …]
/packages/apps/Camera2/src/com/android/camera/app/
DLegacyLocationProvider.java34 private android.location.LocationManager mLocationManager; field in LegacyLocationProvider
84 if (mLocationManager == null) { in startReceivingLocationUpdates()
85 mLocationManager = AndroidServices.instance().provideLocationManager(); in startReceivingLocationUpdates()
87 if (mLocationManager != null) { in startReceivingLocationUpdates()
89 mLocationManager.requestLocationUpdates( in startReceivingLocationUpdates()
100 mLocationManager.requestLocationUpdates( in startReceivingLocationUpdates()
116 if (mLocationManager != null) { in stopReceivingLocationUpdates()
119 mLocationManager.removeUpdates(mLocationListeners[i]); in stopReceivingLocationUpdates()
/packages/services/Car/tests/AdasLocationTestApp/src/com/google/android/car/adaslocation/
DAdasLocationActivity.java51 private LocationManager mLocationManager; field in AdasLocationActivity
66 mLocationManager = getApplicationContext().getSystemService(LocationManager.class); in onCreate()
99 mLocationManager.getLastKnownLocation( in onCreate()
114 mMainLocationEnabled.setText(Boolean.toString(mLocationManager in onCreate()
121 .setText(Boolean.toString(mLocationManager in onCreate()
135 mMainLocationEnabled.setText(Boolean.toString(mLocationManager.isLocationEnabled())); in onStart()
137 mAdasLocationEnabled.setText(Boolean.toString(mLocationManager in onStart()
190 mLocationManager.requestLocationUpdates( in startListening()
197 mLocationManager.removeUpdates(mLocationListener); in stopListening()
/packages/apps/LegacyCamera/src/com/android/camera/
DLocationManager.java33 private android.location.LocationManager mLocationManager; field in LocationManager
75 if (mLocationManager == null) { in startReceivingLocationUpdates()
76 mLocationManager = (android.location.LocationManager) in startReceivingLocationUpdates()
79 if (mLocationManager != null) { in startReceivingLocationUpdates()
81 mLocationManager.requestLocationUpdates( in startReceivingLocationUpdates()
92 mLocationManager.requestLocationUpdates( in startReceivingLocationUpdates()
108 if (mLocationManager != null) { in stopReceivingLocationUpdates()
111 mLocationManager.removeUpdates(mLocationListeners[i]); in stopReceivingLocationUpdates()
/packages/modules/Wifi/service/java/com/android/server/wifi/
DAfcManager.java59 private LocationManager mLocationManager; field in AfcManager
121 List<String> locationProviders = mLocationManager.getProviders(true); in listenForLocationChanges()
127 mLocationManager.requestLocationUpdates( in listenForLocationChanges()
146 mLocationManager.removeUpdates(mLocationListener); in stopListeningForLocationChanges()
288 if (mLocationManager == null) { in onCountryCodeChange()
308 mLocationManager.getCurrentLocation( in onCountryCodeChange()
328 if (!mProviderForLocationRequest.isEmpty() || mLocationManager == null) { in getProviderForLocationRequest()
343 List<String> availableLocationProviders = mLocationManager.getProviders(true); in getProviderForLocationRequest()
401 if (mLocationManager == null) { in getLocationManager()
402 mLocationManager = mContext.getSystemService(LocationManager.class); in getLocationManager()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/location/
DAdasLocationSwitchPreferenceControllerTest.java90 private LocationManager mLocationManager; field in AdasLocationSwitchPreferenceControllerTest
107 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
163 verify(mLocationManager, never()).setAdasGnssLocationEnabled(anyBoolean()); in unclickable_onPreferenceClicked_noChange_showToggleDisabledDialog()
179 verify(mLocationManager, never()).setAdasGnssLocationEnabled(anyBoolean()); in unclickable_powerPolicyOff_onPreferenceClicked_showToggleDisabledDialog()
239 when(mLocationManager.isAdasGnssLocationEnabled()).thenReturn(true); in onAdasIntentReceived_updateUi()
263 when(mLocationManager.isAdasGnssLocationEnabled()).thenReturn(true); in onAdasIntentReceived_updateUi_flagReq()
288 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onLocationIntentReceived_updateUi()
289 when(mLocationManager.isAdasGnssLocationEnabled()).thenReturn(true); in onLocationIntentReceived_updateUi()
314 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onLocationIntentReceived_updateUi_flagReq()
315 when(mLocationManager.isAdasGnssLocationEnabled()).thenReturn(true); in onLocationIntentReceived_updateUi_flagReq()
[all …]
DLocationAccessPreferenceControllerTest.java55 private LocationManager mLocationManager; field in LocationAccessPreferenceControllerTest
67 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
80 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getAvailabilityStatus_adasAllowlistNotEmpty_available()
91 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getAvailabilityStatus_adasAllowlistNotEmpty_conditionallyUnavailable_zoneHidden()
101 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getAvailabilityStatus_adasAllowlistEmpty_conditionallyUnavailable()
112 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getAvailabilityStatus_adasAllowlistEmpty_conditionallyUnavailable_zoneHidden()
DLocationStateSwitchOuterPreferenceControllerTest.java57 private LocationManager mLocationManager; field in LocationStateSwitchOuterPreferenceControllerTest
63 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
87 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_driverWithAdas_conditionallyUnavailable()
98 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_driverNoAdas_available()
109 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_passengerAdas_available()
120 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_passengerNoAdas_available()
DLocationRequiredAppsSectionPreferenceControllerTest.java57 private LocationManager mLocationManager; field in LocationRequiredAppsSectionPreferenceControllerTest
63 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
87 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_driverWithAdas_available()
98 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_driverNoAdas_conditionallyUnavailable()
109 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_passengerAdas_conditionallyUnavailable()
120 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_passengerNoAdas_conditionallyUnavailable()
DLocationAccessDisclaimerPreferenceControllerTest.java57 private LocationManager mLocationManager; field in LocationAccessDisclaimerPreferenceControllerTest
63 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
87 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_driverWithAdas_conditionallyUnavailable()
98 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_driverNoAdas_available()
109 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_passengerAdas_available()
120 when(mLocationManager.getAdasAllowlist()).thenReturn(list); in getDefaultAvailabilityStatus_passengerNoAdas_available()
DLocationStateListenerBasePreferenceControllerTest.java67 private LocationManager mLocationManager; field in LocationStateListenerBasePreferenceControllerTest
74 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
83 when(mLocationManager.isAdasGnssLocationEnabled()).thenReturn(false); in onAdasIntentReceived_refreshUi()
117 when(mLocationManager.isAdasGnssLocationEnabled()).thenReturn(true); in onAdasIntentReceived_refreshUi()
127 when(mLocationManager.isLocationEnabled()).thenReturn(false); in onLocationIntentReceived_refreshUi()
161 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onLocationIntentReceived_refreshUi()
DLocationStateSwitchPreferenceControllerTest.java74 private LocationManager mLocationManager; field in LocationStateSwitchPreferenceControllerTest
87 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
110 when(mLocationManager.isLocationEnabled()).thenReturn(true); in onIntentReceived_updateUi()
123 verify(mLocationManager).setLocationEnabledForUser(/* enabled= */ true, mUserHandle); in onPreferenceClicked_locationDisabled_shouldEnable()
133 verify(mLocationManager).setLocationEnabledForUser(/* enabled= */ false, mUserHandle); in onPreferenceClicked_locationEnabled_shouldDisable()
234 when(mLocationManager.isLocationEnabled()).thenReturn(checked); in initializePreference()
/packages/services/Car/service/src/com/android/car/
DLocationManagerProxy.java38 private final LocationManager mLocationManager; field in LocationManagerProxy
47 mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); in LocationManagerProxy()
52 return mLocationManager.isLocationEnabled(); in isLocationEnabled()
57 return mLocationManager.injectLocation(location); in injectLocation()
65 return mLocationManager.getLastKnownLocation(provider); in getLastKnownLocation()
/packages/modules/Wifi/service/tests/wifitests/src/com/android/server/wifi/
DAfcManagerTest.java69 @Mock LocationManager mLocationManager; field in AfcManagerTest
89 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
101 when(mLocationManager.getProviders(anyBoolean())).thenReturn(List.of( in setUp()
161 assertThat(mAfcManager.getLocationManager()).isEqualTo(mLocationManager); in testUpdateLastKnownLocationOnLocationChange()
179 verify(mLocationManager).getCurrentLocation(anyString(), any(), in testGetLocationAfterCountryCodeChange()
222 verifyNoMoreInteractions(mLocationManager); in testNoQueryWhenAfcNotEnabled()
233 when(mLocationManager.getProviders(anyBoolean())).thenReturn(List.of( in testCorrectProviderUsedForGetLocation()
239 verify(mLocationManager).getCurrentLocation(providerArgumentCaptor.capture(), any(), in testCorrectProviderUsedForGetLocation()
260 verify(mLocationManager).requestLocationUpdates(anyString(), anyLong(), in testStopListeningForLocationUpdates()
270 verify(mLocationManager).removeUpdates(locationListener); in testStopListeningForLocationUpdates()
/packages/apps/Car/Settings/src/com/android/car/settings/wifi/preferences/
DWifiWakeupTogglePreferenceController.java47 private LocationManager mLocationManager; field in WifiWakeupTogglePreferenceController
54 if (mLocationManager.isLocationEnabled()) {
76 mLocationManager = context.getSystemService(LocationManager.class); in WifiWakeupTogglePreferenceController()
101 && mLocationManager.isLocationEnabled()); in updateState()
102 if (!mLocationManager.isLocationEnabled()) { in updateState()
111 if (!mLocationManager.isLocationEnabled()) { in handlePreferenceClicked()
/packages/apps/Settings/tests/robotests/src/com/android/settings/display/
DTwilightLocationPreferenceControllerTest.java45 private LocationManager mLocationManager; field in TwilightLocationPreferenceControllerTest
51 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
57 when(mLocationManager.isLocationEnabled()).thenReturn(true); in getAvailabilityStatus_locationEnabled_shouldBeCONDITIONALLY_UNAVAILABLE()
64 when(mLocationManager.isLocationEnabled()).thenReturn(false); in getAvailabilityStatus_locationDisabled_shouldBeAVAILABLE_UNSEARCHABLE()
DNightDisplayAutoModePreferenceControllerTest.java43 private LocationManager mLocationManager; field in NightDisplayAutoModePreferenceControllerTest
48 mLocationManager = Mockito.mock(LocationManager.class); in setUp()
49 when(mLocationManager.isLocationEnabled()).thenReturn(true); in setUp()
50 when(mContext.getSystemService(eq(LocationManager.class))).thenReturn(mLocationManager); in setUp()
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/
DApplicationFeatureProviderImplTest.java112 private LocationManager mLocationManager; field in ApplicationFeatureProviderImplTest
128 when(mContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in setUp()
312 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory()
313 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory()
343 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage()
344 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage()
365 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_shouldContainSettingsIntelligence()
366 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainSettingsIntelligence()
407 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_shouldContainPackageInstaller()
408 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainPackageInstaller()
/packages/apps/Settings/src/com/android/settings/display/
DTwilightLocationPreferenceController.java36 private final LocationManager mLocationManager; field in TwilightLocationPreferenceController
41 mLocationManager = context.getSystemService(LocationManager.class); in TwilightLocationPreferenceController()
60 return mLocationManager.isLocationEnabled() ? CONDITIONALLY_UNAVAILABLE in getAvailabilityStatus()
DNightDisplayAutoModePreferenceController.java33 private final LocationManager mLocationManager; field in NightDisplayAutoModePreferenceController
40 mLocationManager = context.getSystemService(LocationManager.class); in NightDisplayAutoModePreferenceController()
75 && !mLocationManager.isLocationEnabled()) { in onPreferenceChange()
/packages/apps/Settings/src/com/android/settings/location/
DTopLevelLocationPreferenceController.java34 private final LocationManager mLocationManager; field in TopLevelLocationPreferenceController
44 mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); in TopLevelLocationPreferenceController()
54 if (mLocationManager.isLocationEnabled()) { in getSummary()
78 if (!mLocationManager.isLocationEnabled() || in updateState()
DAppLocationPermissionPreferenceController.java45 private final LocationManager mLocationManager; field in AppLocationPermissionPreferenceController
50 mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); in AppLocationPermissionPreferenceController()
62 if (mLocationManager.isLocationEnabled()) { in getSummary()
103 if (!mLocationManager.isLocationEnabled() || in updateState()

123