From 29d8bbcf03bccef10ca83993c93255d4a2c38ebd Mon Sep 17 00:00:00 2001 From: Bernardo Rufino Date: Fri, 6 Nov 2020 15:15:07 +0000 Subject: [PATCH] Make splash screen trusted Similarly to ag/12986397, touches were being blocked by go/untrusted-touches when the user started interacting with the app early on while the splash screen was showing. Original intent of the window is to let touches pass through (FLAG_NOT_TOUCHABLE) and it's controlled by the system, so we make it trusted to allow touches to pass through. Bug: 171772640 Bug: 158002302 Test: Launch app after clearing it from recents (to make sure there is no snapshot) and interact with it, verify no toast/logcat message about untrusted touches. Change-Id: Ib20d8ce0975e547ec61bec1e3331e5d6aa6127bd --- .../java/com/android/server/policy/PhoneWindowManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 8b677a99b22ae..6b551bba16852 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -2418,6 +2418,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED; params.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS; + // Setting as trusted overlay to let touches pass through. This is safe because this + // window is controlled by the system. + params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY; if (!compatInfo.supportsScreen()) { params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW;