From 43921e4c315909d341456056685d9063abcbbd6a Mon Sep 17 00:00:00 2001 From: Beverly Date: Thu, 29 Oct 2020 14:24:38 -0400 Subject: [PATCH] Recalculate max # notifs on keyguard w/ udfps - By default, show the new lockscreen on devices that have UDFPS - Hide lock icon if UDFPS is on the device (eventually isUdfpsEnrolled should check enrollment) - Don't take into account the lock icon when calculating the clock position top padding in the KeyguardClockPositionAlgorithm Bug: 165260390 Test: atest SystemUITests Change-Id: Ia3c644256a8901144ebc6362df4d9585a6a29165 --- .../layout/keyguard_clock_switch.xml | 2 +- .../keyguard/KeyguardUpdateMonitor.java | 8 +++-- .../systemui/biometrics/AuthController.java | 10 +++++- .../systemui/biometrics/UdfpsController.java | 8 +++++ .../systemui/biometrics/UdfpsView.java | 4 +++ .../android/systemui/doze/DozeSensors.java | 2 +- .../phone/KeyguardClockPositionAlgorithm.java | 32 +++++++++++++------ .../phone/LockscreenLockIconController.java | 13 +++++++- .../NotificationPanelViewController.java | 16 ++++++++-- .../keyguard/KeyguardUpdateMonitorTest.java | 7 +++- .../KeyguardClockPositionAlgorithmTest.java | 2 +- .../phone/LockscreenIconControllerTest.java | 6 +++- .../phone/NotificationPanelViewTest.java | 7 +++- 13 files changed, 95 insertions(+), 22 deletions(-) diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml index 3714db324fb47..939c5f9f7ecbe 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml @@ -73,7 +73,7 @@ android:id="@+id/gradient_clock_view" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="100dp" + android:textSize="80dp" android:letterSpacing="0.02" android:lineSpacingMultiplier=".8" android:includeFontPadding="false" diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 1a98c206eb0dc..d1877cf6d3721 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -94,6 +94,7 @@ import com.android.settingslib.fuelgauge.BatteryStatus; import com.android.systemui.DejankUtils; import com.android.systemui.Dumpable; import com.android.systemui.R; +import com.android.systemui.biometrics.AuthController; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Background; @@ -235,6 +236,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private final Context mContext; private final boolean mIsPrimaryUser; private final boolean mIsAutomotive; + private final AuthController mAuthController; private final StatusBarStateController mStatusBarStateController; HashMap mSimDatas = new HashMap<>(); HashMap mServiceStates = new HashMap(); @@ -1581,7 +1583,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab RingerModeTracker ringerModeTracker, @Background Executor backgroundExecutor, StatusBarStateController statusBarStateController, - LockPatternUtils lockPatternUtils) { + LockPatternUtils lockPatternUtils, + AuthController authController) { mContext = context; mSubscriptionManager = SubscriptionManager.from(context); mDeviceProvisioned = isDeviceProvisionedInSettingsDb(); @@ -1591,6 +1594,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mRingerModeTracker = ringerModeTracker; mStatusBarStateController = statusBarStateController; mLockPatternUtils = lockPatternUtils; + mAuthController = authController; dumpManager.registerDumpable(getClass().getName(), this); mHandler = new Handler(mainLooper) { @@ -1853,7 +1857,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private void updateLockScreenMode() { mLockScreenMode = Settings.Global.getInt(mContext.getContentResolver(), - Settings.Global.SHOW_NEW_LOCKSCREEN, 0); + Settings.Global.SHOW_NEW_LOCKSCREEN, mAuthController.isUdfpsEnrolled() ? 1 : 0); } private final UserSwitchObserver mUserSwitchObserver = new UserSwitchObserver() { diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java index 874c73baf146d..2e6762e5aa10b 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java @@ -29,6 +29,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Configuration; +import android.graphics.RectF; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricPrompt; import android.hardware.biometrics.IBiometricSysuiReceiver; @@ -242,6 +243,13 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, } } + /** + * @return where the UDFPS exists on the screen in pixels. + */ + public RectF getUdfpsRegion() { + return mUdfpsController == null ? null : mUdfpsController.getSensorLocation(); + } + /** * Requests fingerprint scan. * @@ -475,7 +483,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks, /** * Whether the current user has a UDFP enrolled. */ - public boolean hasUdfpsEnrolled() { + public boolean isUdfpsEnrolled() { // TODO: (b/171392825) right now only checks whether the UDFPS sensor exists on this device // but not whether user has enrolled or not return mUdfpsController != null; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 3c2e00869ab84..ad3597eedebc2 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -25,6 +25,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.PixelFormat; import android.graphics.Point; +import android.graphics.RectF; import android.hardware.fingerprint.FingerprintManager; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.hardware.fingerprint.IUdfpsOverlayController; @@ -244,6 +245,13 @@ class UdfpsController implements DozeReceiver { mView.dozeTimeTick(); } + /** + * @return where the UDFPS exists on the screen in pixels. + */ + public RectF getSensorLocation() { + return mView.getSensorRect(); + } + private void setShowOverlay(boolean show) { if (show == mIsOverlayRequested) { return; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java index 0ed3bda40c4bc..7edcf66196e45 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java @@ -196,6 +196,10 @@ public class UdfpsView extends View implements DozeReceiver, canvas.restore(); } + RectF getSensorRect() { + return new RectF(mSensorRect); + } + void setHbmSupported(boolean hbmSupported) { mHbmSupported = hbmSupported; } diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java index 8220835ac5090..f07e5afdd8876 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java @@ -156,7 +156,7 @@ public class DozeSensors { findSensorWithType(config.udfpsLongPressSensorType()), "doze_pulse_on_auth", true /* settingDef */, - authController.hasUdfpsEnrolled() /* configured */, + authController.isUdfpsEnrolled() /* configured */, DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS, true /* reports touch coordinates */, true /* touchscreen */, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java index ef4108b9762da..bd228933c8a59 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java @@ -86,9 +86,14 @@ public class KeyguardClockPositionAlgorithm { private int mMaxShadeBottom; /** - * Minimum distance from the status bar. + * Recommended distance from the status bar without the lock icon. */ - private int mContainerTopPadding; + private int mContainerTopPaddingWithoutLockIcon; + + /** + * Recommended distance from the status bar with the lock icon. + */ + private int mContainerTopPaddingWithLockIcon; /** * @see NotificationPanelViewController#getExpandedFraction() @@ -131,24 +136,31 @@ public class KeyguardClockPositionAlgorithm { public void loadDimens(Resources res) { mClockNotificationsMargin = res.getDimensionPixelSize( R.dimen.keyguard_clock_notifications_margin); + + mContainerTopPaddingWithoutLockIcon = + res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) / 2; // Consider the lock icon when determining the minimum top padding between the status bar // and top of the clock. - mContainerTopPadding = Math.max(res.getDimensionPixelSize( - R.dimen.keyguard_clock_top_margin), - res.getDimensionPixelSize(R.dimen.keyguard_lock_height) - + res.getDimensionPixelSize(R.dimen.keyguard_lock_padding) - + res.getDimensionPixelSize(R.dimen.keyguard_clock_lock_margin)); + mContainerTopPaddingWithLockIcon = + Math.max(res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin), + res.getDimensionPixelSize(R.dimen.keyguard_lock_height) + + res.getDimensionPixelSize(R.dimen.keyguard_lock_padding) + + res.getDimensionPixelSize(R.dimen.keyguard_clock_lock_margin)); mBurnInPreventionOffsetX = res.getDimensionPixelSize( R.dimen.burn_in_prevention_offset_x); mBurnInPreventionOffsetY = res.getDimensionPixelSize( R.dimen.burn_in_prevention_offset_y); } - public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight, + /** + * Sets up algorithm values. + */ + public void setup(int statusBarMinHeight, int maxShadeBottom, int notificationStackHeight, float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY, boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount, - boolean bypassEnabled, int unlockedStackScrollerPadding) { - mMinTopMargin = minTopMargin + mContainerTopPadding; + boolean bypassEnabled, int unlockedStackScrollerPadding, boolean udfpsEnrolled) { + mMinTopMargin = statusBarMinHeight + (udfpsEnrolled ? mContainerTopPaddingWithoutLockIcon : + mContainerTopPaddingWithLockIcon); mMaxShadeBottom = maxShadeBottom; mNotificationStackHeight = notificationStackHeight; mPanelExpansion = panelExpansion; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java index 77ae059a0cb98..5e883bee13a82 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.phone; +import static android.view.View.GONE; + import static com.android.systemui.statusbar.phone.LockIcon.STATE_BIOMETRICS_ERROR; import static com.android.systemui.statusbar.phone.LockIcon.STATE_LOCKED; import static com.android.systemui.statusbar.phone.LockIcon.STATE_LOCK_OPEN; @@ -37,6 +39,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.systemui.R; +import com.android.systemui.biometrics.AuthController; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dock.DockManager; @@ -74,6 +77,7 @@ public class LockscreenLockIconController { private final KeyguardStateController mKeyguardStateController; private final Resources mResources; private final HeadsUpManagerPhone mHeadsUpManagerPhone; + private final AuthController mAuthController; private boolean mKeyguardShowing; private boolean mKeyguardJustShown; private boolean mBlockUpdates; @@ -322,7 +326,8 @@ public class LockscreenLockIconController { @Nullable DockManager dockManager, KeyguardStateController keyguardStateController, @Main Resources resources, - HeadsUpManagerPhone headsUpManagerPhone) { + HeadsUpManagerPhone headsUpManagerPhone, + AuthController authController) { mLockscreenGestureLogger = lockscreenGestureLogger; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLockPatternUtils = lockPatternUtils; @@ -337,6 +342,7 @@ public class LockscreenLockIconController { mKeyguardStateController = keyguardStateController; mResources = resources; mHeadsUpManagerPhone = headsUpManagerPhone; + mAuthController = authController; mKeyguardIndicationController.setLockIconController(this); } @@ -502,6 +508,11 @@ public class LockscreenLockIconController { * @return true if the visibility changed */ private boolean updateIconVisibility() { + if (mAuthController.isUdfpsEnrolled()) { + boolean changed = mLockIcon.getVisibility() == GONE; + mLockIcon.setVisibility(GONE); + return changed; + } boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked; boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance; boolean fingerprintOrBypass = mFingerprintUnlock diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index b185f48b02458..e9a7132f4a5cc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -77,6 +77,7 @@ import com.android.keyguard.dagger.KeyguardStatusViewComponent; import com.android.systemui.DejankUtils; import com.android.systemui.Interpolators; import com.android.systemui.R; +import com.android.systemui.biometrics.AuthController; import com.android.systemui.classifier.Classifier; import com.android.systemui.dagger.qualifiers.DisplayId; import com.android.systemui.dagger.qualifiers.Main; @@ -263,6 +264,7 @@ public class NotificationPanelViewController extends PanelViewController { private final KeyguardBypassController mKeyguardBypassController; private final KeyguardUpdateMonitor mUpdateMonitor; private final ConversationNotificationManager mConversationNotificationManager; + private final AuthController mAuthController; private final MediaHierarchyManager mMediaHierarchyManager; private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory; @@ -516,7 +518,8 @@ public class NotificationPanelViewController extends PanelViewController { NotificationStackScrollLayoutController notificationStackScrollLayoutController, KeyguardStatusViewComponent.Factory keyguardStatusViewComponentFactory, NotificationGroupManagerLegacy groupManager, - NotificationIconAreaController notificationIconAreaController) { + NotificationIconAreaController notificationIconAreaController, + AuthController authController) { super(view, falsingManager, dozeLog, keyguardStateController, (SysuiStatusBarStateController) statusBarStateController, vibratorHelper, latencyTracker, flingAnimationUtilsBuilder, statusBarTouchableRegionManager); @@ -581,6 +584,7 @@ public class NotificationPanelViewController extends PanelViewController { mLockscreenUserManager = notificationLockscreenUserManager; mEntryManager = notificationEntryManager; mConversationNotificationManager = conversationNotificationManager; + mAuthController = authController; mView.setBackgroundColor(Color.TRANSPARENT); OnAttachStateChangeListener onAttachStateChangeListener = new OnAttachStateChangeListener(); @@ -868,7 +872,8 @@ public class NotificationPanelViewController extends PanelViewController { - mShelfHeight / 2.0f - mDarkIconSize / 2.0f), clockPreferredY, hasCustomClock(), hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, - bypassEnabled, getUnlockedStackScrollerPadding()); + bypassEnabled, getUnlockedStackScrollerPadding(), + mAuthController.isUdfpsEnrolled()); mClockPositionAlgorithm.run(mClockPositionResult); mKeyguardStatusViewController.updatePosition( mClockPositionResult.clockX, mClockPositionResult.clockY, animateClock); @@ -908,6 +913,13 @@ public class NotificationPanelViewController extends PanelViewController { mNotificationStackScrollLayoutController.getHeight() - minPadding - shelfSize - Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding) - mKeyguardStatusViewController.getLogoutButtonHeight(); + + if (mAuthController.isUdfpsEnrolled()) { + availableSpace = mNotificationStackScrollLayoutController.getHeight() + - minPadding - shelfSize + - (mStatusBar.getDisplayHeight() - mAuthController.getUdfpsRegion().top); + } + int count = 0; ExpandableView previousView = null; for (int i = 0; i < mNotificationStackScrollLayoutController.getChildCount(); i++) { diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java index e73ed801b7df7..7c70f36eaaafb 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java @@ -79,6 +79,7 @@ import com.android.internal.widget.ILockSettings; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor.BiometricAuthenticated; import com.android.systemui.SysuiTestCase; +import com.android.systemui.biometrics.AuthController; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; @@ -156,6 +157,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { private LiveData mRingerModeLiveData; @Mock private StatusBarStateController mStatusBarStateController; + @Mock + private AuthController mAuthController; // Direct executor private Executor mBackgroundExecutor = Runnable::run; private TestableLooper mTestableLooper; @@ -198,6 +201,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { when(mTelephonyManager.getServiceStateForSubscriber(anyInt())) .thenReturn(new ServiceState()); when(mLockPatternUtils.getLockSettings()).thenReturn(mLockSettings); + when(mAuthController.isUdfpsEnrolled()).thenReturn(false); mSpiedContext.addMockSystemService(TrustManager.class, mTrustManager); mSpiedContext.addMockSystemService(FingerprintManager.class, mFingerprintManager); mSpiedContext.addMockSystemService(BiometricManager.class, mBiometricManager); @@ -796,7 +800,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { TestableLooper.get(KeyguardUpdateMonitorTest.this).getLooper(), mBroadcastDispatcher, mDumpManager, mRingerModeTracker, mBackgroundExecutor, - mStatusBarStateController, mLockPatternUtils); + mStatusBarStateController, mLockPatternUtils, + mAuthController); setStrongAuthTracker(KeyguardUpdateMonitorTest.this.mStrongAuthTracker); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java index 2042faba2b3a1..83ef87a1066c8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java @@ -384,7 +384,7 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT, mNotificationStackHeight, mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight, mPreferredClockY, mHasCustomClock, mHasVisibleNotifs, mDark, ZERO_DRAG, false /* bypassEnabled */, - 0 /* unlockedStackScrollerPadding */); + 0 /* unlockedStackScrollerPadding */, false /* udfpsEnrolled */); mClockPositionAlgorithm.run(mClockPosition); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java index 06d0331543da9..72a0258e148a5 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java @@ -32,6 +32,7 @@ import androidx.test.runner.AndroidJUnit4; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.SysuiTestCase; +import com.android.systemui.biometrics.AuthController; import com.android.systemui.dock.DockManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.KeyguardIndicationController; @@ -80,6 +81,8 @@ public class LockscreenIconControllerTest extends SysuiTestCase { private Resources mResources; @Mock private HeadsUpManagerPhone mHeadsUpManagerPhone; + @Mock + private AuthController mAuthController; private LockscreenLockIconController mLockIconController; private OnAttachStateChangeListener mOnAttachStateChangeListener; @@ -89,13 +92,14 @@ public class LockscreenIconControllerTest extends SysuiTestCase { public void setUp() { MockitoAnnotations.initMocks(this); + when(mAuthController.isUdfpsEnrolled()).thenReturn(false); when(mLockIcon.getContext()).thenReturn(mContext); mLockIconController = new LockscreenLockIconController( mLockscreenGestureLogger, mKeyguardUpdateMonitor, mLockPatternUtils, mShadeController, mAccessibilityController, mKeyguardIndicationController, mStatusBarStateController, mConfigurationController, mNotificationWakeUpCoordinator, mKeyguardBypassController, mDockManager, mKeyguardStateController, mResources, - mHeadsUpManagerPhone); + mHeadsUpManagerPhone, mAuthController); ArgumentCaptor onAttachStateChangeListenerArgumentCaptor = ArgumentCaptor.forClass(OnAttachStateChangeListener.class); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java index cb56f1fbc0540..3b123f65d886a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java @@ -58,6 +58,7 @@ import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.dagger.KeyguardStatusViewComponent; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; +import com.android.systemui.biometrics.AuthController; import com.android.systemui.classifier.FalsingManagerFake; import com.android.systemui.doze.DozeLog; import com.android.systemui.media.MediaHierarchyManager; @@ -194,6 +195,8 @@ public class NotificationPanelViewTest extends SysuiTestCase { private KeyguardStatusViewController mKeyguardStatusViewController; @Mock private NotificationStackScrollLayoutController mNotificationStackScrollLayoutController; + @Mock + private AuthController mAuthController; private NotificationPanelViewController mNotificationPanelViewController; private View.AccessibilityDelegate mAccessibiltyDelegate; @@ -201,6 +204,7 @@ public class NotificationPanelViewTest extends SysuiTestCase { @Before public void setup() { MockitoAnnotations.initMocks(this); + when(mAuthController.isUdfpsEnrolled()).thenReturn(false); when(mHeadsUpCallback.getContext()).thenReturn(mContext); when(mView.getResources()).thenReturn(mResources); when(mResources.getConfiguration()).thenReturn(mConfiguration); @@ -267,7 +271,8 @@ public class NotificationPanelViewTest extends SysuiTestCase { mNotificationStackScrollLayoutController, mKeyguardStatusViewComponentFactory, mGroupManager, - mNotificationAreaController); + mNotificationAreaController, + mAuthController); mNotificationPanelViewController.initDependencies( mStatusBar, mNotificationShelfController);