Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +9 −0 Original line number Diff line number Diff line Loading @@ -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 */); Loading Loading @@ -2218,10 +2219,18 @@ 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; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; } Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -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 */, Loading Loading @@ -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 Loading Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +9 −0 Original line number Diff line number Diff line Loading @@ -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 */); Loading Loading @@ -2218,10 +2219,18 @@ 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; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; } Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -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 */, Loading Loading @@ -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 Loading