Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 725479de authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

[DO NOT MERGE] Add a configuration to allow disabling auto-suspend am: c594d702

Change-Id: I8ff9222b084c95e263f9c9ebfbbbbecebb22e784
parents 3bb91399 c594d702
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4332,4 +4332,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>
+1 −0
Original line number Diff line number Diff line
@@ -3860,4 +3860,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>
+7 −2
Original line number Diff line number Diff line
@@ -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;

@@ -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(
@@ -2625,7 +2629,8 @@ public final class PowerManagerService extends SystemService
                        if (!mDecoupleHalInteractiveModeFromDisplayConfig) {
                            setHalInteractiveModeLocked(false);
                        }
                        if (!mDecoupleHalAutoSuspendModeFromDisplayConfig) {
                        if (mEnableAutoSuspendConfig
                                && !mDecoupleHalAutoSuspendModeFromDisplayConfig) {
                            setHalAutoSuspendModeLocked(true);
                        }
                    } else {
@@ -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.