Merge "Save the notification group key on the bubble" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
70b6c098ab
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user