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

Commit 755bd67a authored by Christopher Tate's avatar Christopher Tate Committed by Android (Google) Code Review
Browse files

Merge "Don't crash if a drag recipient throws an uncaught exception"

parents 751b85e8 d9be36c8
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -3196,11 +3196,13 @@ void InputDispatcher::setInputWindows(const Vector<sp<InputWindowHandle> >& inpu
                LOGD("Focus left window: %s",
                        mFocusedWindowHandle->name.string());
#endif
                if (mFocusedWindowHandle->inputChannel != NULL) {
                    CancelationOptions options(CancelationOptions::CANCEL_NON_POINTER_EVENTS,
                            "focus left window");
                    synthesizeCancelationEventsForInputChannelLocked(
                            mFocusedWindowHandle->inputChannel, options);
                }
            }
            if (newFocusedWindowHandle != NULL) {
#if DEBUG_FOCUS
                LOGD("Focus entered window: %s",
@@ -3216,10 +3218,12 @@ void InputDispatcher::setInputWindows(const Vector<sp<InputWindowHandle> >& inpu
#if DEBUG_FOCUS
                LOGD("Touched window was removed: %s", touchedWindow.windowHandle->name.string());
#endif
                if (touchedWindow.windowHandle->inputChannel != NULL) {
                    CancelationOptions options(CancelationOptions::CANCEL_POINTER_EVENTS,
                            "touched window was removed");
                    synthesizeCancelationEventsForInputChannelLocked(
                            touchedWindow.windowHandle->inputChannel, options);
                }
                mTouchState.windows.removeAt(i--);
            }
        }
+4 −2
Original line number Diff line number Diff line
@@ -6573,9 +6573,11 @@ public class WindowManagerService extends IWindowManager.Stub
                    }
                    synchronized (mWindowMap) {
                        // !!! TODO: ANR the drag-receiving app
                        if (mDragState != null) {
                            mDragState.mDragResult = false;
                            mDragState.endDragLw();
                        }
                    }
                    break;
                }