Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4270,4 +4270,7 @@ <!-- Boolean indicating whether frameworks needs to reset cell broadcast geo-fencing check after reboot or airplane mode toggling --> <bool translatable="false" name="reset_geo_fencing_check_after_boot_or_apm">false</bool> <!-- Boolean indicating that the system will use autoSuspend. If set to false, autoSuspend is not used and the system will only suspend upon an explicit request. --> <bool translatable="false" name="config_enableAutoSuspend">true</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3854,4 +3854,5 @@ <java-symbol type="bool" name="config_automotiveHideNavBarForKeyboard" /> <java-symbol type="bool" name="reset_geo_fencing_check_after_boot_or_apm" /> <java-symbol type="bool" name="config_enableAutoSuspend" /> </resources> services/core/java/com/android/server/power/PowerManagerService.java +7 −2 Original line number Diff line number Diff line Loading @@ -421,6 +421,8 @@ public final class PowerManagerService extends SystemService // True if doze should not be started until after the screen off transition. private boolean mDozeAfterScreenOff; private boolean mEnableAutoSuspendConfig; // The minimum screen off timeout, in milliseconds. private long mMinimumScreenOffTimeoutConfig; Loading Loading @@ -954,6 +956,8 @@ public final class PowerManagerService extends SystemService com.android.internal.R.bool.config_powerDecoupleAutoSuspendModeFromDisplay); mDecoupleHalInteractiveModeFromDisplayConfig = resources.getBoolean( com.android.internal.R.bool.config_powerDecoupleInteractiveModeFromDisplay); mEnableAutoSuspendConfig = resources.getBoolean( com.android.internal.R.bool.config_enableAutoSuspend); mWakeUpWhenPluggedOrUnpluggedConfig = resources.getBoolean( com.android.internal.R.bool.config_unplugTurnsOnScreen); mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig = resources.getBoolean( Loading Loading @@ -2625,7 +2629,8 @@ public final class PowerManagerService extends SystemService if (!mDecoupleHalInteractiveModeFromDisplayConfig) { setHalInteractiveModeLocked(false); } if (!mDecoupleHalAutoSuspendModeFromDisplayConfig) { if (mEnableAutoSuspendConfig && !mDecoupleHalAutoSuspendModeFromDisplayConfig) { setHalAutoSuspendModeLocked(true); } } else { Loading Loading @@ -2670,7 +2675,7 @@ public final class PowerManagerService extends SystemService private void updateSuspendBlockerLocked() { final boolean needWakeLockSuspendBlocker = ((mWakeLockSummary & WAKE_LOCK_CPU) != 0); final boolean needDisplaySuspendBlocker = needDisplaySuspendBlockerLocked(); final boolean autoSuspend = !needDisplaySuspendBlocker; final boolean autoSuspend = mEnableAutoSuspendConfig && !needDisplaySuspendBlocker; final boolean interactive = mDisplayPowerRequest.isBrightOrDim(); // Disable auto-suspend if needed. Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4270,4 +4270,7 @@ <!-- Boolean indicating whether frameworks needs to reset cell broadcast geo-fencing check after reboot or airplane mode toggling --> <bool translatable="false" name="reset_geo_fencing_check_after_boot_or_apm">false</bool> <!-- Boolean indicating that the system will use autoSuspend. If set to false, autoSuspend is not used and the system will only suspend upon an explicit request. --> <bool translatable="false" name="config_enableAutoSuspend">true</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3854,4 +3854,5 @@ <java-symbol type="bool" name="config_automotiveHideNavBarForKeyboard" /> <java-symbol type="bool" name="reset_geo_fencing_check_after_boot_or_apm" /> <java-symbol type="bool" name="config_enableAutoSuspend" /> </resources>
services/core/java/com/android/server/power/PowerManagerService.java +7 −2 Original line number Diff line number Diff line Loading @@ -421,6 +421,8 @@ public final class PowerManagerService extends SystemService // True if doze should not be started until after the screen off transition. private boolean mDozeAfterScreenOff; private boolean mEnableAutoSuspendConfig; // The minimum screen off timeout, in milliseconds. private long mMinimumScreenOffTimeoutConfig; Loading Loading @@ -954,6 +956,8 @@ public final class PowerManagerService extends SystemService com.android.internal.R.bool.config_powerDecoupleAutoSuspendModeFromDisplay); mDecoupleHalInteractiveModeFromDisplayConfig = resources.getBoolean( com.android.internal.R.bool.config_powerDecoupleInteractiveModeFromDisplay); mEnableAutoSuspendConfig = resources.getBoolean( com.android.internal.R.bool.config_enableAutoSuspend); mWakeUpWhenPluggedOrUnpluggedConfig = resources.getBoolean( com.android.internal.R.bool.config_unplugTurnsOnScreen); mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig = resources.getBoolean( Loading Loading @@ -2625,7 +2629,8 @@ public final class PowerManagerService extends SystemService if (!mDecoupleHalInteractiveModeFromDisplayConfig) { setHalInteractiveModeLocked(false); } if (!mDecoupleHalAutoSuspendModeFromDisplayConfig) { if (mEnableAutoSuspendConfig && !mDecoupleHalAutoSuspendModeFromDisplayConfig) { setHalAutoSuspendModeLocked(true); } } else { Loading Loading @@ -2670,7 +2675,7 @@ public final class PowerManagerService extends SystemService private void updateSuspendBlockerLocked() { final boolean needWakeLockSuspendBlocker = ((mWakeLockSummary & WAKE_LOCK_CPU) != 0); final boolean needDisplaySuspendBlocker = needDisplaySuspendBlockerLocked(); final boolean autoSuspend = !needDisplaySuspendBlocker; final boolean autoSuspend = mEnableAutoSuspendConfig && !needDisplaySuspendBlocker; final boolean interactive = mDisplayPowerRequest.isBrightOrDim(); // Disable auto-suspend if needed. Loading