From f833ecebfaf2e40b32b4d3d86f3eb95760ce42aa Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 18 May 2021 17:14:52 -0700 Subject: [PATCH] Notify when quickstep gesture starts Fixes: 182500083 Test: manual Change-Id: I1ab27b309c0dd2640add1aa83566acee20708a3a --- .../android/quickstep/AbsSwipeUpHandler.java | 1 + .../quickstep/RotationTouchHelper.java | 2 +- .../com/android/quickstep/SystemUiProxy.java | 19 +++++++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index e0f430d6cf..005e9b5a7d 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -750,6 +750,7 @@ public abstract class AbsSwipeUpHandler, setIsLikelyToStartNewTask(isLikelyToStartNewTask, false /* animate */); mStateCallback.setStateOnUiThread(STATE_GESTURE_STARTED); mGestureStarted = true; + SystemUiProxy.INSTANCE.get(mContext).notifySwipeUpGestureStarted(); } /** diff --git a/quickstep/src/com/android/quickstep/RotationTouchHelper.java b/quickstep/src/com/android/quickstep/RotationTouchHelper.java index 070d725890..66929d0cdb 100644 --- a/quickstep/src/com/android/quickstep/RotationTouchHelper.java +++ b/quickstep/src/com/android/quickstep/RotationTouchHelper.java @@ -369,7 +369,7 @@ public class RotationTouchHelper implements private void notifySysuiOfCurrentRotation(int rotation) { UI_HELPER_EXECUTOR.execute(() -> SystemUiProxy.INSTANCE.get(mContext) - .onQuickSwitchToNewTask(rotation)); + .notifyPrioritizedRotation(rotation)); } /** diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index acf999253f..7ef6a4a4c8 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -341,6 +341,17 @@ public class SystemUiProxy implements ISystemUiProxy, } } + @Override + public void notifySwipeUpGestureStarted() { + if (mSystemUiProxy != null) { + try { + mSystemUiProxy.notifySwipeUpGestureStarted(); + } catch (RemoteException e) { + Log.w(TAG, "Failed call notifySwipeUpGestureStarted", e); + } + } + } + /** * Notifies that swipe-to-home action is finished. */ @@ -350,18 +361,18 @@ public class SystemUiProxy implements ISystemUiProxy, try { mSystemUiProxy.notifySwipeToHomeFinished(); } catch (RemoteException e) { - Log.w(TAG, "Failed call setPinnedStackAnimationType", e); + Log.w(TAG, "Failed call notifySwipeToHomeFinished", e); } } } @Override - public void onQuickSwitchToNewTask(int rotation) { + public void notifyPrioritizedRotation(int rotation) { if (mSystemUiProxy != null) { try { - mSystemUiProxy.onQuickSwitchToNewTask(rotation); + mSystemUiProxy.notifyPrioritizedRotation(rotation); } catch (RemoteException e) { - Log.w(TAG, "Failed call onQuickSwitchToNewTask with arg: " + rotation, e); + Log.w(TAG, "Failed call notifyPrioritizedRotation with arg: " + rotation, e); } } }