Loading include/input/Input.h +8 −4 Original line number Diff line number Diff line Loading @@ -524,13 +524,17 @@ public: inline int32_t getAction() const { return mAction; } inline int32_t getActionMasked() const { return mAction & AMOTION_EVENT_ACTION_MASK; } static int32_t getActionMasked(int32_t action) { return action & AMOTION_EVENT_ACTION_MASK; } inline int32_t getActionIndex() const { return (mAction & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; inline int32_t getActionMasked() const { return getActionMasked(mAction); } static int32_t getActionIndex(int32_t action) { return (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; } inline int32_t getActionIndex() const { return getActionIndex(mAction); } inline void setAction(int32_t action) { mAction = action; } inline int32_t getFlags() const { return mFlags; } Loading libs/input/Input.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -834,9 +834,9 @@ std::string MotionEvent::actionToString(int32_t action) { case AMOTION_EVENT_ACTION_OUTSIDE: return "OUTSIDE"; case AMOTION_EVENT_ACTION_POINTER_DOWN: return "POINTER_DOWN"; return StringPrintf("POINTER_DOWN(%" PRId32 ")", MotionEvent::getActionIndex(action)); case AMOTION_EVENT_ACTION_POINTER_UP: return "POINTER_UP"; return StringPrintf("POINTER_UP(%" PRId32 ")", MotionEvent::getActionIndex(action)); case AMOTION_EVENT_ACTION_HOVER_MOVE: return "HOVER_MOVE"; case AMOTION_EVENT_ACTION_SCROLL: Loading services/inputflinger/dispatcher/InputDispatcher.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -1706,13 +1706,13 @@ void InputDispatcher::logOutboundMotionDetails(const char* prefix, const MotionE if (DEBUG_OUTBOUND_EVENT_DETAILS) { ALOGD("%seventTime=%" PRId64 ", deviceId=%d, source=0x%x, displayId=%" PRId32 ", policyFlags=0x%x, " "action=0x%x, actionButton=0x%x, flags=0x%x, " "action=%s, actionButton=0x%x, flags=0x%x, " "metaState=0x%x, buttonState=0x%x," "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%" PRId64, prefix, entry.eventTime, entry.deviceId, entry.source, entry.displayId, entry.policyFlags, entry.action, entry.actionButton, entry.flags, entry.metaState, entry.buttonState, entry.edgeFlags, entry.xPrecision, entry.yPrecision, entry.downTime); entry.policyFlags, MotionEvent::actionToString(entry.action).c_str(), entry.actionButton, entry.flags, entry.metaState, entry.buttonState, entry.edgeFlags, entry.xPrecision, entry.yPrecision, entry.downTime); for (uint32_t i = 0; i < entry.pointerCount; i++) { ALOGD(" Pointer %d: id=%d, toolType=%d, " Loading Loading @@ -4642,6 +4642,18 @@ void InputDispatcher::setInputWindowsLocked( CancelationOptions options(CancelationOptions::CANCEL_POINTER_EVENTS, "touched window was removed"); synthesizeCancelationEventsForInputChannelLocked(touchedInputChannel, options); // Since we are about to drop the touch, cancel the events for the wallpaper as // well. if (touchedWindow.targetFlags & InputTarget::FLAG_FOREGROUND && touchedWindow.windowHandle->getInfo()->hasWallpaper) { sp<WindowInfoHandle> wallpaper = state.getWallpaperWindow(); if (wallpaper != nullptr) { sp<Connection> wallpaperConnection = getConnectionLocked(wallpaper->getToken()); synthesizeCancelationEventsForConnectionLocked(wallpaperConnection, options); } } } state.windows.erase(state.windows.begin() + i); } else { Loading services/inputflinger/dispatcher/TouchState.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -134,4 +134,14 @@ bool TouchState::isSlippery() const { return haveSlipperyForegroundWindow; } sp<WindowInfoHandle> TouchState::getWallpaperWindow() const { for (size_t i = 0; i < windows.size(); i++) { const TouchedWindow& window = windows[i]; if (window.windowHandle->getInfo()->type == WindowInfo::Type::WALLPAPER) { return window.windowHandle; } } return nullptr; } } // namespace android::inputdispatcher services/inputflinger/dispatcher/TouchState.h +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ struct TouchState { void filterNonMonitors(); sp<android::gui::WindowInfoHandle> getFirstForegroundWindowHandle() const; bool isSlippery() const; sp<android::gui::WindowInfoHandle> getWallpaperWindow() const; }; } // namespace inputdispatcher Loading Loading
include/input/Input.h +8 −4 Original line number Diff line number Diff line Loading @@ -524,13 +524,17 @@ public: inline int32_t getAction() const { return mAction; } inline int32_t getActionMasked() const { return mAction & AMOTION_EVENT_ACTION_MASK; } static int32_t getActionMasked(int32_t action) { return action & AMOTION_EVENT_ACTION_MASK; } inline int32_t getActionIndex() const { return (mAction & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; inline int32_t getActionMasked() const { return getActionMasked(mAction); } static int32_t getActionIndex(int32_t action) { return (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; } inline int32_t getActionIndex() const { return getActionIndex(mAction); } inline void setAction(int32_t action) { mAction = action; } inline int32_t getFlags() const { return mFlags; } Loading
libs/input/Input.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -834,9 +834,9 @@ std::string MotionEvent::actionToString(int32_t action) { case AMOTION_EVENT_ACTION_OUTSIDE: return "OUTSIDE"; case AMOTION_EVENT_ACTION_POINTER_DOWN: return "POINTER_DOWN"; return StringPrintf("POINTER_DOWN(%" PRId32 ")", MotionEvent::getActionIndex(action)); case AMOTION_EVENT_ACTION_POINTER_UP: return "POINTER_UP"; return StringPrintf("POINTER_UP(%" PRId32 ")", MotionEvent::getActionIndex(action)); case AMOTION_EVENT_ACTION_HOVER_MOVE: return "HOVER_MOVE"; case AMOTION_EVENT_ACTION_SCROLL: Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -1706,13 +1706,13 @@ void InputDispatcher::logOutboundMotionDetails(const char* prefix, const MotionE if (DEBUG_OUTBOUND_EVENT_DETAILS) { ALOGD("%seventTime=%" PRId64 ", deviceId=%d, source=0x%x, displayId=%" PRId32 ", policyFlags=0x%x, " "action=0x%x, actionButton=0x%x, flags=0x%x, " "action=%s, actionButton=0x%x, flags=0x%x, " "metaState=0x%x, buttonState=0x%x," "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%" PRId64, prefix, entry.eventTime, entry.deviceId, entry.source, entry.displayId, entry.policyFlags, entry.action, entry.actionButton, entry.flags, entry.metaState, entry.buttonState, entry.edgeFlags, entry.xPrecision, entry.yPrecision, entry.downTime); entry.policyFlags, MotionEvent::actionToString(entry.action).c_str(), entry.actionButton, entry.flags, entry.metaState, entry.buttonState, entry.edgeFlags, entry.xPrecision, entry.yPrecision, entry.downTime); for (uint32_t i = 0; i < entry.pointerCount; i++) { ALOGD(" Pointer %d: id=%d, toolType=%d, " Loading Loading @@ -4642,6 +4642,18 @@ void InputDispatcher::setInputWindowsLocked( CancelationOptions options(CancelationOptions::CANCEL_POINTER_EVENTS, "touched window was removed"); synthesizeCancelationEventsForInputChannelLocked(touchedInputChannel, options); // Since we are about to drop the touch, cancel the events for the wallpaper as // well. if (touchedWindow.targetFlags & InputTarget::FLAG_FOREGROUND && touchedWindow.windowHandle->getInfo()->hasWallpaper) { sp<WindowInfoHandle> wallpaper = state.getWallpaperWindow(); if (wallpaper != nullptr) { sp<Connection> wallpaperConnection = getConnectionLocked(wallpaper->getToken()); synthesizeCancelationEventsForConnectionLocked(wallpaperConnection, options); } } } state.windows.erase(state.windows.begin() + i); } else { Loading
services/inputflinger/dispatcher/TouchState.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -134,4 +134,14 @@ bool TouchState::isSlippery() const { return haveSlipperyForegroundWindow; } sp<WindowInfoHandle> TouchState::getWallpaperWindow() const { for (size_t i = 0; i < windows.size(); i++) { const TouchedWindow& window = windows[i]; if (window.windowHandle->getInfo()->type == WindowInfo::Type::WALLPAPER) { return window.windowHandle; } } return nullptr; } } // namespace android::inputdispatcher
services/inputflinger/dispatcher/TouchState.h +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ struct TouchState { void filterNonMonitors(); sp<android::gui::WindowInfoHandle> getFirstForegroundWindowHandle() const; bool isSlippery() const; sp<android::gui::WindowInfoHandle> getWallpaperWindow() const; }; } // namespace inputdispatcher Loading