diff options
author | Julia Reynolds <juliacr@google.com> | 2016-02-25 09:34:04 -0500 |
---|---|---|
committer | Julia Reynolds <juliacr@google.com> | 2016-02-26 10:54:08 -0500 |
commit | f0f629ffe44716b8d900929135142f0ebb9325f4 (patch) | |
tree | 7fe012d6a0313677a6cd916b7dc47174e615858b /tests/StatusBar | |
parent | 3070d75bf3a6a054f299872a602569f3fceee02f (diff) |
Introduce IMPORTANCE_MIN.
Allow HUNs for >= IMPORTANCE_HIGH.
Allow full screen intents for IMPORTANCE_MAX.
Bug: 22960980
Bug: 26918284
Change-Id: Id4d2b90ea2e21563dbc716db411060d826e73699
Diffstat (limited to 'tests/StatusBar')
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 9ac4dbfed65a..2a3f14340a39 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -86,6 +86,122 @@ public class NotificationTestList extends TestActivity } private Test[] mTests = new Test[] { + new Test("Min priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Min priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MIN) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7000, n); + } + }, + new Test("Min priority, high pri flag") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Min priority, high pri flag") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MIN) + .setFullScreenIntent(makeIntent2(), true) + .build(); + mNM.notify(7001, n); + } + }, + new Test("Low priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Low priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_LOW) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7002, n); + } + }, + new Test("Default priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Default priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_DEFAULT) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7004, n); + } + }, + new Test("High priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("High priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_HIGH) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7006, n); + } + }, + new Test("Max priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Max priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MAX) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7008, n); + } + }, + new Test("Max priority with delay") { + public void run() + { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + } + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Max priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MAX) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7008, n); + } + }, new Test("Off") { public void run() { PowerManager pm = (PowerManager)NotificationTestList.this.getSystemService(Context.POWER_SERVICE); |