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

Commit 09ab1797 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Configurable wake-up delay"

parents fbc1b625 2920eea7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1282,6 +1282,10 @@
         that can be set by the user. -->
    <integer name="config_screenBrightnessDoze">1</integer>

    <!-- Delay that allows some content to arrive at the display before switching
         from DOZE to ON. -->
    <integer name="config_wakeUpDelayDoze">0</integer>

    <!-- Whether or not to skip the initial brightness ramps when the display transitions to
         STATE_ON. Setting this to true will skip the brightness ramp to the last stored active
         brightness value and will repeat for the following ramp if autobrightness is enabled. -->
+1 −0
Original line number Diff line number Diff line
@@ -3460,4 +3460,5 @@
  <java-symbol type="string" name="config_misprovisionedBrandValue" />

  <java-symbol type="integer" name="db_wal_truncate_size" />
  <java-symbol type="integer" name="config_wakeUpDelayDoze" />
</resources>
+5 −2
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
    private StatusBar mStatusBar;
    private final UnlockMethodCache mUnlockMethodCache;
    private final Context mContext;
    private final int mWakeUpDelay;
    private int mPendingAuthenticatedUserId = -1;
    private BiometricSourceType mPendingAuthenticatedBioSourceType = null;
    private boolean mPendingShowBouncer;
@@ -131,6 +132,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
        mScrimController = scrimController;
        mStatusBar = statusBar;
        mUnlockMethodCache = unlockMethodCache;
        mWakeUpDelay = context.getResources().getInteger(
                com.android.internal.R.integer.config_wakeUpDelayDoze);
    }

    public void setStatusBarKeyguardViewManager(
@@ -219,7 +222,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
        // During wake and unlock, we need to draw black before waking up to avoid abrupt
        // brightness changes due to display state transitions.
        boolean alwaysOnEnabled = DozeParameters.getInstance(mContext).getAlwaysOn();
        boolean delayWakeUp = mode == MODE_WAKE_AND_UNLOCK && alwaysOnEnabled;
        boolean delayWakeUp = mode == MODE_WAKE_AND_UNLOCK && alwaysOnEnabled && mWakeUpDelay > 0;
        Runnable wakeUp = ()-> {
            if (!wasDeviceInteractive) {
                if (DEBUG_BIO_WAKELOCK) {
@@ -271,7 +274,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
                }
                mStatusBarWindowController.setStatusBarFocusable(false);
                if (delayWakeUp) {
                    mHandler.postDelayed(wakeUp, 50);
                    mHandler.postDelayed(wakeUp, mWakeUpDelay);
                } else {
                    mKeyguardViewMediator.onWakeAndUnlocking();
                }