Merge "Don't crash if a drag recipient throws an uncaught exception"
This commit is contained in:
committed by
Android (Google) Code Review
commit
755bd67a50
@@ -3196,10 +3196,12 @@ void InputDispatcher::setInputWindows(const Vector<sp<InputWindowHandle> >& inpu
|
||||
LOGD("Focus left window: %s",
|
||||
mFocusedWindowHandle->name.string());
|
||||
#endif
|
||||
CancelationOptions options(CancelationOptions::CANCEL_NON_POINTER_EVENTS,
|
||||
"focus left window");
|
||||
synthesizeCancelationEventsForInputChannelLocked(
|
||||
mFocusedWindowHandle->inputChannel, options);
|
||||
if (mFocusedWindowHandle->inputChannel != NULL) {
|
||||
CancelationOptions options(CancelationOptions::CANCEL_NON_POINTER_EVENTS,
|
||||
"focus left window");
|
||||
synthesizeCancelationEventsForInputChannelLocked(
|
||||
mFocusedWindowHandle->inputChannel, options);
|
||||
}
|
||||
}
|
||||
if (newFocusedWindowHandle != NULL) {
|
||||
#if DEBUG_FOCUS
|
||||
@@ -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
|
||||
CancelationOptions options(CancelationOptions::CANCEL_POINTER_EVENTS,
|
||||
"touched window was removed");
|
||||
synthesizeCancelationEventsForInputChannelLocked(
|
||||
touchedWindow.windowHandle->inputChannel, options);
|
||||
if (touchedWindow.windowHandle->inputChannel != NULL) {
|
||||
CancelationOptions options(CancelationOptions::CANCEL_POINTER_EVENTS,
|
||||
"touched window was removed");
|
||||
synthesizeCancelationEventsForInputChannelLocked(
|
||||
touchedWindow.windowHandle->inputChannel, options);
|
||||
}
|
||||
mTouchState.windows.removeAt(i--);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6573,8 +6573,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
}
|
||||
synchronized (mWindowMap) {
|
||||
// !!! TODO: ANR the drag-receiving app
|
||||
mDragState.mDragResult = false;
|
||||
mDragState.endDragLw();
|
||||
if (mDragState != null) {
|
||||
mDragState.mDragResult = false;
|
||||
mDragState.endDragLw();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user