From 80a752c5373cfa906568302c831710b5c22a8155 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Fri, 8 Oct 2010 17:57:18 -0400 Subject: Allow notifications to not specify a contentIntent. If they don't, the click events will be passed through to the individual views in the notification view, which may have their own PendingIntents attached. Previously, it was against the UX spec to allow this, but now we are changing that and will have buttons in there. Change-Id: Ie3b2e96c6a1c4449fa86ed571f3ad0f047320d31 --- .../android/statusbartest/NotificationTestList.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/StatusBar') diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index e30cf4a..9c267d6 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -86,6 +86,18 @@ public class NotificationTestList extends TestActivity } }, + new Test("custom intent on text view") { + public void run() { + Notification n = new Notification(R.drawable.icon1, null, + mActivityCreateTime); + n.setLatestEventInfo(NotificationTestList.this, "Persistent #1", + "This is a notification!!!", null); + n.contentView.setOnClickPendingIntent(com.android.internal.R.id.text, + makeIntent2()); + mNM.notify(1, n); + } + }, + new Test("Ticker 1 line") { public void run() { Notification n = new Notification(R.drawable.icon1, "tick tick tick", @@ -776,6 +788,12 @@ public class NotificationTestList extends TestActivity return PendingIntent.getActivity(this, 0, intent, 0); } + private PendingIntent makeIntent2() { + Intent intent = new Intent(this, StatusBarTest.class); + return PendingIntent.getActivity(this, 0, intent, 0); + } + + class StateStress extends Test { StateStress(String name, int pause, int iterations, Runnable[] tasks) { super(name); -- cgit v1.1