Invert some InputConfig flags to simplify default behavior
Invert NOT_TOUCH_MODAL to TOUCH_MODAL, and SPLIT_TOUCH to
PREVENT_SPLITTING. Modal windows and windows that prevent splitting are
exceptional behaviors, so we make sure that these show up when
outputting flag values using ftl::Flags::string().
Bug: 216806304
Test: atest inputflinger_tests
Change-Id: I7cadcc830f06ff0c63da3b61a1a7580cb031f0c2
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d0d79e9..219c716 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2159,8 +2159,8 @@
void Layer::fillInputFrameInfo(WindowInfo& info, const ui::Transform& screenToDisplay) {
Rect tmpBounds = getInputBounds();
if (!tmpBounds.isValid()) {
- info.inputConfig |=
- WindowInfo::InputConfig::NOT_TOUCH_MODAL | WindowInfo::InputConfig::NOT_FOCUSABLE;
+ info.setInputConfig(WindowInfo::InputConfig::TOUCH_MODAL, false);
+ info.setInputConfig(WindowInfo::InputConfig::NOT_FOCUSABLE, true);
info.touchableRegion.clear();
// A layer could have invalid input bounds and still expect to receive touch input if it has
// replaceTouchableRegionWithCrop. For that case, the input transform needs to be calculated
@@ -2307,7 +2307,7 @@
mDrawingState.inputInfo.ownerUid = mOwnerUid;
mDrawingState.inputInfo.ownerPid = mOwnerPid;
mDrawingState.inputInfo.inputFeatures = WindowInfo::Feature::NO_INPUT_CHANNEL;
- mDrawingState.inputInfo.inputConfig |= WindowInfo::InputConfig::NOT_TOUCH_MODAL;
+ mDrawingState.inputInfo.setInputConfig(WindowInfo::InputConfig::TOUCH_MODAL, false);
mDrawingState.inputInfo.displayId = getLayerStack().id;
}