summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Patrick Williams <pdwilliams@google.com> 2024-02-14 13:27:03 -0600
committer Patrick Williams <pdwilliams@google.com> 2024-02-14 13:38:28 -0600
commitc12ff7d36528547ab08284a070eb7ca8702307c6 (patch)
treeca795d101d8c326ecf835e686ae72e717ac8faa5
parent9a9bb3808e5f14df1f23ec6495f3b848393afcdb (diff)
Fix sensitive notification flag secure on resume
If a WindowState#isSecureLocked value changes while the window isn't visible (e.g. a sensitive notification is received), then the WindowState won't have a surface. Before flag secure was moved to WindowState from WindowStateAnimator, WindowStateAnimator#createSurfaceLocked would apply flag secure when the surface was created. Now that flag secure has moved to WindowState, we can apply flag secure to the layer immediately. There's no public API to test this directly but CTS tests will be implemented in b/316954495 to provide coverage. Bug: 315208576 Test: manually tested - app receiving sensitive notification in background gets flag_secure Change-Id: I07a7212b00150061f9f07bf9bc599bb20231f194
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 609ad1e76370..bf45804192a9 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -612,10 +612,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
void refreshSecureSurfaceState() {
- forAllWindows((w) -> {
- if (w.mHasSurface) {
- w.setSecureLocked(w.isSecureLocked());
- }
+ forAllWindows(w -> {
+ w.setSecureLocked(w.isSecureLocked());
}, true /* traverseTopToBottom */);
}