diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-06-10 16:03:53 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-06-12 14:42:38 +0000 |
commit | a029a8b2d59a12720c09f778bb69d49d0d2cc7e2 (patch) | |
tree | ea302271b8c63d49d07cfbf544e8122f3405eb50 /quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java | |
parent | 1a66df255adf0694dd0ef865f9b0479c11b14321 (diff) | |
download | android_packages_apps_Trebuchet-a029a8b2d59a12720c09f778bb69d49d0d2cc7e2.tar.gz android_packages_apps_Trebuchet-a029a8b2d59a12720c09f778bb69d49d0d2cc7e2.tar.bz2 android_packages_apps_Trebuchet-a029a8b2d59a12720c09f778bb69d49d0d2cc7e2.zip |
Bypass systemstate check when using shared state
System state can change using the interaction, for eg: an app can
enter immersive mode in the middle of quickswitch. Ignore such changes
to prevent system gestures getting blocked by an app
> Fixing nullpointer in device locked consumer construction when user is not locked yet
> Creating a fallback resetGesture input consumer, which cancels any pending transition
in case we missed to cancel it
Bug: 134091263
Bug: 134406364
Change-Id: Iafc4e53691f50862b013ad9c4023839044cf1d72
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java index 94e704a71..83601e617 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java @@ -49,6 +49,8 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener { private final Consumer<SwipeAnimationTargetSet> mOnFinishListener; private RecentsAnimationControllerCompat mController; + private boolean mCancelled; + public RecentsAnimationListenerSet(boolean shouldMinimizeSplitScreen, Consumer<SwipeAnimationTargetSet> onFinishListener) { mShouldMinimizeSplitScreen = shouldMinimizeSplitScreen; @@ -75,11 +77,16 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener { SwipeAnimationTargetSet targetSet = new SwipeAnimationTargetSet(controller, targets, homeContentInsets, minimizedHomeBounds, mShouldMinimizeSplitScreen, mOnFinishListener); - Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> { - for (SwipeAnimationListener listener : getListeners()) { - listener.onRecentsAnimationStart(targetSet); - } - }); + + if (mCancelled) { + targetSet.cancelAnimation(); + } else { + Utilities.postAsyncCallback(MAIN_THREAD_EXECUTOR.getHandler(), () -> { + for (SwipeAnimationListener listener : getListeners()) { + listener.onRecentsAnimationStart(targetSet); + } + }); + } } @Override @@ -99,4 +106,9 @@ public class RecentsAnimationListenerSet implements RecentsAnimationListener { private SwipeAnimationListener[] getListeners() { return mListeners.toArray(new SwipeAnimationListener[mListeners.size()]); } + + public void cancelListener() { + mCancelled = true; + onAnimationCanceled(false); + } } |