Fix window token leak on multi-display targets
The DisplayManager.getDisplays() API might return a different number of displays depending on the calling UID. An inconsistent behavior could be observed when running CTS tests, where addWindowTokensForAllDisplays() and onRemoved() methods could be called with either SYSTEM_UID or SHELL_UID for the same service connection. This resulted in adding window tokens for more displays but removing for less, causing some window tokens to never be removed. The solution is to clear UID while calling DisplayManager.getDisplays() API. Bug: https://partnerissuetracker.corp.google.com/issues/383369807 Test: Run CTS tests that use UIAutomator/AccessibilityService and observe number of visible layers in SurfaceFlinger dumpsys Change-Id: I5f207ddd09fab8c269db03d9a6dc09fb1d4cce92
Loading
Please register or sign in to comment