Add settings for notification bubbling
Globally, as well as at the app and channel level Test: atest Bug: 123543052 Change-Id: I1668b592c5d175d77d6a38f35e7576d641175d44
This commit is contained in:
@@ -71,6 +71,7 @@ public class NotificationBackend {
|
||||
row.icon = IconDrawableFactory.newInstance(context).getBadgedIcon(app);
|
||||
row.banned = getNotificationsBanned(row.pkg, row.uid);
|
||||
row.showBadge = canShowBadge(row.pkg, row.uid);
|
||||
row.allowBubbles = canBubble(row.pkg, row.uid);
|
||||
row.userId = UserHandle.getUserId(row.uid);
|
||||
row.blockedChannelCount = getBlockedChannelCount(row.pkg, row.uid);
|
||||
row.channelCount = getChannelCount(row.pkg, row.uid);
|
||||
@@ -175,6 +176,26 @@ public class NotificationBackend {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canBubble(String pkg, int uid) {
|
||||
try {
|
||||
return sINM.areBubblesAllowedForPackage(pkg, uid);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Error calling NoMan", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setAllowBubbles(String pkg, int uid, boolean allow) {
|
||||
try {
|
||||
sINM.setBubblesAllowed(pkg, uid, allow);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Error calling NoMan", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public NotificationChannel getChannel(String pkg, int uid, String channelId) {
|
||||
if (channelId == null) {
|
||||
return null;
|
||||
@@ -416,6 +437,7 @@ public class NotificationBackend {
|
||||
public boolean lockedImportance;
|
||||
public String lockedChannelId;
|
||||
public boolean showBadge;
|
||||
public boolean allowBubbles;
|
||||
public int userId;
|
||||
public int blockedChannelCount;
|
||||
public int channelCount;
|
||||
|
Reference in New Issue
Block a user