summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/INotificationManager.aidl1
-rw-r--r--core/java/android/app/NotificationManager.java16
2 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index a5f8f103e437..d0e17f00e990 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -85,6 +85,7 @@ interface INotificationManager
void setBubblesAllowed(String pkg, int uid, int bubblePreference);
boolean areBubblesAllowed(String pkg);
+ boolean areBubblesEnabled(in UserHandle user);
int getBubblePreferenceForPackage(String pkg, int uid);
void createNotificationChannelGroups(String pkg, in ParceledListSlice channelGroupList);
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index 6cce270bc5a3..f0d580f066d8 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -1326,7 +1326,6 @@ public class NotificationManager {
}
}
-
/**
* Gets whether all notifications posted by this app can appear outside of the
* notification shade, floating over other apps' content.
@@ -1348,6 +1347,21 @@ public class NotificationManager {
}
/**
+ * Returns whether bubbles are enabled at the feature level for the current user. When enabled,
+ * notifications able to bubble will display an affordance allowing the user to bubble them.
+ *
+ * @see Notification.Builder#setBubbleMetadata(Notification.BubbleMetadata)
+ */
+ public boolean areBubblesEnabled() {
+ INotificationManager service = getService();
+ try {
+ return service.areBubblesEnabled(mContext.getUser());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Gets the bubble preference for the app. This preference only applies to notifications that
* have been properly configured to bubble.
*