diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index 0fdd99fe7f58d..782607cc3aef0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -252,6 +252,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene findScrollContainer(); if (mScrollContainer != null) { mScrollContainer.requestDisallowLongPress(); + mScrollContainer.requestDisallowDismiss(); } } return super.onInterceptTouchEvent(ev); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 9603e81c1e5db..0a4dce8b1f227 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -232,6 +232,7 @@ public class NotificationStackScrollLayout extends ViewGroup * animating. */ private boolean mOnlyScrollingInThisMotion; + private boolean mDisallowDismissInThisMotion; private boolean mInterceptDelegateEnabled; private boolean mDelegateToScrollView; private boolean mDisallowScrollingInThisMotion; @@ -1031,7 +1032,8 @@ public class NotificationStackScrollLayout extends ViewGroup if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion - && !mOnlyScrollingInThisMotion) { + && !mOnlyScrollingInThisMotion + && !mDisallowDismissInThisMotion) { horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev); } return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || super.onTouchEvent(ev); @@ -2013,7 +2015,8 @@ public class NotificationStackScrollLayout extends ViewGroup if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion - && !mOnlyScrollingInThisMotion) { + && !mOnlyScrollingInThisMotion + && !mDisallowDismissInThisMotion) { swipeWantsIt = mSwipeHelper.onInterceptTouchEvent(ev); } return swipeWantsIt || scrollWantsIt || expandWantsIt || super.onInterceptTouchEvent(ev); @@ -2041,6 +2044,7 @@ public class NotificationStackScrollLayout extends ViewGroup mExpandedInThisMotion = false; mOnlyScrollingInThisMotion = !mScroller.isFinished(); mDisallowScrollingInThisMotion = false; + mDisallowDismissInThisMotion = false; mTouchIsClick = true; mInitialTouchX = ev.getX(); mInitialTouchY = ev.getY(); @@ -2705,6 +2709,11 @@ public class NotificationStackScrollLayout extends ViewGroup removeLongPressCallback(); } + @Override + public void requestDisallowDismiss() { + mDisallowDismissInThisMotion = true; + } + public void removeLongPressCallback() { mSwipeHelper.removeLongPressCallback(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/ScrollContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/ScrollContainer.java index a35465e850752..64efa697de71c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/ScrollContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/ScrollContainer.java @@ -33,4 +33,9 @@ public interface ScrollContainer { * Request that the view is made visible by scrolling to it. */ void scrollTo(View v); + + /** + * Request that the view does not dismiss for the current touch. + */ + void requestDisallowDismiss(); }