Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +14 −0 Original line number Diff line number Diff line Loading @@ -334,6 +334,20 @@ public class KeyguardBouncer { return mKeyguardView != null && mKeyguardView.hasDismissActions(); } public int getTop() { if (mKeyguardView == null) { return 0; } int top = mKeyguardView.getTop(); // The password view has an extra top padding that should be ignored. if (mKeyguardView.getCurrentSecurityMode() == SecurityMode.Password) { View messageArea = mKeyguardView.findViewById(R.id.keyguard_message_area); top += messageArea.getTop(); } return top; } protected void ensureView() { // Removal of the view might be deferred to reduce unlock latency, // in this case we need to force the removal, otherwise we'll Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +11 −3 Original line number Diff line number Diff line Loading @@ -113,6 +113,11 @@ public class KeyguardClockPositionAlgorithm { */ private boolean mTracking; /** * Distance in pixels between the top of the screen and the first view of the bouncer. */ private int mBouncerTop; /** * Refreshes the dimension values. */ Loading @@ -129,7 +134,7 @@ public class KeyguardClockPositionAlgorithm { public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight, float expandedHeight, float maxPanelHeight, int parentHeight, int keyguardStatusHeight, float dark, boolean secure, boolean tracking) { float dark, boolean secure, boolean tracking, int bouncerTop) { mMinTopMargin = minTopMargin + mContainerTopPadding; mMaxShadeBottom = maxShadeBottom; mNotificationStackHeight = notificationStackHeight; Loading @@ -140,6 +145,7 @@ public class KeyguardClockPositionAlgorithm { mDarkAmount = dark; mCurrentlySecure = secure; mTracking = tracking; mBouncerTop = bouncerTop; } public void run(Result result) { Loading Loading @@ -189,8 +195,10 @@ public class KeyguardClockPositionAlgorithm { private int getClockY() { // Dark: Align the bottom edge of the clock at about half of the screen: final float clockYDark = getMaxClockY() + burnInPreventionOffsetY(); float clockYRegular = getExpandedClockPosition(); float clockYTarget = mCurrentlySecure ? mMinTopMargin : -mKeyguardStatusHeight; final float clockYRegular = getExpandedClockPosition(); final boolean hasEnoughSpace = mMinTopMargin + mKeyguardStatusHeight < mBouncerTop; float clockYTarget = mCurrentlySecure && hasEnoughSpace ? mMinTopMargin : -mKeyguardStatusHeight; // Move clock up while collapsing the shade float shadeExpansion = mExpandedHeight / mMaxPanelHeight; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +8 −1 Original line number Diff line number Diff line Loading @@ -160,6 +160,7 @@ public class NotificationPanelView extends PanelView implements protected int mQsMinExpansionHeight; protected int mQsMaxExpansionHeight; private int mQsPeekHeight; private int mBouncerTop; private boolean mStackScrollerOverscrolling; private boolean mQsExpansionFromOverscroll; private float mLastOverscroll; Loading Loading @@ -476,7 +477,8 @@ public class NotificationPanelView extends PanelView implements mKeyguardStatusView.getHeight(), mDarkAmount, mStatusBar.isKeyguardCurrentlySecure(), mTracking); mTracking, mBouncerTop); mClockPositionAlgorithm.run(mClockPositionResult); if (animate || mClockAnimator != null) { startClockAnimation(mClockPositionResult.clockX, mClockPositionResult.clockY); Loading Loading @@ -550,6 +552,11 @@ public class NotificationPanelView extends PanelView implements return count; } public void setBouncerTop(int bouncerTop) { mBouncerTop = bouncerTop; positionClockAndNotifications(); } private void startClockAnimation(int x, int y) { if (mClockAnimationTargetX == x && mClockAnimationTargetY == y) { return; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -135,10 +135,16 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mFingerprintUnlockController = fingerprintUnlockController; mBouncer = SystemUIFactory.getInstance().createKeyguardBouncer(mContext, mViewMediatorCallback, mLockPatternUtils, container, dismissCallbackRegistry); mContainer.addOnLayoutChangeListener(this::onContainerLayout); mNotificationPanelView = notificationPanelView; notificationPanelView.setExpansionListener(this::onPanelExpansionChanged); } private void onContainerLayout(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { mNotificationPanelView.setBouncerTop(mBouncer.getTop()); } private void onPanelExpansionChanged(float expansion, boolean tracking) { // We don't want to translate the bounce when: // • Keyguard is occluded, because we're in a FLAG_SHOW_WHEN_LOCKED activity and need to Loading @@ -156,7 +162,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (expansion == 1) { mBouncer.onFullyHidden(); } else if (!mBouncer.isShowing() && !mBouncer.isAnimatingAway()) { mBouncer.show(false /* resetSecuritySelection */, false /* notifyFalsing */); mBouncer.show(false /* resetSecuritySelection */, false /* animated */); } else if (noLongerTracking) { // Notify that falsing manager should stop its session when user stops touching, // even before the animation ends, to guarantee that we're not recording sensitive Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +14 −0 Original line number Diff line number Diff line Loading @@ -334,6 +334,20 @@ public class KeyguardBouncer { return mKeyguardView != null && mKeyguardView.hasDismissActions(); } public int getTop() { if (mKeyguardView == null) { return 0; } int top = mKeyguardView.getTop(); // The password view has an extra top padding that should be ignored. if (mKeyguardView.getCurrentSecurityMode() == SecurityMode.Password) { View messageArea = mKeyguardView.findViewById(R.id.keyguard_message_area); top += messageArea.getTop(); } return top; } protected void ensureView() { // Removal of the view might be deferred to reduce unlock latency, // in this case we need to force the removal, otherwise we'll Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +11 −3 Original line number Diff line number Diff line Loading @@ -113,6 +113,11 @@ public class KeyguardClockPositionAlgorithm { */ private boolean mTracking; /** * Distance in pixels between the top of the screen and the first view of the bouncer. */ private int mBouncerTop; /** * Refreshes the dimension values. */ Loading @@ -129,7 +134,7 @@ public class KeyguardClockPositionAlgorithm { public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight, float expandedHeight, float maxPanelHeight, int parentHeight, int keyguardStatusHeight, float dark, boolean secure, boolean tracking) { float dark, boolean secure, boolean tracking, int bouncerTop) { mMinTopMargin = minTopMargin + mContainerTopPadding; mMaxShadeBottom = maxShadeBottom; mNotificationStackHeight = notificationStackHeight; Loading @@ -140,6 +145,7 @@ public class KeyguardClockPositionAlgorithm { mDarkAmount = dark; mCurrentlySecure = secure; mTracking = tracking; mBouncerTop = bouncerTop; } public void run(Result result) { Loading Loading @@ -189,8 +195,10 @@ public class KeyguardClockPositionAlgorithm { private int getClockY() { // Dark: Align the bottom edge of the clock at about half of the screen: final float clockYDark = getMaxClockY() + burnInPreventionOffsetY(); float clockYRegular = getExpandedClockPosition(); float clockYTarget = mCurrentlySecure ? mMinTopMargin : -mKeyguardStatusHeight; final float clockYRegular = getExpandedClockPosition(); final boolean hasEnoughSpace = mMinTopMargin + mKeyguardStatusHeight < mBouncerTop; float clockYTarget = mCurrentlySecure && hasEnoughSpace ? mMinTopMargin : -mKeyguardStatusHeight; // Move clock up while collapsing the shade float shadeExpansion = mExpandedHeight / mMaxPanelHeight; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +8 −1 Original line number Diff line number Diff line Loading @@ -160,6 +160,7 @@ public class NotificationPanelView extends PanelView implements protected int mQsMinExpansionHeight; protected int mQsMaxExpansionHeight; private int mQsPeekHeight; private int mBouncerTop; private boolean mStackScrollerOverscrolling; private boolean mQsExpansionFromOverscroll; private float mLastOverscroll; Loading Loading @@ -476,7 +477,8 @@ public class NotificationPanelView extends PanelView implements mKeyguardStatusView.getHeight(), mDarkAmount, mStatusBar.isKeyguardCurrentlySecure(), mTracking); mTracking, mBouncerTop); mClockPositionAlgorithm.run(mClockPositionResult); if (animate || mClockAnimator != null) { startClockAnimation(mClockPositionResult.clockX, mClockPositionResult.clockY); Loading Loading @@ -550,6 +552,11 @@ public class NotificationPanelView extends PanelView implements return count; } public void setBouncerTop(int bouncerTop) { mBouncerTop = bouncerTop; positionClockAndNotifications(); } private void startClockAnimation(int x, int y) { if (mClockAnimationTargetX == x && mClockAnimationTargetY == y) { return; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -135,10 +135,16 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mFingerprintUnlockController = fingerprintUnlockController; mBouncer = SystemUIFactory.getInstance().createKeyguardBouncer(mContext, mViewMediatorCallback, mLockPatternUtils, container, dismissCallbackRegistry); mContainer.addOnLayoutChangeListener(this::onContainerLayout); mNotificationPanelView = notificationPanelView; notificationPanelView.setExpansionListener(this::onPanelExpansionChanged); } private void onContainerLayout(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { mNotificationPanelView.setBouncerTop(mBouncer.getTop()); } private void onPanelExpansionChanged(float expansion, boolean tracking) { // We don't want to translate the bounce when: // • Keyguard is occluded, because we're in a FLAG_SHOW_WHEN_LOCKED activity and need to Loading @@ -156,7 +162,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (expansion == 1) { mBouncer.onFullyHidden(); } else if (!mBouncer.isShowing() && !mBouncer.isAnimatingAway()) { mBouncer.show(false /* resetSecuritySelection */, false /* notifyFalsing */); mBouncer.show(false /* resetSecuritySelection */, false /* animated */); } else if (noLongerTracking) { // Notify that falsing manager should stop its session when user stops touching, // even before the animation ends, to guarantee that we're not recording sensitive Loading