Loading services/inputflinger/dispatcher/InputDispatcher.cpp +37 −33 Original line number Diff line number Diff line Loading @@ -5918,14 +5918,16 @@ status_t InputDispatcher::pilferPointers(const sp<IBinder>& token) { status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) { const std::shared_ptr<InputChannel> requestingChannel = getInputChannelLocked(token); if (!requestingChannel) { ALOGW("Attempted to pilfer pointers from an un-registered channel or invalid token"); LOG(WARNING) << "Attempted to pilfer pointers from an un-registered channel or invalid token"; return BAD_VALUE; } auto [statePtr, windowPtr, displayId] = findTouchStateWindowAndDisplayLocked(token); if (statePtr == nullptr || windowPtr == nullptr) { ALOGW("Attempted to pilfer points from a channel without any on-going pointer streams." " Ignoring."); LOG(WARNING) << "Attempted to pilfer points from a channel without any on-going pointer streams." " Ignoring."; return BAD_VALUE; } std::set<int32_t> deviceIds = windowPtr->getTouchingDeviceIds(); Loading @@ -5934,8 +5936,8 @@ status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) { << " in window: " << windowPtr->dump(); return BAD_VALUE; } const int32_t deviceId = *deviceIds.begin(); for (const DeviceId deviceId : deviceIds) { TouchState& state = *statePtr; TouchedWindow& window = *windowPtr; // Send cancel events to all the input channels we're stealing from. Loading @@ -5956,14 +5958,16 @@ status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) { } } canceledWindows += canceledWindows.empty() ? "[]" : "]"; ALOGI("Channel %s is stealing touch from %s", requestingChannel->getName().c_str(), canceledWindows.c_str()); LOG(INFO) << "Channel " << requestingChannel->getName() << " is stealing input gesture for device " << deviceId << " from " << canceledWindows; // Prevent the gesture from being sent to any other windows. // This only blocks relevant pointers to be sent to other windows window.addPilferingPointers(deviceId, pointerIds); state.cancelPointersForWindowsExcept(deviceId, pointerIds, token); } return OK; } Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +37 −33 Original line number Diff line number Diff line Loading @@ -5918,14 +5918,16 @@ status_t InputDispatcher::pilferPointers(const sp<IBinder>& token) { status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) { const std::shared_ptr<InputChannel> requestingChannel = getInputChannelLocked(token); if (!requestingChannel) { ALOGW("Attempted to pilfer pointers from an un-registered channel or invalid token"); LOG(WARNING) << "Attempted to pilfer pointers from an un-registered channel or invalid token"; return BAD_VALUE; } auto [statePtr, windowPtr, displayId] = findTouchStateWindowAndDisplayLocked(token); if (statePtr == nullptr || windowPtr == nullptr) { ALOGW("Attempted to pilfer points from a channel without any on-going pointer streams." " Ignoring."); LOG(WARNING) << "Attempted to pilfer points from a channel without any on-going pointer streams." " Ignoring."; return BAD_VALUE; } std::set<int32_t> deviceIds = windowPtr->getTouchingDeviceIds(); Loading @@ -5934,8 +5936,8 @@ status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) { << " in window: " << windowPtr->dump(); return BAD_VALUE; } const int32_t deviceId = *deviceIds.begin(); for (const DeviceId deviceId : deviceIds) { TouchState& state = *statePtr; TouchedWindow& window = *windowPtr; // Send cancel events to all the input channels we're stealing from. Loading @@ -5956,14 +5958,16 @@ status_t InputDispatcher::pilferPointersLocked(const sp<IBinder>& token) { } } canceledWindows += canceledWindows.empty() ? "[]" : "]"; ALOGI("Channel %s is stealing touch from %s", requestingChannel->getName().c_str(), canceledWindows.c_str()); LOG(INFO) << "Channel " << requestingChannel->getName() << " is stealing input gesture for device " << deviceId << " from " << canceledWindows; // Prevent the gesture from being sent to any other windows. // This only blocks relevant pointers to be sent to other windows window.addPilferingPointers(deviceId, pointerIds); state.cancelPointersForWindowsExcept(deviceId, pointerIds, token); } return OK; } Loading