diff --git a/packages/SystemUI/res/layout/remote_input.xml b/packages/SystemUI/res/layout/remote_input.xml index e4ea08edbc899..b5d48b4636a89 100644 --- a/packages/SystemUI/res/layout/remote_input.xml +++ b/packages/SystemUI/res/layout/remote_input.xml @@ -51,12 +51,10 @@ = inputStart) { + ev.offsetLocation(0, -inputStart); + return riv.dispatchTouchEvent(ev); + } + } + return super.dispatchTouchEvent(ev); + } + + /** + * Overridden to make sure touches to the reply action bar actually go through to this view + */ + @Override + public boolean pointInView(float localX, float localY, float slop) { + float top = mClipTopAmount; + float bottom = mUnrestrictedContentHeight; + return localX >= -slop && localY >= top - slop && localX < ((mRight - mLeft) + slop) && + localY < (bottom + slop); + } + + private RemoteInputView getRemoteInputForView(View child) { + if (child == mExpandedChild) { + return mExpandedRemoteInput; + } else if (child == mHeadsUpChild) { + return mHeadsUpRemoteInput; + } + return null; + } + public int getExpandHeight() { int viewType = VISIBLE_TYPE_EXPANDED; if (mExpandedChild == null) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 9c5cf3069eefa..aa9bbe08dd6ff 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -4998,6 +4998,14 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void onNotificationClicked(StatusBarNotification sbn, ExpandableNotificationRow row) { + RemoteInputController controller = mRemoteInputManager.getController(); + if (controller.isRemoteInputActive(row.getEntry()) + && !TextUtils.isEmpty(row.getActiveRemoteInputText())) { + // We have an active remote input typed and the user clicked on the notification. + // this was probably unintentional, so we're closing the edit text instead. + controller.closeRemoteInputs(); + return; + } Notification notification = sbn.getNotification(); final PendingIntent intent = notification.contentIntent != null ? notification.contentIntent @@ -5061,12 +5069,7 @@ public class StatusBar extends SystemUI implements DemoMode, Intent fillInIntent = null; Entry entry = row.getEntry(); CharSequence remoteInputText = null; - RemoteInputController controller = mRemoteInputManager.getController(); - if (controller.isRemoteInputActive(entry)) { - remoteInputText = row.getActiveRemoteInputText(); - } - if (TextUtils.isEmpty(remoteInputText) - && !TextUtils.isEmpty(entry.remoteInputText)) { + if (!TextUtils.isEmpty(entry.remoteInputText)) { remoteInputText = entry.remoteInputText; } if (!TextUtils.isEmpty(remoteInputText)