Merge "Use string notifications_disabled instead of off" into udc-dev am: 83c04b32d1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22938598

Change-Id: Ic0c8f13e3d2a6e26c0c42e65d58d112df33c2206
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Kweku Adams
2023-05-01 16:18:59 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 4 deletions

View File

@@ -123,13 +123,15 @@ class AppNotificationRepository(
} }
override fun getNotificationSummary(app: ApplicationInfo): String { 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) val channelCount = getChannelCount(app)
if (channelCount == 0) { if (channelCount == 0) {
return calculateFrequencySummary(getSentCount(app)) return calculateFrequencySummary(getSentCount(app))
} }
val blockedChannelCount = getBlockedChannelCount(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)) val frequencySummary = calculateFrequencySummary(getSentCount(app))
if (blockedChannelCount == 0) return frequencySummary if (blockedChannelCount == 0) return frequencySummary
return context.getString( return context.getString(

View File

@@ -251,7 +251,7 @@ class AppNotificationRepositoryTest {
val summary = repository.getNotificationSummary(APP) val summary = repository.getNotificationSummary(APP)
assertThat(summary).isEqualTo(context.getString(R.string.off)) assertThat(summary).isEqualTo(context.getString(R.string.notifications_disabled))
} }
@Test @Test
@@ -273,7 +273,7 @@ class AppNotificationRepositoryTest {
val summary = repository.getNotificationSummary(APP) val summary = repository.getNotificationSummary(APP)
assertThat(summary).isEqualTo(context.getString(R.string.off)) assertThat(summary).isEqualTo(context.getString(R.string.notifications_disabled))
} }
@Test @Test