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

Commit 5cd30333 authored by Chandru S's avatar Chandru S
Browse files

Wire up KeyguardFaceAuthInteractor to trigger face auth from NotificationPanelViewController

Bug: 262838215
Test: verified the trigger manually with the flag enabled
Change-Id: I090be3fad40d6dd2b73d45eaa654ab52d36a10f7
parent c5b2cedd
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -129,6 +129,7 @@ import com.android.systemui.fragments.FragmentService;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.domain.interactor.AlternateBouncerInteractor;
import com.android.systemui.keyguard.domain.interactor.AlternateBouncerInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardBottomAreaInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardBottomAreaInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardFaceAuthInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants;
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants;
@@ -330,6 +331,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    private final PulseExpansionHandler mPulseExpansionHandler;
    private final PulseExpansionHandler mPulseExpansionHandler;
    private final KeyguardBypassController mKeyguardBypassController;
    private final KeyguardBypassController mKeyguardBypassController;
    private final KeyguardUpdateMonitor mUpdateMonitor;
    private final KeyguardUpdateMonitor mUpdateMonitor;
    private final KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor;
    private final ConversationNotificationManager mConversationNotificationManager;
    private final ConversationNotificationManager mConversationNotificationManager;
    private final AuthController mAuthController;
    private final AuthController mAuthController;
    private final MediaHierarchyManager mMediaHierarchyManager;
    private final MediaHierarchyManager mMediaHierarchyManager;
@@ -747,7 +749,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            DumpManager dumpManager,
            DumpManager dumpManager,
            KeyguardLongPressViewModel keyguardLongPressViewModel,
            KeyguardLongPressViewModel keyguardLongPressViewModel,
            KeyguardInteractor keyguardInteractor,
            KeyguardInteractor keyguardInteractor,
            ActivityStarter activityStarter) {
            ActivityStarter activityStarter,
            KeyguardFaceAuthInteractor keyguardFaceAuthInteractor) {
        mInteractionJankMonitor = interactionJankMonitor;
        mInteractionJankMonitor = interactionJankMonitor;
        keyguardStateController.addCallback(new KeyguardStateController.Callback() {
        keyguardStateController.addCallback(new KeyguardStateController.Callback() {
            @Override
            @Override
@@ -891,6 +894,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mScreenOffAnimationController = screenOffAnimationController;
        mScreenOffAnimationController = screenOffAnimationController;
        mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
        mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController;
        mLastDownEvents = new NPVCDownEventState.Buffer(MAX_DOWN_EVENT_BUFFER_SIZE);
        mLastDownEvents = new NPVCDownEventState.Buffer(MAX_DOWN_EVENT_BUFFER_SIZE);
        mKeyguardFaceAuthInteractor = keyguardFaceAuthInteractor;


        int currentMode = navigationModeController.addListener(
        int currentMode = navigationModeController.addListener(
                mode -> mIsGestureNavigation = QuickStepContract.isGesturalMode(mode));
                mode -> mIsGestureNavigation = QuickStepContract.isGesturalMode(mode));
@@ -2764,6 +2768,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                    mShadeLog.v("onMiddleClicked on Keyguard, mDozingOnDown: false");
                    mShadeLog.v("onMiddleClicked on Keyguard, mDozingOnDown: false");
                    // Try triggering face auth, this "might" run. Check
                    // Try triggering face auth, this "might" run. Check
                    // KeyguardUpdateMonitor#shouldListenForFace to see when face auth won't run.
                    // KeyguardUpdateMonitor#shouldListenForFace to see when face auth won't run.
                    mKeyguardFaceAuthInteractor.onNotificationPanelClicked();
                    boolean didFaceAuthRun = mUpdateMonitor.requestFaceAuth(
                    boolean didFaceAuthRun = mUpdateMonitor.requestFaceAuth(
                            FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED);
                            FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED);


+4 −2
Original line number Original line Diff line number Diff line
@@ -303,6 +303,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    protected ArgumentCaptor<NotificationStackScrollLayout.OnEmptySpaceClickListener>
    protected ArgumentCaptor<NotificationStackScrollLayout.OnEmptySpaceClickListener>
            mEmptySpaceClickListenerCaptor;
            mEmptySpaceClickListenerCaptor;
    @Mock protected ActivityStarter mActivityStarter;
    @Mock protected ActivityStarter mActivityStarter;
    @Mock protected KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor;


    protected KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor;
    protected KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor;
    protected KeyguardInteractor mKeyguardInteractor;
    protected KeyguardInteractor mKeyguardInteractor;
@@ -600,7 +601,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                mDumpManager,
                mDumpManager,
                mKeyuardLongPressViewModel,
                mKeyuardLongPressViewModel,
                mKeyguardInteractor,
                mKeyguardInteractor,
                mActivityStarter);
                mActivityStarter,
                mKeyguardFaceAuthInteractor);
        mNotificationPanelViewController.initDependencies(
        mNotificationPanelViewController.initDependencies(
                mCentralSurfaces,
                mCentralSurfaces,
                null,
                null,
@@ -667,7 +669,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                mFeatureFlags,
                mFeatureFlags,
                mInteractionJankMonitor,
                mInteractionJankMonitor,
                mShadeLog,
                mShadeLog,
                mock(KeyguardFaceAuthInteractor.class)
                mKeyguardFaceAuthInteractor
        );
        );
    }
    }


+1 −0
Original line number Original line Diff line number Diff line
@@ -930,6 +930,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
        mTouchHandler.onTouch(mock(View.class), mDownMotionEvent);
        mTouchHandler.onTouch(mock(View.class), mDownMotionEvent);
        mEmptySpaceClickListenerCaptor.getValue().onEmptySpaceClicked(0, 0);
        mEmptySpaceClickListenerCaptor.getValue().onEmptySpaceClicked(0, 0);


        verify(mKeyguardFaceAuthInteractor).onNotificationPanelClicked();
        verify(mUpdateMonitor).requestFaceAuth(
        verify(mUpdateMonitor).requestFaceAuth(
                FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED);
                FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED);
    }
    }