From 9550f2e75c0c2f4ac0ac25b6796b68da403d418b Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Tue, 23 Aug 2016 18:23:01 +0200 Subject: [PATCH] DirectReply: Fix bugs when replying from HUNs Fixes a bug that would re-open the remote input when it was sent while HUN'd. Also fixes a bug that would not properly clear a notification if swiped away and at the same time HUN'd and having a reply active. Change-Id: I3e8b5f81eaffd8e4b8602f3dbdd025229ba201fa Fixes: 30454772 --- .../com/android/systemui/statusbar/phone/PhoneStatusBar.java | 4 +++- .../android/systemui/statusbar/policy/RemoteInputView.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 516de4603af5d..98be3fe5c7a64 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1553,7 +1553,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } Entry entry = mNotificationData.get(key); - if (entry != null && mRemoteInputController.isRemoteInputActive(entry)) { + if (entry != null && mRemoteInputController.isRemoteInputActive(entry) + && (entry.row != null && !entry.row.isDismissed())) { mLatestRankingMap = ranking; mRemoteInputEntriesToRemoveOnCollapse.add(entry); return; @@ -2461,6 +2462,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStatusBarWindowManager.setHeadsUpShowing(false); mHeadsUpManager.setHeadsUpGoingAway(false); } + removeRemoteInputEntriesKeptUntilCollapsed(); } }); } 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 29577ef13874d..cdd452fe300d0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -348,7 +348,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } public boolean isActive() { - return mEditText.isFocused(); + return mEditText.isFocused() && mEditText.isEnabled(); } public void stealFocusFrom(RemoteInputView other) {