Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad0b61ca authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix Dialog generating multiple onCancel()."

parents ad021da2 114405e0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ public class AlertDialog extends Dialog implements DialogInterface {
            final float x = ev.getX();
            final float y = ev.getY();

            if (mCancelable && (x < 0 || x > width || y < 0 || y > height)) {
            if (mCancelable && (x < 0 || x > width || y < 0 || y > height)
                    &&  mDecor != null && isShowing()) {
                cancel();
                return true;
            }
+1 −2
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ public class Dialog implements DialogInterface, Window.Callback,
     */
    public boolean onTouchEvent(MotionEvent event) {
        if (mCancelable && mCanceledOnTouchOutside && event.getAction() == MotionEvent.ACTION_DOWN
                && isOutOfBounds(event)) {
                && isOutOfBounds(event) && mDecor != null && mShowing) {
            cancel();
            return true;
        }
@@ -998,7 +998,6 @@ public class Dialog implements DialogInterface, Window.Callback,
     */
    public void cancel() {
        if (mCancelMessage != null) {
            
            // Obtain a new message so this dialog can be re-used
            Message.obtain(mCancelMessage).sendToTarget();
        }