diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 9436633c0c4b4..73e0e4b2eb8b4 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -1301,7 +1301,7 @@ public abstract class Window { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public boolean shouldCloseOnTouch(Context context, MotionEvent event) { final boolean isOutside = - event.getAction() == MotionEvent.ACTION_DOWN && isOutOfBounds(context, event) + event.getAction() == MotionEvent.ACTION_UP && isOutOfBounds(context, event) || event.getAction() == MotionEvent.ACTION_OUTSIDE; if (mCloseOnTouchOutside && peekDecorView() != null && isOutside) { return true;