diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index e8ddc41ee68c3..96d44a5215b02 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -4177,7 +4177,7 @@ public class Notification implements Parcelable } RemoteViews header = makeNotificationHeader(); - + header.setBoolean(R.id.notification_header, "setAcceptAllTouches", true); if (summary != null) { mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary); } else { diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index c3d3f3918ccf4..16d46666732de 100644 --- a/core/java/android/view/NotificationHeaderView.java +++ b/core/java/android/view/NotificationHeaderView.java @@ -94,6 +94,7 @@ public class NotificationHeaderView extends ViewGroup { } } }; + private boolean mAcceptAllTouches; public NotificationHeaderView(Context context) { this(context, null); @@ -374,6 +375,8 @@ public class NotificationHeaderView extends ViewGroup { case MotionEvent.ACTION_DOWN: mTrackGesture = false; if (isInside(x, y)) { + mDownX = x; + mDownY = y; mTrackGesture = true; return true; } @@ -396,11 +399,12 @@ public class NotificationHeaderView extends ViewGroup { } private boolean isInside(float x, float y) { + if (mAcceptAllTouches) { + return true; + } for (int i = 0; i < mTouchRects.size(); i++) { Rect r = mTouchRects.get(i); if (r.contains((int) x, (int) y)) { - mDownX = x; - mDownY = y; return true; } } @@ -433,4 +437,9 @@ public class NotificationHeaderView extends ViewGroup { } return mTouchListener.isInside(x, y); } + + @RemotableViewMethod + public void setAcceptAllTouches(boolean acceptAllTouches) { + mAcceptAllTouches = acceptAllTouches; + } }