diff options
author | Christopher Tate <ctate@google.com> | 2011-08-16 17:03:24 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-16 17:03:24 -0700 |
commit | 755bd67a5081727ae1bbee2d39863b464a8b4f35 (patch) | |
tree | b5ef3bdea69aabb912d7b00aa6986b7784586cec /services/input | |
parent | 751b85e8c3b5ff07eaaa6bdbd32517dcdc8f27aa (diff) | |
parent | d9be36c897680361da2daadba9bbc9da3c16329b (diff) | |
download | frameworks_base-755bd67a5081727ae1bbee2d39863b464a8b4f35.zip frameworks_base-755bd67a5081727ae1bbee2d39863b464a8b4f35.tar.gz frameworks_base-755bd67a5081727ae1bbee2d39863b464a8b4f35.tar.bz2 |
Merge "Don't crash if a drag recipient throws an uncaught exception"
Diffstat (limited to 'services/input')
-rw-r--r-- | services/input/InputDispatcher.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp index cbdfe8c..3cd3ac3 100644 --- a/services/input/InputDispatcher.cpp +++ b/services/input/InputDispatcher.cpp @@ -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--); } } |