From 4058ba052682129f2d1055116aaffb2e91c2013d Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Sun, 31 Oct 2010 11:38:04 -0700 Subject: [PATCH] Allow both contentIntent and setOnClickPendingIntent in notifications From the app developer's request: Intents assigned to specific views should take precedence over the content intent, but it should not be required to set the content intent to null in order for the view-intents to work Bug: 3107945 Change-Id: Ic5282d441277a9a8c8c700ef3f43872f3405b58a --- .../systemui/statusbar/LatestItemView.java | 11 ---------- .../res/layout/button_notification.xml | 21 +++++++++++++++++++ .../statusbartest/NotificationTestList.java | 13 ++++++++++++ 3 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 tests/StatusBar/res/layout/button_notification.xml diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java index 2f94af61e3771..64ec0633810c3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java @@ -23,22 +23,11 @@ import android.view.MotionEvent; import android.widget.FrameLayout; public class LatestItemView extends FrameLayout { - private boolean mDispatchTorches; - public LatestItemView(Context context, AttributeSet attrs) { super(context, attrs); } - public boolean dispatchTouchEvent(MotionEvent ev) { - if (mDispatchTorches) { - return super.dispatchTouchEvent(ev); - } else { - return onTouchEvent(ev); - } - } - public void setOnClickListener(OnClickListener l) { - mDispatchTorches = l == null; super.setOnClickListener(l); } } diff --git a/tests/StatusBar/res/layout/button_notification.xml b/tests/StatusBar/res/layout/button_notification.xml new file mode 100644 index 0000000000000..822e8cd3b4ee7 --- /dev/null +++ b/tests/StatusBar/res/layout/button_notification.xml @@ -0,0 +1,21 @@ + + + + +