diff options
author | Julia Reynolds <juliacr@google.com> | 2017-06-23 16:13:20 -0400 |
---|---|---|
committer | Julia Reynolds <juliacr@google.com> | 2017-06-27 13:21:47 -0400 |
commit | af4dc2834c8882d4ccecb3c50a45d42aeb361b04 (patch) | |
tree | d839fd17ef6ea17ccee52bd0882efd6643836882 /tests | |
parent | 9f8409338697b52389b7e8bd0f2bcb7ea49ba667 (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')
-rw-r--r-- | tests/StatusBar/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/StatusBar/AndroidManifest.xml b/tests/StatusBar/AndroidManifest.xml index 81442bfc60a4..6a082e990dab 100644 --- a/tests/StatusBar/AndroidManifest.xml +++ b/tests/StatusBar/AndroidManifest.xml @@ -6,6 +6,7 @@ <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" /> + <uses-permission android:name="android.permission.MANAGE_NOTIFICATIONS" /> <application> <activity android:name="StatusBarTest" android:label="_StatusBar"> 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() { |