Loading packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +4 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,10 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { mCurrentScrimController = mScrimManager.getCurrentController(); session.registerCallback(() -> { if (mVelocityTracker != null) { mVelocityTracker.recycle(); mVelocityTracker = null; } mScrimManager.removeCallback(mScrimManagerCallback); mCapture = null; mNotificationShadeWindowController.setForcePluginOpen(false, this); Loading packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -450,6 +450,15 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { swipeToPosition(0f, Direction.DOWN, 0); } @Test public void testTouchSessionOnRemovedCalledTwice() { mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<DreamTouchHandler.TouchSession.Callback> onRemovedCallbackCaptor = ArgumentCaptor.forClass(DreamTouchHandler.TouchSession.Callback.class); verify(mTouchSession).registerCallback(onRemovedCallbackCaptor.capture()); onRemovedCallbackCaptor.getValue().onRemoved(); onRemovedCallbackCaptor.getValue().onRemoved(); } private void swipeToPosition(float percent, Direction direction, float velocityY) { Mockito.clearInvocations(mTouchSession); Loading Loading
packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +4 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,10 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { mCurrentScrimController = mScrimManager.getCurrentController(); session.registerCallback(() -> { if (mVelocityTracker != null) { mVelocityTracker.recycle(); mVelocityTracker = null; } mScrimManager.removeCallback(mScrimManagerCallback); mCapture = null; mNotificationShadeWindowController.setForcePluginOpen(false, this); Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -450,6 +450,15 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { swipeToPosition(0f, Direction.DOWN, 0); } @Test public void testTouchSessionOnRemovedCalledTwice() { mTouchHandler.onSessionStart(mTouchSession); ArgumentCaptor<DreamTouchHandler.TouchSession.Callback> onRemovedCallbackCaptor = ArgumentCaptor.forClass(DreamTouchHandler.TouchSession.Callback.class); verify(mTouchSession).registerCallback(onRemovedCallbackCaptor.capture()); onRemovedCallbackCaptor.getValue().onRemoved(); onRemovedCallbackCaptor.getValue().onRemoved(); } private void swipeToPosition(float percent, Direction direction, float velocityY) { Mockito.clearInvocations(mTouchSession); Loading