Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1952,6 +1952,7 @@ package android.provider { public static final class Settings.Global extends android.provider.Settings.NameValueTable { field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages"; field public static final String AUTOMATIC_POWER_SAVER_MODE = "automatic_power_saver_mode"; field public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; field public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = "captive_portal_fallback_probe_specs"; field public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; field public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; Loading core/java/android/os/PowerManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1569,7 +1569,7 @@ public final class PowerManager { @LocationPowerSaveMode public int getLocationPowerSaveMode() { final PowerSaveState powerSaveState = getPowerSaveState(ServiceType.LOCATION); if (!powerSaveState.globalBatterySaverEnabled) { if (!powerSaveState.batterySaverEnabled) { return LOCATION_MODE_NO_CHANGE; } return powerSaveState.locationMode; Loading core/java/android/provider/Settings.java +1 −0 Original line number Diff line number Diff line Loading @@ -11523,6 +11523,7 @@ public final class Settings { * @hide * @see com.android.server.power.batterysaver.BatterySaverPolicy */ @TestApi public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; /** Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +6 −6 Original line number Diff line number Diff line Loading @@ -1379,8 +1379,8 @@ public class SettingsProvider extends ContentProvider { } } if (enableOverride) { if (Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) { final Setting overridden = getLocationProvidersAllowedSetting(owningUserId); if (Secure.LOCATION_MODE.equals(name)) { final Setting overridden = getLocationModeSetting(owningUserId); if (overridden != null) { return overridden; } Loading Loading @@ -1475,7 +1475,7 @@ public class SettingsProvider extends ContentProvider { return null; } private Setting getLocationProvidersAllowedSetting(int owningUserId) { private Setting getLocationModeSetting(int owningUserId) { synchronized (mLock) { final Setting setting = getGlobalSetting( Global.LOCATION_GLOBAL_KILL_SWITCH); Loading @@ -1486,7 +1486,7 @@ public class SettingsProvider extends ContentProvider { final SettingsState settingsState = mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_SECURE, owningUserId); return settingsState.new Setting( Secure.LOCATION_PROVIDERS_ALLOWED, Secure.LOCATION_MODE, "", // value "", // tag "", // default value Loading @@ -1497,7 +1497,7 @@ public class SettingsProvider extends ContentProvider { @Override public boolean update(String value, boolean setDefault, String packageName, String tag, boolean forceNonSystemPackage) { Slog.wtf(LOG_TAG, "update shoudln't be called on this instance."); Slog.wtf(LOG_TAG, "update shouldn't be called on this instance."); return false; } }; Loading Loading @@ -3115,7 +3115,7 @@ public class SettingsProvider extends ContentProvider { final int key = makeKey(SETTINGS_TYPE_SECURE, userId); mGenerationRegistry.incrementGeneration(key); final Uri uri = getNotificationUriFor(key, Secure.LOCATION_PROVIDERS_ALLOWED); final Uri uri = getNotificationUriFor(key, Secure.LOCATION_MODE); mHandler.obtainMessage(MyHandler.MSG_NOTIFY_URI_CHANGED, userId, 0, uri).sendToTarget(); } Loading services/core/java/com/android/server/LocationManagerService.java +18 −13 Original line number Diff line number Diff line Loading @@ -1972,7 +1972,7 @@ public class LocationManagerService extends ILocationManager.Stub { continue; } // requests that ignore location settings will never provider notifications // requests that ignore location settings will never provide notifications if (isSettingsExemptLocked(record)) { continue; } Loading Loading @@ -2010,6 +2010,7 @@ public class LocationManagerService extends ILocationManager.Stub { WorkSource worksource = new WorkSource(); ProviderRequest providerRequest = new ProviderRequest(); if (records != null && !records.isEmpty()) { long backgroundThrottleInterval; long identity = Binder.clearCallingIdentity(); Loading @@ -2022,7 +2023,9 @@ public class LocationManagerService extends ILocationManager.Stub { Binder.restoreCallingIdentity(identity); } if (records != null && !records.isEmpty()) { final boolean isForegroundOnlyMode = mPowerManager.getLocationPowerSaveMode() == PowerManager.LOCATION_MODE_FOREGROUND_ONLY; // initialize the low power mode to true and set to false if any of the records requires providerRequest.lowPowerMode = true; for (UpdateRecord record : records) { Loading @@ -2037,7 +2040,9 @@ public class LocationManagerService extends ILocationManager.Stub { record.mReceiver.mAllowedResolutionLevel)) { continue; } if (!provider.isUseableLocked()) { final boolean isBatterySaverDisablingLocation = isForegroundOnlyMode && !record.mIsForegroundUid; if (!provider.isUseableLocked() || isBatterySaverDisablingLocation) { if (isSettingsExemptLocked(record)) { providerRequest.locationSettingsIgnored = true; providerRequest.lowPowerMode = false; Loading Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1952,6 +1952,7 @@ package android.provider { public static final class Settings.Global extends android.provider.Settings.NameValueTable { field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages"; field public static final String AUTOMATIC_POWER_SAVER_MODE = "automatic_power_saver_mode"; field public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; field public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = "captive_portal_fallback_probe_specs"; field public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url"; field public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url"; Loading
core/java/android/os/PowerManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1569,7 +1569,7 @@ public final class PowerManager { @LocationPowerSaveMode public int getLocationPowerSaveMode() { final PowerSaveState powerSaveState = getPowerSaveState(ServiceType.LOCATION); if (!powerSaveState.globalBatterySaverEnabled) { if (!powerSaveState.batterySaverEnabled) { return LOCATION_MODE_NO_CHANGE; } return powerSaveState.locationMode; Loading
core/java/android/provider/Settings.java +1 −0 Original line number Diff line number Diff line Loading @@ -11523,6 +11523,7 @@ public final class Settings { * @hide * @see com.android.server.power.batterysaver.BatterySaverPolicy */ @TestApi public static final String BATTERY_SAVER_CONSTANTS = "battery_saver_constants"; /** Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +6 −6 Original line number Diff line number Diff line Loading @@ -1379,8 +1379,8 @@ public class SettingsProvider extends ContentProvider { } } if (enableOverride) { if (Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) { final Setting overridden = getLocationProvidersAllowedSetting(owningUserId); if (Secure.LOCATION_MODE.equals(name)) { final Setting overridden = getLocationModeSetting(owningUserId); if (overridden != null) { return overridden; } Loading Loading @@ -1475,7 +1475,7 @@ public class SettingsProvider extends ContentProvider { return null; } private Setting getLocationProvidersAllowedSetting(int owningUserId) { private Setting getLocationModeSetting(int owningUserId) { synchronized (mLock) { final Setting setting = getGlobalSetting( Global.LOCATION_GLOBAL_KILL_SWITCH); Loading @@ -1486,7 +1486,7 @@ public class SettingsProvider extends ContentProvider { final SettingsState settingsState = mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_SECURE, owningUserId); return settingsState.new Setting( Secure.LOCATION_PROVIDERS_ALLOWED, Secure.LOCATION_MODE, "", // value "", // tag "", // default value Loading @@ -1497,7 +1497,7 @@ public class SettingsProvider extends ContentProvider { @Override public boolean update(String value, boolean setDefault, String packageName, String tag, boolean forceNonSystemPackage) { Slog.wtf(LOG_TAG, "update shoudln't be called on this instance."); Slog.wtf(LOG_TAG, "update shouldn't be called on this instance."); return false; } }; Loading Loading @@ -3115,7 +3115,7 @@ public class SettingsProvider extends ContentProvider { final int key = makeKey(SETTINGS_TYPE_SECURE, userId); mGenerationRegistry.incrementGeneration(key); final Uri uri = getNotificationUriFor(key, Secure.LOCATION_PROVIDERS_ALLOWED); final Uri uri = getNotificationUriFor(key, Secure.LOCATION_MODE); mHandler.obtainMessage(MyHandler.MSG_NOTIFY_URI_CHANGED, userId, 0, uri).sendToTarget(); } Loading
services/core/java/com/android/server/LocationManagerService.java +18 −13 Original line number Diff line number Diff line Loading @@ -1972,7 +1972,7 @@ public class LocationManagerService extends ILocationManager.Stub { continue; } // requests that ignore location settings will never provider notifications // requests that ignore location settings will never provide notifications if (isSettingsExemptLocked(record)) { continue; } Loading Loading @@ -2010,6 +2010,7 @@ public class LocationManagerService extends ILocationManager.Stub { WorkSource worksource = new WorkSource(); ProviderRequest providerRequest = new ProviderRequest(); if (records != null && !records.isEmpty()) { long backgroundThrottleInterval; long identity = Binder.clearCallingIdentity(); Loading @@ -2022,7 +2023,9 @@ public class LocationManagerService extends ILocationManager.Stub { Binder.restoreCallingIdentity(identity); } if (records != null && !records.isEmpty()) { final boolean isForegroundOnlyMode = mPowerManager.getLocationPowerSaveMode() == PowerManager.LOCATION_MODE_FOREGROUND_ONLY; // initialize the low power mode to true and set to false if any of the records requires providerRequest.lowPowerMode = true; for (UpdateRecord record : records) { Loading @@ -2037,7 +2040,9 @@ public class LocationManagerService extends ILocationManager.Stub { record.mReceiver.mAllowedResolutionLevel)) { continue; } if (!provider.isUseableLocked()) { final boolean isBatterySaverDisablingLocation = isForegroundOnlyMode && !record.mIsForegroundUid; if (!provider.isUseableLocked() || isBatterySaverDisablingLocation) { if (isSettingsExemptLocked(record)) { providerRequest.locationSettingsIgnored = true; providerRequest.lowPowerMode = false; Loading