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

Commit 494381c8 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/25073114'] into udc-qpr1-release.

Change-Id: I436592642f8d2bc3bfd3713ef28dc72ce0c24690
parents 8f74745e 157a3914
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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);