DirectReply: Close if touching outside status bar
Close direct reply when a touch outside the status bar window happens. This is especially important with HUNs, where we allow the touch to go through to the underlying window. Change-Id: I12b9cbd5c699b86bcf1f56723a2f0ac5de7e5a42 Test: Receive SMS while unlocked, click Reply on heads-up notification, click in between notification and IME. Verify direct reply closes. Fixes: 32022071
This commit is contained in:
@@ -745,6 +745,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
checkUserAutohide(v, event);
|
||||
checkRemoteInputOutside(event);
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
if (mExpandedVisible) {
|
||||
animateCollapsePanels();
|
||||
@@ -3203,6 +3204,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
}
|
||||
|
||||
private void checkRemoteInputOutside(MotionEvent event) {
|
||||
if (event.getAction() == MotionEvent.ACTION_OUTSIDE // touch outside the source bar
|
||||
&& event.getX() == 0 && event.getY() == 0 // a touch outside both bars
|
||||
&& mRemoteInputController.isRemoteInputActive()) {
|
||||
mRemoteInputController.closeRemoteInputs();
|
||||
}
|
||||
}
|
||||
|
||||
private void userAutohide() {
|
||||
cancelAutohide();
|
||||
mHandler.postDelayed(mAutohide, 350); // longer than app gesture -> flag clear
|
||||
|
||||
Reference in New Issue
Block a user