Merge "Wire up KeyguardFaceAuthInteractor to trigger face auth from NotificationPanelViewController" into udc-dev

This commit is contained in:
Chandru S
2023-04-12 23:32:56 +00:00
committed by Android (Google) Code Review
3 changed files with 11 additions and 3 deletions

View File

@@ -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);

View File

@@ -303,6 +303,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
protected ArgumentCaptor<NotificationStackScrollLayout.OnEmptySpaceClickListener>
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
);
}

View File

@@ -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);
}