summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Zac May <zacmay@google.com> 2023-05-01 18:37:32 +0000
committer Zac May <zacmay@google.com> 2023-05-01 19:49:22 +0000
commit0aa4c64933cbcf2fce92d96b15a038e0a10b2e2c (patch)
tree762bdcb7898b3059dcc2440aab19e33663248105
parentd42f68c223e57c62d6cf9456d4b4e871bf73d989 (diff)
Do not apply alpha if window is trusted.
Non-trusted overlays with FLAG_NOT_TOUCHABLE have an alpha auto-applied to them so that it's guaranteed you can see the window below it. Before this change we checked if the window session had the trusted overlay flag set, if it was we would not apply the alpha. However, we recently updated window sessions to be considered a trusted overlay if they have the trusted overlay flag or if they are a system application overlay. This change was not reflected for the automatic alpha applied. This change updates the check to the isTrustedOverlay method on the window session so that system application overlays are allowed to set their own alpha to FLAG_NOT_TOUCHABLE overlays. Test: Manually confirmed SysUI which has the system application overlay permission is able to set its own alpha on a FLAG_NOT_TOUCHABLE overlay. Bug: 274789900 Change-Id: Ia01052cc1e52ceece8a27f13ca3f8e9136a32b99
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index ce4362853b23..2cd09e5b7502 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -933,7 +933,7 @@ public class DisplayPolicy {
float maxOpacity = mService.mMaximumObscuringOpacityForTouch;
if (attrs.alpha > maxOpacity
&& (attrs.flags & FLAG_NOT_TOUCHABLE) != 0
- && (attrs.privateFlags & PRIVATE_FLAG_TRUSTED_OVERLAY) == 0) {
+ && !win.isTrustedOverlay()) {
// The app is posting a SAW with the intent of letting touches pass through, but
// they are going to be deemed untrusted and will be blocked. Try to honor the
// intent of letting touches pass through at the cost of 0.2 opacity for app