Loading src/com/android/settings/spa/notification/AppNotificationRepository.kt +4 −2 Original line number Diff line number Diff line Loading @@ -123,13 +123,15 @@ class AppNotificationRepository( } override fun getNotificationSummary(app: ApplicationInfo): String { if (!isEnabled(app)) return context.getString(R.string.off) if (!isEnabled(app)) return context.getString(R.string.notifications_disabled) val channelCount = getChannelCount(app) if (channelCount == 0) { return calculateFrequencySummary(getSentCount(app)) } val blockedChannelCount = getBlockedChannelCount(app) if (channelCount == blockedChannelCount) return context.getString(R.string.off) if (channelCount == blockedChannelCount) { return context.getString(R.string.notifications_disabled) } val frequencySummary = calculateFrequencySummary(getSentCount(app)) if (blockedChannelCount == 0) return frequencySummary return context.getString( Loading tests/spa_unit/src/com/android/settings/spa/notification/AppNotificationRepositoryTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ class AppNotificationRepositoryTest { val summary = repository.getNotificationSummary(APP) assertThat(summary).isEqualTo(context.getString(R.string.off)) assertThat(summary).isEqualTo(context.getString(R.string.notifications_disabled)) } @Test Loading @@ -273,7 +273,7 @@ class AppNotificationRepositoryTest { val summary = repository.getNotificationSummary(APP) assertThat(summary).isEqualTo(context.getString(R.string.off)) assertThat(summary).isEqualTo(context.getString(R.string.notifications_disabled)) } @Test Loading Loading
src/com/android/settings/spa/notification/AppNotificationRepository.kt +4 −2 Original line number Diff line number Diff line Loading @@ -123,13 +123,15 @@ class AppNotificationRepository( } override fun getNotificationSummary(app: ApplicationInfo): String { if (!isEnabled(app)) return context.getString(R.string.off) if (!isEnabled(app)) return context.getString(R.string.notifications_disabled) val channelCount = getChannelCount(app) if (channelCount == 0) { return calculateFrequencySummary(getSentCount(app)) } val blockedChannelCount = getBlockedChannelCount(app) if (channelCount == blockedChannelCount) return context.getString(R.string.off) if (channelCount == blockedChannelCount) { return context.getString(R.string.notifications_disabled) } val frequencySummary = calculateFrequencySummary(getSentCount(app)) if (blockedChannelCount == 0) return frequencySummary return context.getString( Loading
tests/spa_unit/src/com/android/settings/spa/notification/AppNotificationRepositoryTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ class AppNotificationRepositoryTest { val summary = repository.getNotificationSummary(APP) assertThat(summary).isEqualTo(context.getString(R.string.off)) assertThat(summary).isEqualTo(context.getString(R.string.notifications_disabled)) } @Test Loading @@ -273,7 +273,7 @@ class AppNotificationRepositoryTest { val summary = repository.getNotificationSummary(APP) assertThat(summary).isEqualTo(context.getString(R.string.off)) assertThat(summary).isEqualTo(context.getString(R.string.notifications_disabled)) } @Test Loading