Merge "Attempted fix for IllegalStateException" into tm-qpr-dev am: c143f762de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21656516 Change-Id: I1638749759427dfb8c7934971dc452995520ad79 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -254,7 +254,10 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler {
|
|||||||
mCurrentScrimController = mScrimManager.getCurrentController();
|
mCurrentScrimController = mScrimManager.getCurrentController();
|
||||||
|
|
||||||
session.registerCallback(() -> {
|
session.registerCallback(() -> {
|
||||||
mVelocityTracker.recycle();
|
if (mVelocityTracker != null) {
|
||||||
|
mVelocityTracker.recycle();
|
||||||
|
mVelocityTracker = null;
|
||||||
|
}
|
||||||
mScrimManager.removeCallback(mScrimManagerCallback);
|
mScrimManager.removeCallback(mScrimManagerCallback);
|
||||||
mCapture = null;
|
mCapture = null;
|
||||||
mNotificationShadeWindowController.setForcePluginOpen(false, this);
|
mNotificationShadeWindowController.setForcePluginOpen(false, this);
|
||||||
|
|||||||
@@ -450,6 +450,15 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase {
|
|||||||
swipeToPosition(0f, Direction.DOWN, 0);
|
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) {
|
private void swipeToPosition(float percent, Direction direction, float velocityY) {
|
||||||
Mockito.clearInvocations(mTouchSession);
|
Mockito.clearInvocations(mTouchSession);
|
||||||
|
|||||||
Reference in New Issue
Block a user