diff options
| author | 2024-05-08 17:39:27 +0000 | |
|---|---|---|
| committer | 2024-05-08 17:39:27 +0000 | |
| commit | a6b7f4479f4c6443e8e568b941db011f01a66eb2 (patch) | |
| tree | 3046ed6596e457cac675e34d5657f5a9620b594e | |
| parent | f054d1d24d19a6f62a9078eef4ceda5eb789e668 (diff) | |
| parent | e1f23b1ed6aad8fb06f05f8a2e99647303199793 (diff) | |
Merge "Avoid keyguard fling transition interrupt for timing issue" into main
3 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 9f1b42322151..7051d5fda159 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -620,6 +620,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump private int mDreamingToLockscreenTransitionTranslationY; private int mLockscreenToDreamingTransitionTranslationY; private int mGoneToDreamingTransitionTranslationY; + private boolean mForceFlingAnimationForTest = false; private final SplitShadeStateController mSplitShadeStateController; private final Runnable mFlingCollapseRunnable = () -> fling(0, false /* expand */, mNextCollapseSpeedUpFactor, false /* expandBecauseOfFalsing */); @@ -2218,11 +2219,19 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } } }); + if (!mScrimController.isScreenOn() && !mForceFlingAnimationForTest) { + animator.setDuration(1); + } setAnimator(animator); animator.start(); } @VisibleForTesting + void setForceFlingAnimationForTest(boolean force) { + mForceFlingAnimationForTest = force; + } + + @VisibleForTesting void onFlingEnd(boolean cancelled) { mIsFlinging = false; // No overshoot when the animation ends diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 0a88d6358d8e..74182fc4d2c1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -1644,6 +1644,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump mScreenOn = false; } + public boolean isScreenOn() { + return mScreenOn; + } + public void setExpansionAffectsAlpha(boolean expansionAffectsAlpha) { mExpansionAffectsAlpha = expansionAffectsAlpha; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java index 6b57f6e06bda..e1cdda440976 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -428,6 +428,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo public void testOnTouchEvent_expansionResumesAfterBriefTouch() { mFalsingManager.setIsClassifierEnabled(true); mFalsingManager.setIsFalseTouch(false); + mNotificationPanelViewController.setForceFlingAnimationForTest(true); // Start shade collapse with swipe up onTouchEvent(MotionEvent.obtain(0L /* downTime */, 0L /* eventTime */, MotionEvent.ACTION_DOWN, 0f /* x */, 0f /* y */, @@ -456,6 +457,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo // fling should still be called after a touch that does not exceed touch slop assertThat(mNotificationPanelViewController.isClosing()).isTrue(); assertThat(mNotificationPanelViewController.isFlinging()).isTrue(); + mNotificationPanelViewController.setForceFlingAnimationForTest(false); } @Test |