From f8441cc276aafb9e5b6370ff445ad96d85d5e918 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Fri, 16 Jul 2021 17:50:56 -0700 Subject: [PATCH] Fix notification dot not always being up to date. - Prediction row views were never updated when notification changes. - FloatingIconView set the BubbleTextView to force hide dot, but never restored it. BubbleTextView is instanceof IconLabelDotView, so its already handled in the end runnable Bug: 183360736 Test: 1. swipe up to go home such that the closing app has a notification, note that the notification dot is properly updated 2. have all apps open make notification update for a predicted app ensure dot is properly updated Change-Id: I35dacf9b71a3d8b8a857be450690d65ea9199bf6 --- .../android/launcher3/appprediction/PredictionRowView.java | 7 +++++++ src/com/android/launcher3/allapps/AllAppsStore.java | 2 +- src/com/android/launcher3/views/FloatingIconView.java | 5 ----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java index de040821b4..6afbf9a28c 100644 --- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java @@ -96,6 +96,13 @@ public class PredictionRowView extends LinearLayout implements private void updateVisibility() { setVisibility(mPredictionsEnabled ? VISIBLE : GONE); + if (mLauncher.getAppsView() != null) { + if (mPredictionsEnabled) { + mLauncher.getAppsView().getAppsStore().registerIconContainer(this); + } else { + mLauncher.getAppsView().getAppsStore().unregisterIconContainer(this); + } + } } @Override diff --git a/src/com/android/launcher3/allapps/AllAppsStore.java b/src/com/android/launcher3/allapps/AllAppsStore.java index 2443b8360d..7bc3eecfea 100644 --- a/src/com/android/launcher3/allapps/AllAppsStore.java +++ b/src/com/android/launcher3/allapps/AllAppsStore.java @@ -132,7 +132,7 @@ public class AllAppsStore { } public void registerIconContainer(ViewGroup container) { - if (container != null) { + if (container != null && !mIconContainers.contains(container)) { mIconContainers.add(container); } } diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 3027db6c16..872adec42e 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -580,11 +580,6 @@ public class FloatingIconView extends FrameLayout implements if (originalView instanceof IconLabelDotView) { setIconAndDotVisible(originalView, true); } - if (originalView instanceof BubbleTextView) { - BubbleTextView btv = (BubbleTextView) originalView; - btv.setIconVisible(true); - btv.setForceHideDot(true); - } view.finish(dragLayer); } } else {