Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit bad132df authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Adjust process state for visible overlay window

This avoids process with system permission from being frozen by
CachedAppOptimizer if it only shows an overlay window without an
active application component (e.g. a running service).

Otherwise the window could meet ANR because its process is unable
to response for input events.

Assume:
A=add mAppOverlaySurfaces
B=add mAlertWindowSurfaces
C=log metrics
D=show notification
E=setHasOverlayUi (adjust process state)

app-overlay=TYPE_APPLICATION_OVERLAY
other-overlay=TYPE_[*PHONE|SYSTEM_ALERT|SYSTEM_ERROR|SYSTEM_OVERLAY]

Before:
- Window owner has system permission
   add other-overlay: do nothing
   add app-overlay: A+C+E
- Window owner doesn't have system permission
   add other-overlay: B+C+D
   add app-overlay: A+B+C+D+E

After:
- Window owner has system permission
   add other-overlay: B+E
   add app-overlay: B+C+E
- Window owner doesn't have system permission
   add other-overlay: B+C+D+E
   add app-overlay: B+C+D+E

The mAppOverlaySurfaces is removed because there is no need to
distinguish the overlay type for checking whether a process contains
an overlay window.

Bug: 290870920
Test: WindowManagerServiceTests#testTrackOverlayWindow
Change-Id: I7618d853ea6e7a7261a72b9f4883d9642d426450
parent a9d2c1f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment