Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f69986fa authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Save the notification group key on the bubble" into sc-dev am: 70b6c098

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13484220

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibb8779b1d7b01f8a552ed05e105d3de468274897
parents a069cade 70b6c098
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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;
    }
+3 −6
Original line number Diff line number Diff line
@@ -893,10 +893,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);
            }
        }
@@ -1065,8 +1062,8 @@ public class BubbleController {
    private boolean isSummaryOfBubbles(BubbleEntry entry) {
        String groupKey = entry.getStatusBarNotification().getGroupKey();
        ArrayList<Bubble> 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();
    }