Add app info notification summary

Test: make -j RunSettingsRoboTests
Change-Id: I803b473d994dff4ec8591c43452820b0e702ea0e
Fixes: 72442731
This commit is contained in:
Julia Reynolds
2018-03-30 10:40:36 -04:00
parent 27587f7884
commit 78756b1880
3 changed files with 81 additions and 14 deletions

View File

@@ -60,6 +60,8 @@ public class NotificationBackend {
row.banned = getNotificationsBanned(row.pkg, row.uid);
row.showBadge = canShowBadge(row.pkg, row.uid);
row.userId = UserHandle.getUserId(row.uid);
row.blockedChannelCount = getBlockedChannelCount(row.pkg, row.uid);
row.channelCount = getChannelCount(row.pkg, row.uid);
return row;
}
@@ -178,18 +180,6 @@ public class NotificationBackend {
}
}
public NotificationChannelGroup getGroupWithChannels(String pkg, int uid, String groupId) {
if (groupId == null) {
return null;
}
try {
return sINM.getPopulatedNotificationChannelGroupForPackage(pkg, uid, groupId, true);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return null;
}
}
public ParceledListSlice<NotificationChannelGroup> getGroups(String pkg, int uid) {
try {
return sINM.getNotificationChannelGroupsForPackage(pkg, uid, false);
@@ -224,6 +214,15 @@ public class NotificationBackend {
}
}
public int getBlockedChannelCount(String pkg, int uid) {
try {
return sINM.getBlockedChannelCount(pkg, uid);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return 0;
}
}
public boolean onlyHasDefaultChannel(String pkg, int uid) {
try {
return sINM.onlyHasDefaultChannel(pkg, uid);
@@ -233,6 +232,15 @@ public class NotificationBackend {
}
}
public int getChannelCount(String pkg, int uid) {
try {
return sINM.getNumNotificationChannelsForPackage(pkg, uid, false);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return 0;
}
}
public List<NotifyingApp> getRecentApps() {
try {
return sINM.getRecentNotifyingAppsForUser(UserHandle.myUserId()).getList();
@@ -259,5 +267,7 @@ public class NotificationBackend {
public String lockedChannelId;
public boolean showBadge;
public int userId;
public int blockedChannelCount;
public int channelCount;
}
}