Fix hotseat predicted app update regression.
Hotseat predicted app updates were only being allowed then the hotseat was invisible or when the workspace was loading. This was too strict. Changed the logic to ignore hotseat visibility when the workspace is loading, when there are empty spots in the hotseat and when the predicted items are unchanged. This ensures the hotseat always has the intended number of icons and that icons can be updated in-place.
Fixes: 172597819
Demo: https://drive.google.com/file/d/100svnqX048Da7vues2p-vvQNN6sIF8v4/view?usp=sharing
Change-Id: I2f93ff44618c0282a6411918c34d70f75ec73b73
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
index d3b7e22..4953138 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
@@ -251,7 +251,10 @@
* Sets or updates the predicted items
*/
public void setPredictedItems(FixedContainerItems items) {
- if (!mLauncher.isWorkspaceLoading()
+ boolean shouldIgnoreVisibility = mLauncher.isWorkspaceLoading()
+ || mPredictedItems.equals(items.items)
+ || mHotseat.getShortcutsAndWidgets().getChildCount() < mHotSeatItemsCount;
+ if (!shouldIgnoreVisibility
&& mHotseat.isShown()
&& mHotseat.getWindowVisibility() == View.VISIBLE) {
mHotseat.setOnVisibilityAggregatedCallback((isVisible) -> {