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

Commit e91933f8 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "ActiveUnlock dismisses keyguard on trigger from assistant" into...

Merge "ActiveUnlock dismisses keyguard on trigger from assistant" into tm-qpr-dev am: d41ebc8b am: 433ad6c2 am: e9580347 am: f40f1efb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22134780



Change-Id: I45784365056d7a0ed51259ed3bc225d3fd3dfbc2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 58adf1e1 f40f1efb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1611,7 +1611,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            requestActiveUnlock(
                    ActiveUnlockConfig.ActiveUnlockRequestOrigin.ASSISTANT,
                    "assistant",
                    false);
                    /* dismissKeyguard */ true);
        }
    }

+20 −0
Original line number Diff line number Diff line
@@ -2255,6 +2255,26 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
        assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
    }

    @Test
    public void assistantVisible_requestActiveUnlock() {
        // GIVEN active unlock requests from the assistant are allowed
        when(mActiveUnlockConfig.shouldAllowActiveUnlockFromOrigin(
                ActiveUnlockConfig.ActiveUnlockRequestOrigin.ASSISTANT)).thenReturn(true);

        // GIVEN should trigger active unlock
        keyguardIsVisible();
        keyguardNotGoingAway();
        statusBarShadeIsNotLocked();
        when(mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())).thenReturn(true);

        // WHEN the assistant is visible
        mKeyguardUpdateMonitor.setAssistantVisible(true);

        // THEN request unlock with keyguard dismissal
        verify(mTrustManager).reportUserRequestedUnlock(eq(KeyguardUpdateMonitor.getCurrentUser()),
                eq(true));
    }

    @Test
    public void fingerprintFailure_requestActiveUnlock_dismissKeyguard()
            throws RemoteException {