diff options
| author | 2020-06-11 03:34:04 +0000 | |
|---|---|---|
| committer | 2020-06-11 03:34:04 +0000 | |
| commit | 8a9020bb5832a1075e7776ffeddb97f3e98be118 (patch) | |
| tree | 1d5f7a613204ebf65cd05edebe828591fcf044ec | |
| parent | 37fdaf9014e42f955c27b4a7b84b83580b4d3bd7 (diff) | |
| parent | f4afd8db2fa4ae24ddea46dd5dc38beddd408159 (diff) | |
Merge "Fix duplicate bubbles in overflow" into rvc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java index 2affe0605d89..873b0785bd7f 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java @@ -55,7 +55,6 @@ import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.graphics.PixelFormat; -import android.graphics.Rect; import android.os.Binder; import android.os.Handler; import android.os.RemoteException; @@ -180,6 +179,9 @@ public class BubbleController implements ConfigurationController.ConfigurationLi // Callback that updates BubbleOverflowActivity on data change. @Nullable private Runnable mOverflowCallback = null; + // Only load overflow data from disk once + private boolean mOverflowDataLoaded = false; + private final NotificationInterruptStateProvider mNotificationInterruptStateProvider; private IStatusBarService mBarService; private WindowManager mWindowManager; @@ -193,9 +195,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi /** Whether or not the BubbleStackView has been added to the WindowManager. */ private boolean mAddedToWindowManager = false; - // Used for determining view rect for touch interaction - private Rect mTempRect = new Rect(); - // Listens to user switch so bubbles can be saved and restored. private final NotificationLockscreenUserManager mNotifUserManager; @@ -962,13 +961,14 @@ public class BubbleController implements ConfigurationController.ConfigurationLi * Fills the overflow bubbles by loading them from disk. */ void loadOverflowBubblesFromDisk() { - if (!mBubbleData.getOverflowBubbles().isEmpty()) { + if (!mBubbleData.getOverflowBubbles().isEmpty() || mOverflowDataLoaded) { // we don't need to load overflow bubbles from disk if it is already in memory return; } + mOverflowDataLoaded = true; mDataRepository.loadBubbles((bubbles) -> { bubbles.forEach(bubble -> { - if (mBubbleData.getBubbles().contains(bubble)) { + if (mBubbleData.hasAnyBubbleWithKey(bubble.getKey())) { // if the bubble is already active, there's no need to push it to overflow return; } |