Make ImmersiveModeConfirmation trusted

This is the window that appears when an app uses immersive mode for the
first time ("Viewing full screen"), rendered by the system, hence
trusted for go/untrusted-touches.

Fix: 173355690
Bug: 158002302
Test: 1. adb shell settings delete secure immersive_mode_confirmations
      2. Play a video on YouTube, then enter fullscreen, verify clicks
      outside the dialog go through and don't trigger the toast/logcat.
Change-Id: I435a1be99d62579d1ce2eb49129d7b6475a27a7b
This commit is contained in:
Bernardo Rufino
2020-12-23 17:48:56 +00:00
parent c2df8ea920
commit ca14829798

View File

@@ -190,7 +190,9 @@ public class ImmersiveModeConfirmation {
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
PixelFormat.TRANSLUCENT);
lp.setFitInsetsTypes(lp.getFitInsetsTypes() & ~Type.statusBars());
lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
// Trusted overlay so touches outside the touchable area are allowed to pass through
lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS
| WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY;
lp.setTitle("ImmersiveModeConfirmation");
lp.windowAnimations = com.android.internal.R.style.Animation_ImmersiveModeConfirmation;
lp.token = getWindowToken();