From 95df178e4fe0598836a0d9729ca9b41606357e5a Mon Sep 17 00:00:00 2001 From: fbaron Date: Thu, 9 May 2024 14:23:33 -0700 Subject: [PATCH] Fix bug where hotseat disappears Fix: 336096469 Bug: 339700174 Flag: NONE Test: n/a Change-Id: Ie567c08445d7743281f501c782a8fd51a75ad9bc (cherry picked from commit cf10603ed3953cffed97198eb0455e986fb6361c) --- .../hybridhotseat/HotseatPredictionController.java | 12 ++++++++++++ .../launcher3/uioverrides/QuickstepLauncher.java | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java index 672bd1decf..6493234ea8 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java @@ -29,6 +29,7 @@ import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.ComponentName; +import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.View; import android.view.ViewGroup; @@ -80,6 +81,7 @@ public class HotseatPredictionController implements DragController.DragListener, SystemShortcut.Factory, DeviceProfile.OnDeviceProfileChangeListener, DragSource, ViewGroup.OnHierarchyChangeListener { + private static final String TAG = "HotseatPredictionController"; private static final int FLAG_UPDATE_PAUSED = 1 << 0; private static final int FLAG_DRAG_IN_PROGRESS = 1 << 1; private static final int FLAG_FILL_IN_PROGRESS = 1 << 2; @@ -291,6 +293,16 @@ public class HotseatPredictionController implements DragController.DragListener, } } + /** + * Ensures that if the flag FLAG_UPDATE_PAUSED is active we set it to false. + */ + public void verifyUIUpdateNotPaused() { + if ((mPauseFlags & FLAG_UPDATE_PAUSED) != 0) { + setPauseUIUpdate(false); + Log.e(TAG, "FLAG_UPDATE_PAUSED should not be set to true (see b/339700174)"); + } + } + /** * Sets or updates the predicted items */ diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 1ea2cdc640..702997c442 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -389,6 +389,12 @@ public class QuickstepLauncher extends Launcher { return result; } + @Override + public void startBinding() { + super.startBinding(); + mHotseatPredictionController.verifyUIUpdateNotPaused(); + } + @Override protected void onActivityFlagsChanged(int changeBits) { if ((changeBits & ACTIVITY_STATE_STARTED) != 0) {