Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -6459,4 +6459,7 @@ <!-- Whether the AOSP support for app cloning building blocks is to be enabled for the device. --> <bool name="config_enableAppCloningBuildingBlocks">true</bool> <!-- Whether unlocking and waking a device are sequenced --> <bool name="config_orderUnlockAndWake">false</bool> </resources> core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -5132,4 +5132,7 @@ <java-symbol type="drawable" name="focus_event_pressed_key_background" /> <java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" /> <!-- Whether we order unlocking and waking --> <java-symbol type="bool" name="config_orderUnlockAndWake" /> </resources> packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +19 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, */ private final int mDreamOpenAnimationDuration; /** * Whether unlock and wake should be sequenced. */ private final boolean mOrderUnlockAndWake; /** * The animation used for hiding keyguard. This is used to fetch the animation timings if * WindowManager is not providing us with them. Loading Loading @@ -1434,6 +1439,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mMainDispatcher = mainDispatcher; mDreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel; mOrderUnlockAndWake = context.getResources().getBoolean( com.android.internal.R.bool.config_orderUnlockAndWake); } public void userActivity() { Loading Loading @@ -2781,6 +2789,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private void setUnlockAndWakeFromDream(boolean updatedValue, @WakeAndUnlockUpdateReason int reason) { if (!mOrderUnlockAndWake) { return; } if (updatedValue == mUnlockingAndWakingFromDream) { return; } Loading Loading @@ -2863,6 +2875,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, null /* nonApps */, null /* finishedCallback */); }); } // It's possible that the device was unlocked (via BOUNCER or Fingerprint) while // dreaming. It's time to wake up. if (mDreamOverlayShowing && !mOrderUnlockAndWake) { mPM.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_GESTURE, "com.android.systemui:UNLOCK_DREAMING"); } } Trace.endSection(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +8 −4 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp private final VibratorHelper mVibratorHelper; private final BiometricUnlockLogger mLogger; private final SystemClock mSystemClock; private final boolean mOrderUnlockAndWake; private long mLastFpFailureUptimeMillis; private int mNumConsecutiveFpFailures; Loading Loading @@ -308,6 +309,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp mVibratorHelper = vibrator; mLogger = biometricUnlockLogger; mSystemClock = systemClock; mOrderUnlockAndWake = resources.getBoolean( com.android.internal.R.bool.config_orderUnlockAndWake); dumpManager.registerDumpable(getClass().getName(), this); } Loading Loading @@ -462,10 +465,11 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp Trace.endSection(); }; final boolean wakingFromDream = mMode == MODE_WAKE_AND_UNLOCK_FROM_DREAM && mPowerManager.isInteractive(); final boolean wakeInKeyguard = mMode == MODE_WAKE_AND_UNLOCK_FROM_DREAM && mPowerManager.isInteractive() && mOrderUnlockAndWake && mOrderUnlockAndWake; if (mMode != MODE_NONE && !wakingFromDream) { if (mMode != MODE_NONE && !wakeInKeyguard) { wakeUp.run(); } switch (mMode) { Loading Loading @@ -501,7 +505,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp // later to awaken. } mNotificationShadeWindowController.setNotificationShadeFocusable(false); mKeyguardViewMediator.onWakeAndUnlocking(wakingFromDream); mKeyguardViewMediator.onWakeAndUnlocking(wakeInKeyguard); Trace.endSection(); break; case MODE_ONLY_WAKE: Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -602,6 +602,9 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { @Test public void testWakeAndUnlockingOverDream() { // Ensure ordering unlock and wake is enabled. createAndStartViewMediator(true); // Send signal to wake mViewMediator.onWakeAndUnlocking(true); Loading Loading @@ -631,6 +634,9 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { @Test public void testWakeAndUnlockingOverDream_signalAuthenticateIfStillShowing() { // Ensure ordering unlock and wake is enabled. createAndStartViewMediator(true); // Send signal to wake mViewMediator.onWakeAndUnlocking(true); Loading Loading @@ -787,6 +793,15 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { } private void createAndStartViewMediator() { createAndStartViewMediator(false); } private void createAndStartViewMediator(boolean orderUnlockAndWake) { if (orderUnlockAndWake) { mContext.getOrCreateTestableResources().addOverride( com.android.internal.R.bool.config_orderUnlockAndWake, orderUnlockAndWake); } mViewMediator = new KeyguardViewMediator( mContext, mUiEventLogger, Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -6459,4 +6459,7 @@ <!-- Whether the AOSP support for app cloning building blocks is to be enabled for the device. --> <bool name="config_enableAppCloningBuildingBlocks">true</bool> <!-- Whether unlocking and waking a device are sequenced --> <bool name="config_orderUnlockAndWake">false</bool> </resources>
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -5132,4 +5132,7 @@ <java-symbol type="drawable" name="focus_event_pressed_key_background" /> <java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" /> <!-- Whether we order unlocking and waking --> <java-symbol type="bool" name="config_orderUnlockAndWake" /> </resources>
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +19 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, */ private final int mDreamOpenAnimationDuration; /** * Whether unlock and wake should be sequenced. */ private final boolean mOrderUnlockAndWake; /** * The animation used for hiding keyguard. This is used to fetch the animation timings if * WindowManager is not providing us with them. Loading Loading @@ -1434,6 +1439,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mMainDispatcher = mainDispatcher; mDreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel; mOrderUnlockAndWake = context.getResources().getBoolean( com.android.internal.R.bool.config_orderUnlockAndWake); } public void userActivity() { Loading Loading @@ -2781,6 +2789,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private void setUnlockAndWakeFromDream(boolean updatedValue, @WakeAndUnlockUpdateReason int reason) { if (!mOrderUnlockAndWake) { return; } if (updatedValue == mUnlockingAndWakingFromDream) { return; } Loading Loading @@ -2863,6 +2875,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, null /* nonApps */, null /* finishedCallback */); }); } // It's possible that the device was unlocked (via BOUNCER or Fingerprint) while // dreaming. It's time to wake up. if (mDreamOverlayShowing && !mOrderUnlockAndWake) { mPM.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_GESTURE, "com.android.systemui:UNLOCK_DREAMING"); } } Trace.endSection(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +8 −4 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp private final VibratorHelper mVibratorHelper; private final BiometricUnlockLogger mLogger; private final SystemClock mSystemClock; private final boolean mOrderUnlockAndWake; private long mLastFpFailureUptimeMillis; private int mNumConsecutiveFpFailures; Loading Loading @@ -308,6 +309,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp mVibratorHelper = vibrator; mLogger = biometricUnlockLogger; mSystemClock = systemClock; mOrderUnlockAndWake = resources.getBoolean( com.android.internal.R.bool.config_orderUnlockAndWake); dumpManager.registerDumpable(getClass().getName(), this); } Loading Loading @@ -462,10 +465,11 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp Trace.endSection(); }; final boolean wakingFromDream = mMode == MODE_WAKE_AND_UNLOCK_FROM_DREAM && mPowerManager.isInteractive(); final boolean wakeInKeyguard = mMode == MODE_WAKE_AND_UNLOCK_FROM_DREAM && mPowerManager.isInteractive() && mOrderUnlockAndWake && mOrderUnlockAndWake; if (mMode != MODE_NONE && !wakingFromDream) { if (mMode != MODE_NONE && !wakeInKeyguard) { wakeUp.run(); } switch (mMode) { Loading Loading @@ -501,7 +505,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp // later to awaken. } mNotificationShadeWindowController.setNotificationShadeFocusable(false); mKeyguardViewMediator.onWakeAndUnlocking(wakingFromDream); mKeyguardViewMediator.onWakeAndUnlocking(wakeInKeyguard); Trace.endSection(); break; case MODE_ONLY_WAKE: Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -602,6 +602,9 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { @Test public void testWakeAndUnlockingOverDream() { // Ensure ordering unlock and wake is enabled. createAndStartViewMediator(true); // Send signal to wake mViewMediator.onWakeAndUnlocking(true); Loading Loading @@ -631,6 +634,9 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { @Test public void testWakeAndUnlockingOverDream_signalAuthenticateIfStillShowing() { // Ensure ordering unlock and wake is enabled. createAndStartViewMediator(true); // Send signal to wake mViewMediator.onWakeAndUnlocking(true); Loading Loading @@ -787,6 +793,15 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { } private void createAndStartViewMediator() { createAndStartViewMediator(false); } private void createAndStartViewMediator(boolean orderUnlockAndWake) { if (orderUnlockAndWake) { mContext.getOrCreateTestableResources().addOverride( com.android.internal.R.bool.config_orderUnlockAndWake, orderUnlockAndWake); } mViewMediator = new KeyguardViewMediator( mContext, mUiEventLogger, Loading