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
Loading
Please register or sign in to comment