Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -14334,6 +14334,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Test @EnableFlags(android.app.Flags.FLAG_MODES_API) @EnableCompatChanges(NotificationManagerService.MANAGE_GLOBAL_ZEN_VIA_IMPLICIT_RULES) public void requestInterruptionFilterFromListener_fromApp_doesNotSetGlobalZen() throws Exception { mService.setCallerIsNormalPackage(); Loading @@ -14351,6 +14352,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Test @EnableFlags(android.app.Flags.FLAG_MODES_API) @EnableCompatChanges(NotificationManagerService.MANAGE_GLOBAL_ZEN_VIA_IMPLICIT_RULES) public void requestInterruptionFilterFromListener_fromSystem_setsGlobalZen() throws Exception { mService.isSystemUid = true; services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java +18 −4 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_ACTIVATED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_DEACTIVATED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_DISABLED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_ENABLED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_UNKNOWN; import static android.app.NotificationManager.INTERRUPTION_FILTER_ALARMS; import static android.app.NotificationManager.INTERRUPTION_FILTER_ALL; import static android.app.NotificationManager.INTERRUPTION_FILTER_NONE; Loading Loading @@ -108,6 +109,7 @@ import android.app.AutomaticZenRule; import android.app.Flags; import android.app.NotificationManager; import android.app.NotificationManager.Policy; import android.app.compat.CompatChanges; import android.content.ComponentName; import android.content.ContentResolver; import android.content.pm.ActivityInfo; Loading Loading @@ -4674,7 +4676,11 @@ public class ZenModeHelperTest extends UiServiceTestCase { UPDATE_ORIGIN_SYSTEM_OR_SYSTEMUI, Process.SYSTEM_UID); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); if (CompatChanges.isChangeEnabled(ZenModeHelper.SEND_ACTIVATION_AZR_STATUSES)) { assertEquals(AUTOMATIC_RULE_STATUS_ACTIVATED, actualStatus[0]); } else { assertEquals(AUTOMATIC_RULE_STATUS_UNKNOWN, actualStatus[0]); } } @Test Loading Loading @@ -4715,7 +4721,11 @@ public class ZenModeHelperTest extends UiServiceTestCase { null, "", Process.SYSTEM_UID); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); if (CompatChanges.isChangeEnabled(ZenModeHelper.SEND_ACTIVATION_AZR_STATUSES)) { assertEquals(AUTOMATIC_RULE_STATUS_DEACTIVATED, actualStatus[1]); } else { assertEquals(AUTOMATIC_RULE_STATUS_UNKNOWN, actualStatus[1]); } } @Test Loading Loading @@ -4754,10 +4764,14 @@ public class ZenModeHelperTest extends UiServiceTestCase { mZenModeHelper.setAutomaticZenRuleState(createdId, new Condition(zenRule.getConditionId(), "", STATE_FALSE), UPDATE_ORIGIN_SYSTEM_OR_SYSTEMUI, Process.SYSTEM_UID); UPDATE_ORIGIN_APP, Process.SYSTEM_UID); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); if (CompatChanges.isChangeEnabled(ZenModeHelper.SEND_ACTIVATION_AZR_STATUSES)) { assertEquals(AUTOMATIC_RULE_STATUS_DEACTIVATED, actualStatus[1]); } else { assertEquals(AUTOMATIC_RULE_STATUS_UNKNOWN, actualStatus[1]); } } @Test Loading Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -14334,6 +14334,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Test @EnableFlags(android.app.Flags.FLAG_MODES_API) @EnableCompatChanges(NotificationManagerService.MANAGE_GLOBAL_ZEN_VIA_IMPLICIT_RULES) public void requestInterruptionFilterFromListener_fromApp_doesNotSetGlobalZen() throws Exception { mService.setCallerIsNormalPackage(); Loading @@ -14351,6 +14352,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Test @EnableFlags(android.app.Flags.FLAG_MODES_API) @EnableCompatChanges(NotificationManagerService.MANAGE_GLOBAL_ZEN_VIA_IMPLICIT_RULES) public void requestInterruptionFilterFromListener_fromSystem_setsGlobalZen() throws Exception { mService.isSystemUid = true;
services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java +18 −4 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_ACTIVATED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_DEACTIVATED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_DISABLED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_ENABLED; import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_UNKNOWN; import static android.app.NotificationManager.INTERRUPTION_FILTER_ALARMS; import static android.app.NotificationManager.INTERRUPTION_FILTER_ALL; import static android.app.NotificationManager.INTERRUPTION_FILTER_NONE; Loading Loading @@ -108,6 +109,7 @@ import android.app.AutomaticZenRule; import android.app.Flags; import android.app.NotificationManager; import android.app.NotificationManager.Policy; import android.app.compat.CompatChanges; import android.content.ComponentName; import android.content.ContentResolver; import android.content.pm.ActivityInfo; Loading Loading @@ -4674,7 +4676,11 @@ public class ZenModeHelperTest extends UiServiceTestCase { UPDATE_ORIGIN_SYSTEM_OR_SYSTEMUI, Process.SYSTEM_UID); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); if (CompatChanges.isChangeEnabled(ZenModeHelper.SEND_ACTIVATION_AZR_STATUSES)) { assertEquals(AUTOMATIC_RULE_STATUS_ACTIVATED, actualStatus[0]); } else { assertEquals(AUTOMATIC_RULE_STATUS_UNKNOWN, actualStatus[0]); } } @Test Loading Loading @@ -4715,7 +4721,11 @@ public class ZenModeHelperTest extends UiServiceTestCase { null, "", Process.SYSTEM_UID); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); if (CompatChanges.isChangeEnabled(ZenModeHelper.SEND_ACTIVATION_AZR_STATUSES)) { assertEquals(AUTOMATIC_RULE_STATUS_DEACTIVATED, actualStatus[1]); } else { assertEquals(AUTOMATIC_RULE_STATUS_UNKNOWN, actualStatus[1]); } } @Test Loading Loading @@ -4754,10 +4764,14 @@ public class ZenModeHelperTest extends UiServiceTestCase { mZenModeHelper.setAutomaticZenRuleState(createdId, new Condition(zenRule.getConditionId(), "", STATE_FALSE), UPDATE_ORIGIN_SYSTEM_OR_SYSTEMUI, Process.SYSTEM_UID); UPDATE_ORIGIN_APP, Process.SYSTEM_UID); assertTrue(latch.await(500, TimeUnit.MILLISECONDS)); if (CompatChanges.isChangeEnabled(ZenModeHelper.SEND_ACTIVATION_AZR_STATUSES)) { assertEquals(AUTOMATIC_RULE_STATUS_DEACTIVATED, actualStatus[1]); } else { assertEquals(AUTOMATIC_RULE_STATUS_UNKNOWN, actualStatus[1]); } } @Test Loading