LocationPowerSaveModeLog

  • The getLocationPowerSaveMode() API defines how location services behave when the device's battery saver is enabled.

  • Location providers can be unaffected, disabled based on screen state and provider type (GPS or all), restricted to foreground apps, or throttled when the screen is off.

  • The LOCATION_POWER_SAVE_MODE_LOG_* enums specify different power saving configurations for location services, ranging from no change to disabling all providers when the screen is off.

How location features are configured to behave on the mobile device when the device's battery saver feature is on. (https://developer.android.com/reference/android/os/PowerManager#getLocationPowerSaveMode())

Enums
LOCATION_POWER_SAVE_MODE_LOG_UNSPECIFIED Undefined LocationPowerSaveMode
LOCATION_POWER_SAVE_MODE_LOG_NO_CHANGE Either the location providers shouldn't be affected by battery saver, or battery saver is off.
LOCATION_POWER_SAVE_MODE_LOG_GPS_DISABLED_WHEN_SCREEN_OFF The GPS-based location provider should be disabled when battery saver is on and the device is non-interactive.
LOCATION_POWER_SAVE_MODE_LOG_ALL_DISABLED_WHEN_SCREEN_OFF All location providers should be disabled when battery saver is on and the device is non-interactive.
LOCATION_POWER_SAVE_MODE_LOG_FOREGROUND_ONLY All the location providers will be kept available, but location fixes should only be provided to foreground apps.
LOCATION_POWER_SAVE_MODE_LOG_THROTTLE_REQUESTS_WHEN_SCREEN_OFF Location will not be turned off, but LocationManager will throttle all requests to providers when the device is non-interactive.