diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java index ffeabd876b813..40fdb97b00948 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java @@ -39,6 +39,7 @@ import android.graphics.drawable.Icon; import android.os.Parcelable; import android.os.UserHandle; import android.provider.Settings; +import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.Log; @@ -59,6 +60,8 @@ public class Bubble implements BubbleViewProvider { private static final String TAG = "Bubble"; private final String mKey; + @Nullable + private final String mGroupKey; private final Executor mMainExecutor; private long mLastUpdated; @@ -165,6 +168,7 @@ public class Bubble implements BubbleViewProvider { mMetadataShortcutId = shortcutInfo.getId(); mShortcutInfo = shortcutInfo; mKey = key; + mGroupKey = null; mFlags = 0; mUser = shortcutInfo.getUserHandle(); mPackageName = shortcutInfo.getPackage(); @@ -182,6 +186,7 @@ public class Bubble implements BubbleViewProvider { final Bubbles.PendingIntentCanceledListener intentCancelListener, Executor mainExecutor) { mKey = entry.getKey(); + mGroupKey = entry.getGroupKey(); mSuppressionListener = listener; mIntentCancelListener = intent -> { if (mIntent != null) { @@ -200,6 +205,14 @@ public class Bubble implements BubbleViewProvider { return mKey; } + /** + * @see StatusBarNotification#getGroupKey() + * @return the group key for this bubble, if one exists. + */ + public String getGroupKey() { + return mGroupKey; + } + public UserHandle getUser() { return mUser; } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 7538c8b7ffad1..9b9ab04a0164f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -892,10 +892,7 @@ public class BubbleController { return bubbleChildren; } for (Bubble bubble : mBubbleData.getActiveBubbles()) { - // TODO(178620678): Prevent calling into SysUI since this can be a part of a blocking - // call from SysUI to Shell - final BubbleEntry entry = mSysuiProxy.getPendingOrActiveEntry(bubble.getKey()); - if (entry != null && groupKey.equals(entry.getStatusBarNotification().getGroupKey())) { + if (bubble.getGroupKey() != null && groupKey.equals(bubble.getGroupKey())) { bubbleChildren.add(bubble); } } @@ -1064,8 +1061,8 @@ public class BubbleController { private boolean isSummaryOfBubbles(BubbleEntry entry) { String groupKey = entry.getStatusBarNotification().getGroupKey(); ArrayList bubbleChildren = getBubblesInGroup(groupKey); - boolean isSuppressedSummary = (mBubbleData.isSummarySuppressed(groupKey) - && mBubbleData.getSummaryKey(groupKey).equals(entry.getKey())); + boolean isSuppressedSummary = mBubbleData.isSummarySuppressed(groupKey) + && mBubbleData.getSummaryKey(groupKey).equals(entry.getKey()); boolean isSummary = entry.getStatusBarNotification().getNotification().isGroupSummary(); return (isSuppressedSummary || isSummary) && !bubbleChildren.isEmpty(); }