From 4d18da78c02785baea4baea37392a6eb889538d9 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Wed, 15 Jun 2022 14:48:40 -0700 Subject: [PATCH] Fix All set activity not drawing on initial swipe. The launcher was not properly preloading upon launching the All Set Activity. The Launcher would only start loading once the user started swiping up. This would stop the all set activity from drawing. Test: Factory reset with a restore and tested the all set page. Fixes: 234536107 Change-Id: I6bcb805ea6c43fb993f2b57499444ea62bcc37e1 --- .../quickstep/TouchInteractionService.java | 15 +++++++++++++++ .../quickstep/interaction/AllSetActivity.java | 2 ++ 2 files changed, 17 insertions(+) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 16f141b17b..61d36fb1f7 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -147,6 +147,8 @@ public class TouchInteractionService extends Service */ public class TISBinder extends IOverviewProxy.Stub { + @Nullable private Runnable mOnOverviewTargetChangeListener = null; + @BinderThread public void onInitialize(Bundle bundle) { ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface( @@ -327,6 +329,18 @@ public class TouchInteractionService extends Service public void setGestureBlockedTaskId(int taskId) { mDeviceState.setGestureBlockingTaskId(taskId); } + + /** Sets a listener to be run on Overview Target updates. */ + public void setOverviewTargetChangeListener(@Nullable Runnable listener) { + mOnOverviewTargetChangeListener = listener; + } + + protected void onOverviewTargetChange() { + if (mOnOverviewTargetChangeListener != null) { + mOnOverviewTargetChangeListener.run(); + mOnOverviewTargetChangeListener = null; + } + } } private static boolean sConnected = false; @@ -487,6 +501,7 @@ public class TouchInteractionService extends Service if (newOverviewActivity != null) { mTaskbarManager.setActivity(newOverviewActivity); } + mTISBinder.onOverviewTargetChange(); } @UiThread diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index caf61c790e..5680170a8f 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -202,6 +202,7 @@ public class AllSetActivity extends Activity { mBinder = binder; mBinder.getTaskbarManager().setSetupUIVisible(isResumed()); mBinder.setSwipeUpProxy(isResumed() ? this::createSwipeUpProxy : null); + mBinder.setOverviewTargetChangeListener(mBinder::preloadOverviewForSUWAllSet); mBinder.preloadOverviewForSUWAllSet(); } @@ -218,6 +219,7 @@ public class AllSetActivity extends Activity { if (mBinder != null) { mBinder.getTaskbarManager().setSetupUIVisible(false); mBinder.setSwipeUpProxy(null); + mBinder.setOverviewTargetChangeListener(null); } }