Home
last modified time | relevance | path

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

12

/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/
DWifiWakeupPreferenceControllerTest.java51 private LocationManager mLocationManager; field in WifiWakeupPreferenceControllerTest
63 mController.mLocationManager = mLocationManager; in setUp()
68 doReturn(true).when(mLocationManager).isLocationEnabled(); in setUp()
75 doReturn(true).when(mLocationManager).isLocationEnabled(); in setChecked_scanEnableLocationEnable_wifiWakeupEnable()
87 doReturn(true).when(mLocationManager).isLocationEnabled(); in updateState_wifiWakeupEnableScanningDisable_wifiWakeupDisabled()
101 doReturn(true).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetCheckedWhenWakeupSettingEnabled()
137 doReturn(false).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetUncheckedWhenWakeupSettingEnabledNoLocation()
150 doReturn(false).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetUncheckedWhenWakeupSettingDisabledLocationEnabled()
164 doReturn(false).when(mLocationManager).isLocationEnabled(); in updateState_preferenceSetUncheckedWhenWifiScanningDisabledLocationEnabled()
/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/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/apps/Car/Settings/tests/unit/src/com/android/car/settings/privacy/
DLocationTogglePreferenceControllerTest.java57 private LocationManager mLocationManager; field in LocationTogglePreferenceControllerTest
70 mLocationManager = mContext.getSystemService(LocationManager.class); in setUp()
88 assertThat(mLocationManager.isLocationEnabledForUser(mUserHandle)).isFalse(); in onPreferenceClicked_clickLocationEnabled_shouldDisableLocation()
98 assertThat(mLocationManager.isLocationEnabledForUser(mUserHandle)).isTrue(); in onPreferenceClicked_clickMicDisabled_shouldEnableLocation()
106 mLocationManager.setLocationEnabledForUser(true, mUserHandle); in onListenerUpdate_locationDisabled_shouldUpdateChecked()
116 mLocationManager.setLocationEnabledForUser(false, mUserHandle); in onListenerUpdate_locationEnabled_shouldUpdateChecked()
123 mLocationManager.setLocationEnabledForUser(isLocationEnabled, mUserHandle); in initializePreference()
/packages/apps/Settings/tests/robotests/src/com/android/settings/location/
DTopLevelLocationPreferenceControllerTest.java37 private LocationManager mLocationManager; field in TopLevelLocationPreferenceControllerTest
43 mLocationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); in setUp()
53 mLocationManager.setLocationEnabledForUser(false, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOff_shouldReturnStringForOff()
60 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOn_shouldShowLoadingString()
68 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsOne_shouldShowSingularString()
79 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsGreaterThanOne_shouldShowPluralString()
DAppLocationPermissionPreferenceControllerTest.java35 private LocationManager mLocationManager; field in AppLocationPermissionPreferenceControllerTest
48 mLocationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); in setUp()
69 mLocationManager.setLocationEnabledForUser(false, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOff_shouldReturnStringForOff()
77 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationIsOn_shouldReturnLoadingString()
85 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsOne_shouldShowSingularString()
95 mLocationManager.setLocationEnabledForUser(true, android.os.Process.myUserHandle()); in getSummary_whenLocationAppCountIsGreaterThanOne_shouldShowPluralString()
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/p2p/
DWifiP2PPreferenceControllerTest.java64 private LocationManager mLocationManager; field in WifiP2PPreferenceControllerTest
77 when(mContext.getSystemService(eq(Service.LOCATION_SERVICE))).thenReturn(mLocationManager); in setUp()
103 when(mLocationManager.isLocationEnabled()).thenReturn(true); in testWifiStateChange_shouldToggleEnabledState()
121 when(mLocationManager.isLocationEnabled()).thenReturn(true); in testDisplayPreference_shouldToggleEnabledState()
130 when(mLocationManager.isLocationEnabled()).thenReturn(false); in testDisplayPreference_shouldToggleEnabledState()
138 when(mLocationManager.isLocationEnabled()).thenReturn(true); in updateState_withLocationDisabled_preferenceShouldBeDisable()
143 when(mLocationManager.isLocationEnabled()).thenReturn(false); in updateState_withLocationDisabled_preferenceShouldBeDisable()
/packages/apps/Car/tests/TestMediaApp/src/com/android/car/media/testmediaapp/
DTmaForegroundService.java48 private LocationManager mLocationManager; field in TmaForegroundService
77 if (mLocationManager != null) { in onDestroy()
78 mLocationManager.removeUpdates(mLocationListener); in onDestroy()
101 if (mLocationManager != null) { in doWork()
104 mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE); in doWork()
106 mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, in doWork()
/packages/services/Car/service/src/com/android/car/
DLocationManagerProxy.java33 private final LocationManager mLocationManager; field in LocationManagerProxy
42 mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); in LocationManagerProxy()
47 return mLocationManager.isLocationEnabled(); in isLocationEnabled()
52 return mLocationManager.injectLocation(location); in injectLocation()
60 return mLocationManager.getLastKnownLocation(provider); in getLastKnownLocation()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/location/
DLocationStateSwitchPreferenceControllerTest.java55 private LocationManager mLocationManager; field in LocationStateSwitchPreferenceControllerTest
67 mLocationManager = mContext.getSystemService(LocationManager.class); in setUp()
88 mLocationManager.setLocationEnabledForUser(/* enabled= */ true, mUserHandle); in onIntentReceived_updateUi()
101 assertThat(mLocationManager.isLocationEnabledForUser(mUserHandle)).isTrue(); in onPreferenceClicked_locationDisabled_shouldEnable()
111 assertThat(mLocationManager.isLocationEnabledForUser(mUserHandle)).isFalse(); in onPreferenceClicked_locationEnabled_shouldDisable()
135 mLocationManager.setLocationEnabledForUser(checked, mUserHandle); in initializePreference()
DRecentLocationRequestsEntryPreferenceControllerTest.java65 private LocationManager mLocationManager; field in RecentLocationRequestsEntryPreferenceControllerTest
77 mLocationManager = mContext.getSystemService(LocationManager.class); in setUp()
152 mLocationManager.setLocationEnabledForUser(enabled, in setLocationEnabled()
157 assertThat(mLocationManager.isLocationEnabled()).isEqualTo(enabled); in setLocationEnabled()
/packages/apps/Settings/src/com/android/settings/wifi/
DWifiWakeupPreferenceController.java59 LocationManager mLocationManager; field in WifiWakeupPreferenceController
76 mLocationManager = (LocationManager) context.getSystemService(Service.LOCATION_SERVICE); in WifiWakeupPreferenceController()
99 && mLocationManager.isLocationEnabled(); in isChecked()
109 if (!mLocationManager.isLocationEnabled()) { in setChecked()
131 if (!mLocationManager.isLocationEnabled()) { in getSummary()
149 if (mLocationManager.isLocationEnabled() && getWifiScanningEnabled()) { in onActivityResult()
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/
DApplicationFeatureProviderImplTest.java90 private LocationManager mLocationManager; field in ApplicationFeatureProviderImplTest
103 when(mContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in setUp()
274 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory()
275 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainDefaultPhoneAndSmsAndLocationHistory()
305 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage()
306 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_hasEuiccComponent_shouldContainEuiccPackage()
327 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_shouldContainSettingsIntelligence()
328 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainSettingsIntelligence()
349 when(mLocationManager.getExtraLocationControllerPackage()).thenReturn(testLocationHistory); in getKeepEnabledPackages_shouldContainPackageInstaller()
350 when(spyContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager); in getKeepEnabledPackages_shouldContainPackageInstaller()
/packages/apps/Car/Settings/src/com/android/car/settings/wifi/preferences/
DWifiWakeupTogglePreferenceController.java48 private LocationManager mLocationManager; field in WifiWakeupTogglePreferenceController
55 if (mLocationManager.isLocationEnabled()) {
77 mLocationManager = (LocationManager) context.getSystemService(Service.LOCATION_SERVICE); in WifiWakeupTogglePreferenceController()
102 && mLocationManager.isLocationEnabled()); in updateState()
103 if (!mLocationManager.isLocationEnabled()) { in updateState()
112 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/datetime/
DLocationTimeZoneDetectionPreferenceControllerTest.java57 private LocationManager mLocationManager; field in LocationTimeZoneDetectionPreferenceControllerTest
70 when(mContext.getSystemService(LocationManager.class)).thenReturn(mLocationManager); in setUp()
77 when(mLocationManager.isLocationEnabled()).thenReturn(true); in setChecked_withTrue_shouldUpdateSetting_whenLocationIsEnabled()
96 when(mLocationManager.isLocationEnabled()).thenReturn(false); in setChecked_withTrue_shouldDoNothing_whenLocationIsDisabled()
165 when(mLocationManager.isLocationEnabled()).thenReturn(false); in testLocationTimeZoneDetection_toggleIsOn_whenGeoDetectionEnabledAnsMlsIsOff()
/packages/apps/Settings/src/com/android/settings/wifi/p2p/
DWifiP2pPreferenceController.java54 private final LocationManager mLocationManager; field in WifiP2pPreferenceController
74 mLocationManager = (LocationManager) context.getSystemService(Service.LOCATION_SERVICE); in WifiP2pPreferenceController()
87 preference.setEnabled(mLocationManager.isLocationEnabled() && mWifiManager.isWifiEnabled()); in updateState()
116 && mLocationManager.isLocationEnabled()); in togglePreferences()
/packages/apps/Settings/src/com/android/settings/location/
DAppLocationPermissionPreferenceController.java38 private final LocationManager mLocationManager; field in AppLocationPermissionPreferenceController
43 mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); in AppLocationPermissionPreferenceController()
55 if (mLocationManager.isLocationEnabled()) { in getSummary()
79 if (!mLocationManager.isLocationEnabled() || in updateState()
DTopLevelLocationPreferenceController.java33 private final LocationManager mLocationManager; field in TopLevelLocationPreferenceController
43 mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); in TopLevelLocationPreferenceController()
53 if (mLocationManager.isLocationEnabled()) { in getSummary()
77 if (!mLocationManager.isLocationEnabled() || in updateState()
/packages/apps/Settings/src/com/android/settings/datetime/
DLocationTimeZoneDetectionPreferenceController.java53 private final LocationManager mLocationManager; field in LocationTimeZoneDetectionPreferenceController
61 mLocationManager = context.getSystemService(LocationManager.class); in LocationTimeZoneDetectionPreferenceController()
78 if (isChecked && !mLocationManager.isLocationEnabled()) { in setChecked()
158 if (!mLocationManager.isLocationEnabled()) { in getSummary()
/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()
/packages/apps/Car/Settings/src/com/android/car/settings/location/
DRecentLocationRequestsEntryPreferenceController.java42 private final LocationManager mLocationManager; field in RecentLocationRequestsEntryPreferenceController
53 mLocationManager = getContext().getSystemService(LocationManager.class); in RecentLocationRequestsEntryPreferenceController()
64 preference.setEnabled(mLocationManager.isLocationEnabled()); in updateState()
/packages/modules/GeoTZ/locationtzprovider/src/main/java/com/android/timezone/location/provider/
DEnvironmentImpl.java140 @NonNull private final LocationManager mLocationManager; field in EnvironmentImpl
153 mLocationManager = context.getSystemService(LocationManager.class); in EnvironmentImpl()
332 mLocationManager.requestLocationUpdates( in startPassiveLocationListening()
339 mLocationManager.removeUpdates(locationListener); in startPassiveLocationListening()
372 mLocationManager.removeUpdates(locationListener); in startPassiveLocationListening()
431 mLocationManager.getCurrentLocation(
/packages/apps/Car/Settings/src/com/android/car/settings/privacy/
DLocationTogglePreferenceController.java43 private final LocationManager mLocationManager; field in LocationTogglePreferenceController
55 mLocationManager = context.getSystemService(LocationManager.class); in LocationTogglePreferenceController()
86 preference.setSecondaryActionChecked(mLocationManager.isLocationEnabled()); in updateState()

12