Merge changes I5150d58a,If6c3edbf into tm-qpr-dev am: 56f76309da am: bef584eefa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21931915 Change-Id: I7338c53a0c675e7d79ca76a0c62fbaa717e3fee1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -260,6 +260,14 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
|
||||
*/
|
||||
@Override
|
||||
public void finish(boolean strongAuth, int targetUserId) {
|
||||
if (mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)
|
||||
&& !mKeyguardStateController.canDismissLockScreen() && !strongAuth) {
|
||||
Log.e(TAG,
|
||||
"Tried to dismiss keyguard when lockscreen is not dismissible and user "
|
||||
+ "was not authenticated with a primary security method "
|
||||
+ "(pin/password/pattern).");
|
||||
return;
|
||||
}
|
||||
// If there's a pending runnable because the user interacted with a widget
|
||||
// and we're leaving keyguard, then run it.
|
||||
boolean deferKeyguardDone = false;
|
||||
|
||||
@@ -228,6 +228,11 @@ object Flags {
|
||||
@JvmField
|
||||
val ASYNC_INFLATE_BOUNCER = unreleasedFlag(229, "async_inflate_bouncer", teamfood = true)
|
||||
|
||||
/** Whether to inflate the bouncer view on a background thread. */
|
||||
// TODO(b/273341787): Tracking Bug
|
||||
@JvmField
|
||||
val PREVENT_BYPASS_KEYGUARD = unreleasedFlag(230, "prevent_bypass_keyguard")
|
||||
|
||||
// 300 - power menu
|
||||
// TODO(b/254512600): Tracking Bug
|
||||
@JvmField val POWER_MENU_LITE = releasedFlag(300, "power_menu_lite")
|
||||
|
||||
@@ -196,6 +196,7 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
|
||||
.thenReturn(mKeyguardMessageAreaController);
|
||||
when(mKeyguardPasswordView.getWindowInsetsController()).thenReturn(mWindowInsetsController);
|
||||
when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(SecurityMode.PIN);
|
||||
when(mKeyguardStateController.canDismissLockScreen()).thenReturn(true);
|
||||
mKeyguardPasswordViewController = new KeyguardPasswordViewController(
|
||||
(KeyguardPasswordView) mKeyguardPasswordView, mKeyguardUpdateMonitor,
|
||||
SecurityMode.Password, mLockPatternUtils, null,
|
||||
@@ -553,6 +554,22 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
|
||||
assertThat(mKeyguardSecurityContainerController.willRunDismissFromKeyguard()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSecurityCallbackFinish() {
|
||||
when(mKeyguardStateController.canDismissLockScreen()).thenReturn(true);
|
||||
when(mKeyguardUpdateMonitor.isUserUnlocked(0)).thenReturn(true);
|
||||
mKeyguardSecurityContainerController.finish(true, 0);
|
||||
verify(mViewMediatorCallback).keyguardDone(anyBoolean(), anyInt());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSecurityCallbackFinish_cannotDismissLockScreenAndNotStrongAuth() {
|
||||
when(mFeatureFlags.isEnabled(Flags.PREVENT_BYPASS_KEYGUARD)).thenReturn(true);
|
||||
when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false);
|
||||
mKeyguardSecurityContainerController.finish(false, 0);
|
||||
verify(mViewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnStartingToHide() {
|
||||
mKeyguardSecurityContainerController.onStartingToHide();
|
||||
|
||||
Reference in New Issue
Block a user