summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-10-08 17:57:18 -0400
committerMarco Nelissen <marcone@google.com>2010-10-13 17:29:26 -0700
commit184498ce5a8d77e1d9c45693363829daaeef9611 (patch)
treeb5508f851174110267189ede8cf551f771a57be1 /packages/SystemUI
parent5d794412e3e429e47404395badcd11b0b8639e8b (diff)
downloadframeworks_base-184498ce5a8d77e1d9c45693363829daaeef9611.zip
frameworks_base-184498ce5a8d77e1d9c45693363829daaeef9611.tar.gz
frameworks_base-184498ce5a8d77e1d9c45693363829daaeef9611.tar.bz2
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: I674234212f64b2b8802a0708b7eed0614e147ca3
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java4
3 files changed, 19 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java
index 1e89624..2f94af6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LatestItemView.java
@@ -23,12 +23,22 @@ 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) {
- return onTouchEvent(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/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java
index 9fbfc64..fc7b534 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java
@@ -440,6 +440,8 @@ public class PhoneStatusBarService extends StatusBarService {
if (contentIntent != null) {
oldEntry.content.setOnClickListener(new Launcher(contentIntent,
notification.pkg, notification.tag, notification.id));
+ } else {
+ oldEntry.content.setOnClickListener(null);
}
// Update the icon.
final StatusBarIcon ic = new StatusBarIcon(notification.pkg,
@@ -516,6 +518,8 @@ public class PhoneStatusBarService extends StatusBarService {
if (contentIntent != null) {
content.setOnClickListener(new Launcher(contentIntent, notification.pkg,
notification.tag, notification.id));
+ } else {
+ content.setOnClickListener(null);
}
View expanded = null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
index 69e9a94..340e269 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
@@ -372,6 +372,8 @@ public class TabletStatusBarService extends StatusBarService {
if (contentIntent != null) {
oldEntry.content.setOnClickListener(new NotificationClicker(contentIntent,
notification.pkg, notification.tag, notification.id));
+ } else {
+ oldEntry.content.setOnClickListener(null);
}
// Update the icon.
final StatusBarIcon ic = new StatusBarIcon(notification.pkg,
@@ -771,6 +773,8 @@ public class TabletStatusBarService extends StatusBarService {
if (contentIntent != null) {
content.setOnClickListener(new NotificationClicker(contentIntent,
sbn.pkg, sbn.tag, sbn.id));
+ } else {
+ content.setOnClickListener(null);
}
View expanded = null;