summaryrefslogtreecommitdiff
path: root/libs/gui/tests/EndToEndNativeInputTest.cpp
diff options
context:
space:
mode:
authorBernardo Rufino <brufino@google.com>2020-12-21 11:02:18 +0000
committerBernardo Rufino <brufino@google.com>2020-12-22 22:07:15 +0000
commit602ef710ce554131d169d5348cddff5aef5cba61 (patch)
tree73bafbde3436ad46f689251d07a1b3f7f35baa79 /libs/gui/tests/EndToEndNativeInputTest.cpp
parent918221f3cdf08c37608ed14427a31e9a0b4b21a7 (diff)
Avoid blocking untrusted touches for touch_flag_obscured
Prevent the feature from blocking the touch since we want to verify that the proper flag is correctly assigned to the motion event. The test still has value since for some window types (eg. SAW) we might allow touches via go/untrusted-touches but we still want the FLAG_WINDOW_IS_OBSCURED mechanism to work. So, we just configure the surface as TouchOcclusionMode::ALLOW, which makes go/untrusted-touches bypass it. Bug: 158002302 Test: atest InputSurfacesTest#touch_flag_obscured Change-Id: I9fb2846752b8674eec50b777c203a13cdc836144
Diffstat (limited to 'libs/gui/tests/EndToEndNativeInputTest.cpp')
-rw-r--r--libs/gui/tests/EndToEndNativeInputTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp
index c75c46c516..3965ea0fdb 100644
--- a/libs/gui/tests/EndToEndNativeInputTest.cpp
+++ b/libs/gui/tests/EndToEndNativeInputTest.cpp
@@ -638,6 +638,9 @@ TEST_F(InputSurfacesTest, touch_flag_obscured) {
std::unique_ptr<InputSurface> nonTouchableSurface = makeSurface(100, 100);
nonTouchableSurface->mInputInfo.flags = InputWindowInfo::Flag::NOT_TOUCHABLE;
nonTouchableSurface->mInputInfo.ownerUid = 22222;
+ // Overriding occlusion mode otherwise the touch would be discarded at InputDispatcher by
+ // the default obscured/untrusted touch filter introduced in S.
+ nonTouchableSurface->mInputInfo.touchOcclusionMode = TouchOcclusionMode::ALLOW;
nonTouchableSurface->showAt(100, 100);
injectTap(190, 199);