From 032de31170be7915541e509502265323f8891e0d Mon Sep 17 00:00:00 2001 From: Bernardo Rufino Date: Fri, 15 Jan 2021 10:39:04 +0000 Subject: [PATCH] Mark RotationLayer as trusted for untrusted touches Its content is generated by the system (a snapshot of the screen IIUC, please correct me if I'm wrong!) and the layer was originally pass-through. Touches are being blocked in some tests, which is causing breakages, so reverting to the previous behavior for this layer, which is to let touches pass through. Bug: 176926757 Bug: 174269206 Bug: 158002302 Test: Rotate device, tap the screen frenetically during animation, observer no log from touches being blocked. Change-Id: Iea970e6a4793dd991e2a666c04bb508d7fa240ed --- .../com/android/server/wm/ScreenRotationAnimation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java index 1a27b1bc4a6e5..533c82e599c9f 100644 --- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java +++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java @@ -206,12 +206,17 @@ class ScreenRotationAnimation { .setCallsite("ScreenRotationAnimation") .build(); + String name = "RotationLayer"; mScreenshotLayer = displayContent.makeOverlay() - .setName("RotationLayer") + .setName(name) .setBufferSize(mWidth, mHeight) .setSecure(isSecure) .setCallsite("ScreenRotationAnimation") .build(); + // This is the way to tell the input system to exclude this surface from occlusion + // detection since we don't have a window for it. We do this because this window is + // generated by the system as well as its content. + InputMonitor.setTrustedOverlayInputInfo(mScreenshotLayer, t, displayId, name); mEnterBlackFrameLayer = displayContent.makeOverlay() .setName("EnterBlackFrameLayer")