summaryrefslogtreecommitdiff
path: root/tests/StatusBar/src
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2017-06-23 16:13:20 -0400
committerJulia Reynolds <juliacr@google.com>2017-06-27 13:21:47 -0400
commitaf4dc2834c8882d4ccecb3c50a45d42aeb361b04 (patch)
treed839fd17ef6ea17ccee52bd0882efd6643836882 /tests/StatusBar/src
parent9f8409338697b52389b7e8bd0f2bcb7ea49ba667 (diff)
Limit when a ranking reconsidering can alert
Otherwise notifications that were silenced by DND that still exist when DND is turned off can re-alert. Test: StatusBarTest, "with zen". No alerts should happen within ~10 seconds of starting the test Change-Id: I9e58118c0a40e0d4f1bafb0913e569b560879ba2 Fixes: 62355996
Diffstat (limited to 'tests/StatusBar/src')
-rw-r--r--tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
index 5dd42dd21c90..fc68183b5970 100644
--- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
+++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
@@ -129,6 +129,42 @@ public class NotificationTestList extends TestActivity
mNM.notify(7001, n);
}
},
+ new Test("with zen") {
+ public void run()
+ {
+ mNM.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALARMS);
+ Notification n = new Notification.Builder(NotificationTestList.this,
+ "default")
+ .setSmallIcon(R.drawable.icon2)
+ .setContentTitle("Default priority")
+ .build();
+ mNM.notify("default", 7004, n);
+ try {
+ Thread.sleep(8000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ mNM.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_ALL);
+ }
+ },
+ new Test("repeated") {
+ public void run()
+ {
+ for (int i = 0; i < 50; i++) {
+ Notification n = new Notification.Builder(NotificationTestList.this,
+ "default")
+ .setSmallIcon(R.drawable.icon2)
+ .setContentTitle("Default priority")
+ .build();
+ mNM.notify("default", 7004, n);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ },
new Test("Post a group") {
public void run()
{