From 5cd30333601d2e71eab7e9dd5380ced2bf453ea1 Mon Sep 17 00:00:00 2001 From: Chandru S Date: Mon, 10 Apr 2023 11:45:44 -0700 Subject: [PATCH] Wire up KeyguardFaceAuthInteractor to trigger face auth from NotificationPanelViewController Bug: 262838215 Test: verified the trigger manually with the flag enabled Change-Id: I090be3fad40d6dd2b73d45eaa654ab52d36a10f7 --- .../systemui/shade/NotificationPanelViewController.java | 7 ++++++- .../shade/NotificationPanelViewControllerBaseTest.java | 6 ++++-- .../shade/NotificationPanelViewControllerTest.java | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 222a0f4fa2484..a4a7d4cd76e59 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -129,6 +129,7 @@ import com.android.systemui.fragments.FragmentService; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.keyguard.domain.interactor.AlternateBouncerInteractor; 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.KeyguardTransitionInteractor; 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 KeyguardBypassController mKeyguardBypassController; private final KeyguardUpdateMonitor mUpdateMonitor; + private final KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor; private final ConversationNotificationManager mConversationNotificationManager; private final AuthController mAuthController; private final MediaHierarchyManager mMediaHierarchyManager; @@ -747,7 +749,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump DumpManager dumpManager, KeyguardLongPressViewModel keyguardLongPressViewModel, KeyguardInteractor keyguardInteractor, - ActivityStarter activityStarter) { + ActivityStarter activityStarter, + KeyguardFaceAuthInteractor keyguardFaceAuthInteractor) { mInteractionJankMonitor = interactionJankMonitor; keyguardStateController.addCallback(new KeyguardStateController.Callback() { @Override @@ -891,6 +894,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mScreenOffAnimationController = screenOffAnimationController; mUnlockedScreenOffAnimationController = unlockedScreenOffAnimationController; mLastDownEvents = new NPVCDownEventState.Buffer(MAX_DOWN_EVENT_BUFFER_SIZE); + mKeyguardFaceAuthInteractor = keyguardFaceAuthInteractor; int currentMode = navigationModeController.addListener( mode -> mIsGestureNavigation = QuickStepContract.isGesturalMode(mode)); @@ -2764,6 +2768,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mShadeLog.v("onMiddleClicked on Keyguard, mDozingOnDown: false"); // Try triggering face auth, this "might" run. Check // KeyguardUpdateMonitor#shouldListenForFace to see when face auth won't run. + mKeyguardFaceAuthInteractor.onNotificationPanelClicked(); boolean didFaceAuthRun = mUpdateMonitor.requestFaceAuth( FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED); diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java index 4bfd6a2e28f43..068d933652acf 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java @@ -303,6 +303,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { protected ArgumentCaptor mEmptySpaceClickListenerCaptor; @Mock protected ActivityStarter mActivityStarter; + @Mock protected KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor; protected KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor; protected KeyguardInteractor mKeyguardInteractor; @@ -600,7 +601,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mDumpManager, mKeyuardLongPressViewModel, mKeyguardInteractor, - mActivityStarter); + mActivityStarter, + mKeyguardFaceAuthInteractor); mNotificationPanelViewController.initDependencies( mCentralSurfaces, null, @@ -667,7 +669,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mFeatureFlags, mInteractionJankMonitor, mShadeLog, - mock(KeyguardFaceAuthInteractor.class) + mKeyguardFaceAuthInteractor ); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java index 2db9c9788bf80..600fb5c2e1bcb 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -930,6 +930,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo mTouchHandler.onTouch(mock(View.class), mDownMotionEvent); mEmptySpaceClickListenerCaptor.getValue().onEmptySpaceClicked(0, 0); + verify(mKeyguardFaceAuthInteractor).onNotificationPanelClicked(); verify(mUpdateMonitor).requestFaceAuth( FaceAuthApiRequestReason.NOTIFICATION_PANEL_CLICKED); }