Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -1900,6 +1900,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId); mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId); } } /** * Whether to show the lock icon on lock screen and bouncer. This depends on the enrolled * biometrics to the device. */ public boolean shouldShowLockIcon() { return isFaceAuthEnabledForUser(KeyguardUpdateMonitor.getCurrentUser()) && !isUdfpsEnrolled(); } /** /** * @return true if there's at least one udfps enrolled * @return true if there's at least one udfps enrolled */ */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -164,10 +164,10 @@ public class KeyguardClockPositionAlgorithm { public void setup(int statusBarMinHeight, int maxShadeBottom, int notificationStackHeight, public void setup(int statusBarMinHeight, int maxShadeBottom, int notificationStackHeight, float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY, float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY, boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount, boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount, boolean bypassEnabled, int unlockedStackScrollerPadding, boolean udfpsEnrolled, boolean bypassEnabled, int unlockedStackScrollerPadding, boolean showLockIcon, float qsExpansion) { float qsExpansion) { mMinTopMargin = statusBarMinHeight + (udfpsEnrolled ? mContainerTopPaddingWithoutLockIcon : mMinTopMargin = statusBarMinHeight + (showLockIcon mContainerTopPaddingWithLockIcon); ? mContainerTopPaddingWithLockIcon : mContainerTopPaddingWithoutLockIcon); mMaxShadeBottom = maxShadeBottom; mMaxShadeBottom = maxShadeBottom; mNotificationStackHeight = notificationStackHeight; mNotificationStackHeight = notificationStackHeight; mPanelExpansion = panelExpansion; mPanelExpansion = panelExpansion; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java +4 −6 Original line number Original line Diff line number Diff line Loading @@ -501,7 +501,7 @@ public class LockscreenLockIconController { if (mBlockUpdates && canBlockUpdates()) { if (mBlockUpdates && canBlockUpdates()) { shouldUpdate = false; shouldUpdate = false; } } if (shouldUpdate && mLockIcon != null) { if (shouldUpdate && mLockIcon != null && mLockIcon.getVisibility() != GONE) { mLockIcon.update(state, mLockIcon.update(state, mStatusBarStateController.isDozing(), mKeyguardJustShown); mStatusBarStateController.isDozing(), mKeyguardJustShown); } } Loading Loading @@ -549,16 +549,14 @@ public class LockscreenLockIconController { return false; return false; } } if (mKeyguardUpdateMonitor.isUdfpsEnrolled()) { if (!mKeyguardUpdateMonitor.shouldShowLockIcon()) { boolean changed = mLockIcon.getVisibility() == GONE; boolean changed = mLockIcon.getVisibility() != GONE; mLockIcon.setVisibility(GONE); mLockIcon.setVisibility(GONE); return changed; return changed; } } boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked; boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked; boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance; || (mKeyguardSecurityModel.getSecurityMode(KeyguardUpdateMonitor.getCurrentUser()) == KeyguardSecurityModel.SecurityMode.None); boolean fingerprintOrBypass = mFingerprintUnlock boolean fingerprintOrBypass = mFingerprintUnlock || mKeyguardBypassController.getBypassEnabled(); || mKeyguardBypassController.getBypassEnabled(); if (fingerprintOrBypass && !mBouncerShowingScrimmed) { if (fingerprintOrBypass && !mBouncerShowingScrimmed) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -912,7 +912,8 @@ public class NotificationPanelViewController extends PanelViewController { clockPreferredY, hasCustomClock(), clockPreferredY, hasCustomClock(), hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, bypassEnabled, getUnlockedStackScrollerPadding(), bypassEnabled, getUnlockedStackScrollerPadding(), mUpdateMonitor.isUdfpsEnrolled(), getQsExpansionFraction()); mUpdateMonitor.shouldShowLockIcon(), getQsExpansionFraction()); mClockPositionAlgorithm.run(mClockPositionResult); mClockPositionAlgorithm.run(mClockPositionResult); mKeyguardStatusViewController.updatePosition( mKeyguardStatusViewController.updatePosition( mClockPositionResult.clockX, mClockPositionResult.clockY, mClockPositionResult.clockX, mClockPositionResult.clockY, Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java +4 −5 Original line number Original line Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class LockscreenIconControllerTest extends SysuiTestCase { public void setUp() { public void setUp() { MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); when(mKeyguardUpdateMonitor.shouldShowLockIcon()).thenReturn(true); when(mLockIcon.getContext()).thenReturn(mContext); when(mLockIcon.getContext()).thenReturn(mContext); mLockIconController = new LockscreenLockIconController( mLockIconController = new LockscreenLockIconController( mLockscreenGestureLogger, mKeyguardUpdateMonitor, mLockPatternUtils, mLockscreenGestureLogger, mKeyguardUpdateMonitor, mLockPatternUtils, Loading Loading @@ -145,12 +146,10 @@ public class LockscreenIconControllerTest extends SysuiTestCase { } } @Test @Test public void testVisibility_noBouncer() { public void testVisibility_doNotShowLockIcon() { // no security (ie: no lock screen OR swipe to unlock) when(mKeyguardUpdateMonitor.shouldShowLockIcon()).thenReturn(false); when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn( KeyguardSecurityModel.SecurityMode.None); mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon); mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon); verify(mLockIcon).updateIconVisibility(false); verify(mLockIcon).setVisibility(View.GONE); } } } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -1900,6 +1900,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId); mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId); } } /** * Whether to show the lock icon on lock screen and bouncer. This depends on the enrolled * biometrics to the device. */ public boolean shouldShowLockIcon() { return isFaceAuthEnabledForUser(KeyguardUpdateMonitor.getCurrentUser()) && !isUdfpsEnrolled(); } /** /** * @return true if there's at least one udfps enrolled * @return true if there's at least one udfps enrolled */ */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -164,10 +164,10 @@ public class KeyguardClockPositionAlgorithm { public void setup(int statusBarMinHeight, int maxShadeBottom, int notificationStackHeight, public void setup(int statusBarMinHeight, int maxShadeBottom, int notificationStackHeight, float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY, float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY, boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount, boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount, boolean bypassEnabled, int unlockedStackScrollerPadding, boolean udfpsEnrolled, boolean bypassEnabled, int unlockedStackScrollerPadding, boolean showLockIcon, float qsExpansion) { float qsExpansion) { mMinTopMargin = statusBarMinHeight + (udfpsEnrolled ? mContainerTopPaddingWithoutLockIcon : mMinTopMargin = statusBarMinHeight + (showLockIcon mContainerTopPaddingWithLockIcon); ? mContainerTopPaddingWithLockIcon : mContainerTopPaddingWithoutLockIcon); mMaxShadeBottom = maxShadeBottom; mMaxShadeBottom = maxShadeBottom; mNotificationStackHeight = notificationStackHeight; mNotificationStackHeight = notificationStackHeight; mPanelExpansion = panelExpansion; mPanelExpansion = panelExpansion; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java +4 −6 Original line number Original line Diff line number Diff line Loading @@ -501,7 +501,7 @@ public class LockscreenLockIconController { if (mBlockUpdates && canBlockUpdates()) { if (mBlockUpdates && canBlockUpdates()) { shouldUpdate = false; shouldUpdate = false; } } if (shouldUpdate && mLockIcon != null) { if (shouldUpdate && mLockIcon != null && mLockIcon.getVisibility() != GONE) { mLockIcon.update(state, mLockIcon.update(state, mStatusBarStateController.isDozing(), mKeyguardJustShown); mStatusBarStateController.isDozing(), mKeyguardJustShown); } } Loading Loading @@ -549,16 +549,14 @@ public class LockscreenLockIconController { return false; return false; } } if (mKeyguardUpdateMonitor.isUdfpsEnrolled()) { if (!mKeyguardUpdateMonitor.shouldShowLockIcon()) { boolean changed = mLockIcon.getVisibility() == GONE; boolean changed = mLockIcon.getVisibility() != GONE; mLockIcon.setVisibility(GONE); mLockIcon.setVisibility(GONE); return changed; return changed; } } boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked; boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked; boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance; || (mKeyguardSecurityModel.getSecurityMode(KeyguardUpdateMonitor.getCurrentUser()) == KeyguardSecurityModel.SecurityMode.None); boolean fingerprintOrBypass = mFingerprintUnlock boolean fingerprintOrBypass = mFingerprintUnlock || mKeyguardBypassController.getBypassEnabled(); || mKeyguardBypassController.getBypassEnabled(); if (fingerprintOrBypass && !mBouncerShowingScrimmed) { if (fingerprintOrBypass && !mBouncerShowingScrimmed) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -912,7 +912,8 @@ public class NotificationPanelViewController extends PanelViewController { clockPreferredY, hasCustomClock(), clockPreferredY, hasCustomClock(), hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, bypassEnabled, getUnlockedStackScrollerPadding(), bypassEnabled, getUnlockedStackScrollerPadding(), mUpdateMonitor.isUdfpsEnrolled(), getQsExpansionFraction()); mUpdateMonitor.shouldShowLockIcon(), getQsExpansionFraction()); mClockPositionAlgorithm.run(mClockPositionResult); mClockPositionAlgorithm.run(mClockPositionResult); mKeyguardStatusViewController.updatePosition( mKeyguardStatusViewController.updatePosition( mClockPositionResult.clockX, mClockPositionResult.clockY, mClockPositionResult.clockX, mClockPositionResult.clockY, Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java +4 −5 Original line number Original line Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class LockscreenIconControllerTest extends SysuiTestCase { public void setUp() { public void setUp() { MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); when(mKeyguardUpdateMonitor.shouldShowLockIcon()).thenReturn(true); when(mLockIcon.getContext()).thenReturn(mContext); when(mLockIcon.getContext()).thenReturn(mContext); mLockIconController = new LockscreenLockIconController( mLockIconController = new LockscreenLockIconController( mLockscreenGestureLogger, mKeyguardUpdateMonitor, mLockPatternUtils, mLockscreenGestureLogger, mKeyguardUpdateMonitor, mLockPatternUtils, Loading Loading @@ -145,12 +146,10 @@ public class LockscreenIconControllerTest extends SysuiTestCase { } } @Test @Test public void testVisibility_noBouncer() { public void testVisibility_doNotShowLockIcon() { // no security (ie: no lock screen OR swipe to unlock) when(mKeyguardUpdateMonitor.shouldShowLockIcon()).thenReturn(false); when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn( KeyguardSecurityModel.SecurityMode.None); mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon); mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon); verify(mLockIcon).updateIconVisibility(false); verify(mLockIcon).setVisibility(View.GONE); } } } }