Create BubbleMetadata use it instead of app overlay intent
* BubbleMetadata encapsulates necessary info to display a bubble
* Replaces app overlay intent usages with BubbleMetadata
* Renames existing bubble APIs to use 'bubble' rather than 'app overlay'
Bug: 111236845
Test: existing tests pass
Change-Id: I6a85d3c41dda47139fb8d960cadf1c8e109cf29b
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index d7bf77d..957d772 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -284,8 +284,9 @@
@Nullable
private PendingIntent getAppOverlayIntent(NotificationEntry notif) {
Notification notification = notif.notification.getNotification();
- if (canLaunchInActivityView(notification.getAppOverlayIntent())) {
- return notification.getAppOverlayIntent();
+ if (canLaunchInActivityView(notification.getBubbleMetadata() != null
+ ? notification.getBubbleMetadata().getIntent() : null)) {
+ return notification.getBubbleMetadata().getIntent();
} else if (shouldUseContentIntent(mContext)
&& canLaunchInActivityView(notification.contentIntent)) {
Log.d(TAG, "[addBubble " + notif.key
@@ -446,15 +447,16 @@
StatusBarNotification n = entry.notification;
boolean canAppOverlay = false;
try {
- canAppOverlay = mNotificationManagerService.areAppOverlaysAllowedForPackage(
+ canAppOverlay = mNotificationManagerService.areBubblesAllowedForPackage(
n.getPackageName(), n.getUid());
} catch (RemoteException e) {
Log.w(TAG, "Error calling NoMan to determine if app can overlay", e);
}
boolean canChannelOverlay = mNotificationEntryManager.getNotificationData().getChannel(
- entry.key).canOverlayApps();
- boolean hasOverlayIntent = n.getNotification().getAppOverlayIntent() != null;
+ entry.key).canBubble();
+ boolean hasOverlayIntent = n.getNotification().getBubbleMetadata() != null
+ && n.getNotification().getBubbleMetadata().getIntent() != null;
return hasOverlayIntent && canChannelOverlay && canAppOverlay;
}