From 14e43ef0de1a2462050e5e69f740d7a4b0b5618b Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 24 Oct 2024 10:25:14 -0400 Subject: [PATCH] Disable OrientationEventListener in RotationTouchHelper#destroy() * Also cleared the list of runnables to run on destroy after they are all executed Bug: 361850561 Flag: EXEMPT bugfix Test: QS works as expected in different rotations Change-Id: If0dfbb7d538b24fe7aad0b4ed427d779b5a86bfd --- quickstep/src/com/android/quickstep/RotationTouchHelper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java index 80c07196ae..79abc0f369 100644 --- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java +++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java @@ -180,6 +180,7 @@ public class RotationTouchHelper implements DisplayInfoChangeListener, SafeClose } } }; + runOnDestroy(() -> mOrientationListener.disable()); mNeedsInit = false; } @@ -212,6 +213,7 @@ public class RotationTouchHelper implements DisplayInfoChangeListener, SafeClose r.run(); } mNeedsInit = true; + mOnDestroyActions.clear(); } public boolean isTaskListFrozen() {