From 51e7db07902f5dc7b19f8b45cfc0f2b66764cdda Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Mon, 7 Feb 2022 06:02:57 -0800 Subject: WindowInfo: Merge InputConfig and Feature flags Merge the two flags in native code. We move the InputConfig flag defintions to AIDL since we will be using the flags in Java as part of the InputWindowHandle API next. InputFeatureFlags are now a WM-only flag, but is temporarily used by InputWindowHandle until the cleanup is completed. Bug: 216806304 Test: atest libgui_test Test: atest inputflinger_tests Change-Id: I82d6de35b30d9cd4bcaf61499216c8faf407e885 --- libs/gui/WindowInfo.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libs/gui/WindowInfo.cpp') diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp index 80bd6389a0..b02bae49d3 100644 --- a/libs/gui/WindowInfo.cpp +++ b/libs/gui/WindowInfo.cpp @@ -51,11 +51,11 @@ bool WindowInfo::supportsSplitTouch() const { } bool WindowInfo::isSpy() const { - return inputFeatures.test(Feature::SPY); + return inputConfig.test(InputConfig::SPY); } bool WindowInfo::interceptsStylus() const { - return inputFeatures.test(Feature::INTERCEPTS_STYLUS); + return inputConfig.test(InputConfig::INTERCEPTS_STYLUS); } bool WindowInfo::overlaps(const WindowInfo* other) const { @@ -73,8 +73,7 @@ bool WindowInfo::operator==(const WindowInfo& info) const { info.touchableRegion.hasSameRects(touchableRegion) && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && - info.inputFeatures == inputFeatures && info.inputConfig == inputConfig && - info.displayId == displayId && + info.inputConfig == inputConfig && info.displayId == displayId && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.applicationInfo == applicationInfo && info.layoutParamsType == layoutParamsType && info.layoutParamsFlags == layoutParamsFlags; @@ -92,7 +91,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(1); // Ensure that the size of the flags that we use is 32 bits for writing into the parcel. - static_assert(sizeof(inputFeatures) == 4u); static_assert(sizeof(inputConfig) == 4u); // clang-format off @@ -120,7 +118,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(ownerPid) ?: parcel->writeInt32(ownerUid) ?: parcel->writeUtf8AsUtf16(packageName) ?: - parcel->writeInt32(inputFeatures.get()) ?: parcel->writeInt32(inputConfig.get()) ?: parcel->writeInt32(displayId) ?: applicationInfo.writeToParcel(parcel) ?: @@ -178,7 +175,6 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { touchOcclusionMode = static_cast(touchOcclusionModeInt); - inputFeatures = Flags(parcel->readInt32()); inputConfig = Flags(parcel->readInt32()); // clang-format off status = parcel->readInt32(&displayId) ?: -- cgit v1.2.3-59-g8ed1b