Loading services/core/java/com/android/server/location/LocationProviderManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -524,16 +524,18 @@ class LocationProviderManager extends } } if (baseRequest.isLocationSettingsIgnored()) { boolean locationSettingsIgnored = baseRequest.isLocationSettingsIgnored(); if (locationSettingsIgnored) { // if we are not currently allowed use location settings ignored, disable it if (!mSettingsHelper.getIgnoreSettingsPackageWhitelist().contains( getIdentity().getPackageName()) && !mLocationManagerInternal.isProvider( null, getIdentity())) { builder.setLocationSettingsIgnored(false); locationSettingsIgnored = false; } } if (!baseRequest.isLocationSettingsIgnored() && !isThrottlingExempt()) { if (!locationSettingsIgnored && !isThrottlingExempt()) { // throttle in the background if (!mForeground) { builder.setIntervalMillis(max(baseRequest.getIntervalMillis(), Loading services/core/java/com/android/server/location/util/LocationPowerSaveModeHelper.java +11 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,13 @@ package com.android.server.location.util; import static android.os.PowerManager.locationPowerSaveModeToString; import static com.android.server.location.LocationManagerService.D; import static com.android.server.location.LocationManagerService.TAG; import android.os.PowerManager.LocationPowerSaveMode; import android.util.Log; import java.util.concurrent.CopyOnWriteArrayList; Loading Loading @@ -60,7 +66,12 @@ public abstract class LocationPowerSaveModeHelper { protected final void notifyLocationPowerSaveModeChanged( @LocationPowerSaveMode int locationPowerSaveMode) { if (D) { Log.d(TAG, "location power save mode is now " + locationPowerSaveModeToString( locationPowerSaveMode)); } mLocationEventLog.logLocationPowerSaveMode(locationPowerSaveMode); for (LocationPowerSaveModeChangedListener listener : mListeners) { listener.onLocationPowerSaveModeChanged(locationPowerSaveMode); } Loading services/core/java/com/android/server/location/util/ScreenInteractiveHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,11 @@ package com.android.server.location.util; import static com.android.server.location.LocationManagerService.D; import static com.android.server.location.LocationManagerService.TAG; import android.util.Log; import java.util.concurrent.CopyOnWriteArrayList; /** Loading Loading @@ -55,6 +60,10 @@ public abstract class ScreenInteractiveHelper { } protected final void notifyScreenInteractiveChanged(boolean interactive) { if (D) { Log.d(TAG, "screen interactive is now " + interactive); } for (ScreenInteractiveChangedListener listener : mListeners) { listener.onScreenInteractiveChanged(interactive); } Loading Loading
services/core/java/com/android/server/location/LocationProviderManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -524,16 +524,18 @@ class LocationProviderManager extends } } if (baseRequest.isLocationSettingsIgnored()) { boolean locationSettingsIgnored = baseRequest.isLocationSettingsIgnored(); if (locationSettingsIgnored) { // if we are not currently allowed use location settings ignored, disable it if (!mSettingsHelper.getIgnoreSettingsPackageWhitelist().contains( getIdentity().getPackageName()) && !mLocationManagerInternal.isProvider( null, getIdentity())) { builder.setLocationSettingsIgnored(false); locationSettingsIgnored = false; } } if (!baseRequest.isLocationSettingsIgnored() && !isThrottlingExempt()) { if (!locationSettingsIgnored && !isThrottlingExempt()) { // throttle in the background if (!mForeground) { builder.setIntervalMillis(max(baseRequest.getIntervalMillis(), Loading
services/core/java/com/android/server/location/util/LocationPowerSaveModeHelper.java +11 −0 Original line number Diff line number Diff line Loading @@ -16,7 +16,13 @@ package com.android.server.location.util; import static android.os.PowerManager.locationPowerSaveModeToString; import static com.android.server.location.LocationManagerService.D; import static com.android.server.location.LocationManagerService.TAG; import android.os.PowerManager.LocationPowerSaveMode; import android.util.Log; import java.util.concurrent.CopyOnWriteArrayList; Loading Loading @@ -60,7 +66,12 @@ public abstract class LocationPowerSaveModeHelper { protected final void notifyLocationPowerSaveModeChanged( @LocationPowerSaveMode int locationPowerSaveMode) { if (D) { Log.d(TAG, "location power save mode is now " + locationPowerSaveModeToString( locationPowerSaveMode)); } mLocationEventLog.logLocationPowerSaveMode(locationPowerSaveMode); for (LocationPowerSaveModeChangedListener listener : mListeners) { listener.onLocationPowerSaveModeChanged(locationPowerSaveMode); } Loading
services/core/java/com/android/server/location/util/ScreenInteractiveHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,11 @@ package com.android.server.location.util; import static com.android.server.location.LocationManagerService.D; import static com.android.server.location.LocationManagerService.TAG; import android.util.Log; import java.util.concurrent.CopyOnWriteArrayList; /** Loading Loading @@ -55,6 +60,10 @@ public abstract class ScreenInteractiveHelper { } protected final void notifyScreenInteractiveChanged(boolean interactive) { if (D) { Log.d(TAG, "screen interactive is now " + interactive); } for (ScreenInteractiveChangedListener listener : mListeners) { listener.onScreenInteractiveChanged(interactive); } Loading