Remove the concept of TOUCH_MODAL from input
We remove modal windows from input. WM will configure modal windows
itself using touchableRegion.
Bug: 216806304
Test: atest inputflinger_tests
Change-Id: I9593865213216b420ab9b5c5b853298f01dabcc6
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index f5aa45b..58c9303 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -509,8 +509,7 @@
if (inputConfig.test(WindowInfo::InputConfig::NOT_TOUCHABLE) && !windowCanInterceptTouch) {
return false;
}
- if (!inputConfig.test(WindowInfo::InputConfig::TOUCH_MODAL) &&
- !windowInfo.touchableRegionContainsPoint(x, y)) {
+ if (!windowInfo.touchableRegionContainsPoint(x, y)) {
return false;
}
return true;
diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp
index 51ecf76..ae8358a 100644
--- a/services/inputflinger/tests/InputDispatcher_test.cpp
+++ b/services/inputflinger/tests/InputDispatcher_test.cpp
@@ -1032,10 +1032,6 @@
mInfo.setInputConfig(WindowInfo::InputConfig::PAUSE_DISPATCHING, paused);
}
- void setTouchModal(bool touchModal) {
- mInfo.setInputConfig(WindowInfo::InputConfig::TOUCH_MODAL, touchModal);
- }
-
void setPreventSplitting(bool preventSplitting) {
mInfo.setInputConfig(WindowInfo::InputConfig::PREVENT_SPLITTING, preventSplitting);
}
@@ -6412,27 +6408,6 @@
}
/**
- * A spy window that is a modal window will receive gestures outside of its frame and touchable
- * region.
- */
-TEST_F(InputDispatcherSpyWindowTest, ModalWindow) {
- auto window = createForeground();
- auto spy = createSpy();
- // Our current policy dictates that modal windows must be focusable.
- spy->setFocusable(true);
- spy->setTouchModal(true);
- spy->setFrame(Rect{0, 0, 20, 20});
- mDispatcher->setInputWindows({{ADISPLAY_ID_DEFAULT, {spy, window}}});
-
- // Inject an event outside the spy window's frame and touchable region.
- ASSERT_EQ(InputEventInjectionResult::SUCCEEDED,
- injectMotionDown(mDispatcher, AINPUT_SOURCE_TOUCHSCREEN, ADISPLAY_ID_DEFAULT))
- << "Inject motion event should return InputEventInjectionResult::SUCCEEDED";
- window->consumeMotionDown();
- spy->consumeMotionDown();
-}
-
-/**
* A spy window can listen for touches outside its touchable region using the WATCH_OUTSIDE_TOUCHES
* flag, but it will get zero-ed out coordinates if the foreground has a different owner.
*/