Merge "Add notification sent count to app info"

This commit is contained in:
TreeHugger Robot
2018-06-18 19:43:00 +00:00
committed by Android (Google) Code Review
5 changed files with 47 additions and 31 deletions

View File

@@ -139,10 +139,12 @@ public class AppNotificationPreferenceControllerTest {
appRow.banned = false;
appRow.blockedChannelCount = 30;
appRow.channelCount = 60;
appRow.sentByApp = new NotificationBackend.NotificationsSentState();
appRow.sentByApp.avgSentWeekly = 4;
assertThat(mController.getNotificationSummary(
appRow, mContext).toString().contains("30")).isTrue();
assertThat(mController.getNotificationSummary(
appRow, mContext).toString().contains("On")).isTrue();
assertThat(mController.getNotificationSummary(appRow, mContext).toString().contains(
NotificationBackend.getSentSummary(mContext, appRow.sentByApp, false))).isTrue();
}
@Test
@@ -151,7 +153,10 @@ public class AppNotificationPreferenceControllerTest {
appRow.banned = false;
appRow.blockedChannelCount = 0;
appRow.channelCount = 10;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo("On");
appRow.sentByApp = new NotificationBackend.NotificationsSentState();
appRow.sentByApp.avgSentDaily = 4;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo(
NotificationBackend.getSentSummary(mContext, appRow.sentByApp, false));
}
@Test
@@ -160,6 +165,9 @@ public class AppNotificationPreferenceControllerTest {
appRow.banned = false;
appRow.blockedChannelCount = 0;
appRow.channelCount = 0;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo("On");
appRow.sentByApp = new NotificationBackend.NotificationsSentState();
appRow.sentByApp.avgSentDaily = 7;
assertThat(mController.getNotificationSummary(appRow, mContext).toString()).isEqualTo(
NotificationBackend.getSentSummary(mContext, appRow.sentByApp, false));
}
}