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