Loading libs/gui/WindowInfo.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ bool WindowInfo::operator==(const WindowInfo& info) const { info.hasWallpaper == hasWallpaper && info.paused == paused && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && info.inputFeatures == inputFeatures && info.displayId == displayId && info.portalToDisplayId == portalToDisplayId && info.displayId == displayId && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.applicationInfo == applicationInfo; } Loading Loading @@ -116,7 +116,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeUtf8AsUtf16(packageName) ?: parcel->writeInt32(inputFeatures.get()) ?: parcel->writeInt32(displayId) ?: parcel->writeInt32(portalToDisplayId) ?: applicationInfo.writeToParcel(parcel) ?: parcel->write(touchableRegion) ?: parcel->writeBool(replaceTouchableRegionWithCrop) ?: Loading Loading @@ -180,7 +179,6 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { inputFeatures = Flags<Feature>(parcel->readInt32()); // clang-format off status = parcel->readInt32(&displayId) ?: parcel->readInt32(&portalToDisplayId) ?: applicationInfo.readFromParcel(parcel) ?: parcel->read(touchableRegion) ?: parcel->readBool(&replaceTouchableRegionWithCrop); Loading libs/gui/include/gui/WindowInfo.h +0 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,6 @@ struct WindowInfo : public Parcelable { std::string packageName; Flags<Feature> inputFeatures; int32_t displayId = ADISPLAY_ID_NONE; int32_t portalToDisplayId = ADISPLAY_ID_NONE; InputApplicationInfo applicationInfo; bool replaceTouchableRegionWithCrop = false; wp<IBinder> touchableRegionCropHandle; Loading libs/gui/tests/WindowInfo_test.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ TEST(WindowInfo, Parcelling) { i.packageName = "com.example.package"; i.inputFeatures = WindowInfo::Feature::DISABLE_USER_ACTIVITY; i.displayId = 34; i.portalToDisplayId = 2; i.replaceTouchableRegionWithCrop = true; i.touchableRegionCropHandle = touchableRegionCropHandle; i.applicationInfo.name = "ApplicationFooBar"; Loading Loading @@ -107,7 +106,6 @@ TEST(WindowInfo, Parcelling) { ASSERT_EQ(i.packageName, i2.packageName); ASSERT_EQ(i.inputFeatures, i2.inputFeatures); ASSERT_EQ(i.displayId, i2.displayId); ASSERT_EQ(i.portalToDisplayId, i2.portalToDisplayId); ASSERT_EQ(i.replaceTouchableRegionWithCrop, i2.replaceTouchableRegionWithCrop); ASSERT_EQ(i.touchableRegionCropHandle, i2.touchableRegionCropHandle); ASSERT_EQ(i.applicationInfo, i2.applicationInfo); Loading services/inputflinger/dispatcher/InputDispatcher.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -1987,7 +1987,7 @@ InputEventInjectionResult InputDispatcher::findTouchedWindowTargetsLocked( TouchState tempTouchState; if (const auto it = mTouchStatesByDisplay.find(displayId); it != mTouchStatesByDisplay.end()) { oldState = &(it->second); tempTouchState.copyFrom(*oldState); tempTouchState = *oldState; } bool isSplit = tempTouchState.split; Loading Loading @@ -5530,9 +5530,9 @@ status_t InputDispatcher::pilferPointers(const sp<IBinder>& token) { ALOGI("Channel %s is stealing touch from %s", requestingChannel->getName().c_str(), canceledWindows.c_str()); // Then clear the current touch state so we stop dispatching to them as well. state.split = false; // Prevent the gesture from being sent to any other windows. state.filterWindowsExcept(token); state.preventNewTargets = true; return OK; } Loading services/inputflinger/dispatcher/TouchState.cpp +3 −20 Original line number Diff line number Diff line Loading @@ -25,27 +25,8 @@ using android::gui::WindowInfoHandle; namespace android::inputdispatcher { TouchState::TouchState() : down(false), split(false), deviceId(-1), source(0), displayId(ADISPLAY_ID_NONE) {} TouchState::~TouchState() {} void TouchState::reset() { down = false; split = false; deviceId = -1; source = 0; displayId = ADISPLAY_ID_NONE; windows.clear(); } void TouchState::copyFrom(const TouchState& other) { down = other.down; split = other.split; deviceId = other.deviceId; source = other.source; displayId = other.displayId; windows = other.windows; *this = TouchState(); } void TouchState::addOrUpdateWindow(const sp<WindowInfoHandle>& windowHandle, int32_t targetFlags, Loading @@ -66,6 +47,8 @@ void TouchState::addOrUpdateWindow(const sp<WindowInfoHandle>& windowHandle, int } } if (preventNewTargets) return; // Don't add new TouchedWindows. TouchedWindow touchedWindow; touchedWindow.windowHandle = windowHandle; touchedWindow.targetFlags = targetFlags; Loading Loading
libs/gui/WindowInfo.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ bool WindowInfo::operator==(const WindowInfo& info) const { info.hasWallpaper == hasWallpaper && info.paused == paused && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && info.inputFeatures == inputFeatures && info.displayId == displayId && info.portalToDisplayId == portalToDisplayId && info.displayId == displayId && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.applicationInfo == applicationInfo; } Loading Loading @@ -116,7 +116,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeUtf8AsUtf16(packageName) ?: parcel->writeInt32(inputFeatures.get()) ?: parcel->writeInt32(displayId) ?: parcel->writeInt32(portalToDisplayId) ?: applicationInfo.writeToParcel(parcel) ?: parcel->write(touchableRegion) ?: parcel->writeBool(replaceTouchableRegionWithCrop) ?: Loading Loading @@ -180,7 +179,6 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { inputFeatures = Flags<Feature>(parcel->readInt32()); // clang-format off status = parcel->readInt32(&displayId) ?: parcel->readInt32(&portalToDisplayId) ?: applicationInfo.readFromParcel(parcel) ?: parcel->read(touchableRegion) ?: parcel->readBool(&replaceTouchableRegionWithCrop); Loading
libs/gui/include/gui/WindowInfo.h +0 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,6 @@ struct WindowInfo : public Parcelable { std::string packageName; Flags<Feature> inputFeatures; int32_t displayId = ADISPLAY_ID_NONE; int32_t portalToDisplayId = ADISPLAY_ID_NONE; InputApplicationInfo applicationInfo; bool replaceTouchableRegionWithCrop = false; wp<IBinder> touchableRegionCropHandle; Loading
libs/gui/tests/WindowInfo_test.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ TEST(WindowInfo, Parcelling) { i.packageName = "com.example.package"; i.inputFeatures = WindowInfo::Feature::DISABLE_USER_ACTIVITY; i.displayId = 34; i.portalToDisplayId = 2; i.replaceTouchableRegionWithCrop = true; i.touchableRegionCropHandle = touchableRegionCropHandle; i.applicationInfo.name = "ApplicationFooBar"; Loading Loading @@ -107,7 +106,6 @@ TEST(WindowInfo, Parcelling) { ASSERT_EQ(i.packageName, i2.packageName); ASSERT_EQ(i.inputFeatures, i2.inputFeatures); ASSERT_EQ(i.displayId, i2.displayId); ASSERT_EQ(i.portalToDisplayId, i2.portalToDisplayId); ASSERT_EQ(i.replaceTouchableRegionWithCrop, i2.replaceTouchableRegionWithCrop); ASSERT_EQ(i.touchableRegionCropHandle, i2.touchableRegionCropHandle); ASSERT_EQ(i.applicationInfo, i2.applicationInfo); Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -1987,7 +1987,7 @@ InputEventInjectionResult InputDispatcher::findTouchedWindowTargetsLocked( TouchState tempTouchState; if (const auto it = mTouchStatesByDisplay.find(displayId); it != mTouchStatesByDisplay.end()) { oldState = &(it->second); tempTouchState.copyFrom(*oldState); tempTouchState = *oldState; } bool isSplit = tempTouchState.split; Loading Loading @@ -5530,9 +5530,9 @@ status_t InputDispatcher::pilferPointers(const sp<IBinder>& token) { ALOGI("Channel %s is stealing touch from %s", requestingChannel->getName().c_str(), canceledWindows.c_str()); // Then clear the current touch state so we stop dispatching to them as well. state.split = false; // Prevent the gesture from being sent to any other windows. state.filterWindowsExcept(token); state.preventNewTargets = true; return OK; } Loading
services/inputflinger/dispatcher/TouchState.cpp +3 −20 Original line number Diff line number Diff line Loading @@ -25,27 +25,8 @@ using android::gui::WindowInfoHandle; namespace android::inputdispatcher { TouchState::TouchState() : down(false), split(false), deviceId(-1), source(0), displayId(ADISPLAY_ID_NONE) {} TouchState::~TouchState() {} void TouchState::reset() { down = false; split = false; deviceId = -1; source = 0; displayId = ADISPLAY_ID_NONE; windows.clear(); } void TouchState::copyFrom(const TouchState& other) { down = other.down; split = other.split; deviceId = other.deviceId; source = other.source; displayId = other.displayId; windows = other.windows; *this = TouchState(); } void TouchState::addOrUpdateWindow(const sp<WindowInfoHandle>& windowHandle, int32_t targetFlags, Loading @@ -66,6 +47,8 @@ void TouchState::addOrUpdateWindow(const sp<WindowInfoHandle>& windowHandle, int } } if (preventNewTargets) return; // Don't add new TouchedWindows. TouchedWindow touchedWindow; touchedWindow.windowHandle = windowHandle; touchedWindow.targetFlags = targetFlags; Loading