summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matías Hernández <matiashe@google.com> 2024-08-07 10:07:58 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-08-07 10:07:58 +0000
commit133e73094b2df1d34155ea0233467e8564002fcc (patch)
tree7fc5e97069be81ce9b79cdb7db1b2270fc8454fa
parent21bdcf11a2283b29875f2963e638fb5b8efa87f7 (diff)
parentc639af8e3710b55a91963dcbc5964c49dfdeb375 (diff)
Merge "Rename MANUAL_DND to MANUAL_DND_ACTIVE in TestModeBuilder" into main
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java13
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/domain/interactor/ZenModeInteractorTest.kt4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ui/dialog/viewmodel/ModesDialogViewModelTest.kt4
3 files changed, 13 insertions, 8 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java b/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java
index 22e6133a3019..2c982d6a9fe2 100644
--- a/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java
+++ b/packages/SettingsLib/src/com/android/settingslib/notification/modes/TestModeBuilder.java
@@ -40,13 +40,18 @@ public class TestModeBuilder {
private ZenModeConfig.ZenRule mConfigZenRule;
public static final ZenMode EXAMPLE = new TestModeBuilder().build();
- public static final ZenMode MANUAL_DND = ZenMode.manualDndMode(
- new AutomaticZenRule.Builder("Manual DND", Uri.parse("rule://dnd"))
+ public static final ZenMode MANUAL_DND_ACTIVE = ZenMode.manualDndMode(
+ new AutomaticZenRule.Builder("Do Not Disturb", Uri.parse("rule://dnd"))
.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_PRIORITY)
.setZenPolicy(new ZenPolicy.Builder().disallowAllSounds().build())
.build(),
- true /* isActive */
- );
+ /* isActive= */ true);
+ public static final ZenMode MANUAL_DND_INACTIVE = ZenMode.manualDndMode(
+ new AutomaticZenRule.Builder("Do Not Disturb", Uri.parse("rule://dnd"))
+ .setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_PRIORITY)
+ .setZenPolicy(new ZenPolicy.Builder().disallowAllSounds().build())
+ .build(),
+ /* isActive= */ false);
public TestModeBuilder() {
// Reasonable defaults
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/domain/interactor/ZenModeInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/domain/interactor/ZenModeInteractorTest.kt
index 32f66c1ccd66..11504aadf743 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/domain/interactor/ZenModeInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/domain/interactor/ZenModeInteractorTest.kt
@@ -172,7 +172,7 @@ class ZenModeInteractorTest : SysuiTestCase() {
@Test
fun shouldAskForZenDuration_changesWithSetting() =
testScope.runTest {
- val manualDnd = TestModeBuilder.MANUAL_DND
+ val manualDnd = TestModeBuilder.MANUAL_DND_ACTIVE
settingsRepository.setInt(ZEN_DURATION, ZEN_DURATION_FOREVER)
runCurrent()
@@ -201,7 +201,7 @@ class ZenModeInteractorTest : SysuiTestCase() {
@Test
fun activateMode_usesCorrectDuration() =
testScope.runTest {
- val manualDnd = TestModeBuilder.MANUAL_DND
+ val manualDnd = TestModeBuilder.MANUAL_DND_ACTIVE
zenModeRepository.addModes(listOf(manualDnd))
settingsRepository.setInt(ZEN_DURATION, ZEN_DURATION_FOREVER)
runCurrent()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ui/dialog/viewmodel/ModesDialogViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ui/dialog/viewmodel/ModesDialogViewModelTest.kt
index 62161bfeffb3..bcad7e7bc31c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ui/dialog/viewmodel/ModesDialogViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ui/dialog/viewmodel/ModesDialogViewModelTest.kt
@@ -69,7 +69,7 @@ class ModesDialogViewModelTest : SysuiTestCase() {
.setName("Disabled by other")
.setEnabled(false, /* byUser= */ false)
.build(),
- TestModeBuilder.MANUAL_DND,
+ TestModeBuilder.MANUAL_DND_ACTIVE,
TestModeBuilder()
.setName("Enabled")
.setEnabled(true)
@@ -91,7 +91,7 @@ class ModesDialogViewModelTest : SysuiTestCase() {
assertThat(this.enabled).isEqualTo(false)
}
with(tiles?.elementAt(1)!!) {
- assertThat(this.text).isEqualTo("Manual DND")
+ assertThat(this.text).isEqualTo("Do Not Disturb")
assertThat(this.subtext).isEqualTo("On")
assertThat(this.enabled).isEqualTo(true)
}