diff options
| author | 2023-10-23 17:24:31 +0000 | |
|---|---|---|
| committer | 2023-10-23 17:24:31 +0000 | |
| commit | e54f99ced4cb4ff49e786079e718d9196601f8c7 (patch) | |
| tree | 364d2a68893b4c76b4cc3b90c0c7b17072864360 | |
| parent | 744b2810cdea93264427f035b423e46af1c47c99 (diff) | |
| parent | 380b3932bda7ad87f3180b8f1949d7b2b710b9d6 (diff) | |
Merge "DMS: check cached mode for user apps only" into udc-qpr-dev
| -rw-r--r-- | services/core/java/com/android/server/display/DisplayManagerService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java index 6466b440b3a0..bc7e15635035 100644 --- a/services/core/java/com/android/server/display/DisplayManagerService.java +++ b/services/core/java/com/android/server/display/DisplayManagerService.java @@ -2868,7 +2868,16 @@ public final class DisplayManagerService extends SystemService { // Check if the target app is in cached mode private boolean isUidCached(int uid) { - if (mActivityManagerInternal == null) { + // Only query procState and importance for Android apps, which have UIDs starting + // from FIRST_APPLICATION_UID. . + // + // Other processes with UID < FIRST_APPLICATION_UID can also register to DMS for + // display events. E.g. Android Studio executes a screen sharing process to provide + // display mirroring functionality. That process inherits the UID of adb. Depending + // on adb mode, it can be shell (2000) or root (0). Those processes are not Android + // apps and not managed by AMS. Treat them as non-cached so never ignore or defer + // display events to them. + if (mActivityManagerInternal == null || uid < FIRST_APPLICATION_UID) { return false; } int procState = mActivityManagerInternal.getUidProcessState(uid); |