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

Commit e54f99ce authored by Li Li's avatar Li Li Committed by Android (Google) Code Review
Browse files

Merge "DMS: check cached mode for user apps only" into udc-qpr-dev

parents 744b2810 380b3932
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -2868,7 +2868,16 @@ public final class DisplayManagerService extends SystemService {


    // Check if the target app is in cached mode
    // Check if the target app is in cached mode
    private boolean isUidCached(int uid) {
    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;
            return false;
        }
        }
        int procState = mActivityManagerInternal.getUidProcessState(uid);
        int procState = mActivityManagerInternal.getUidProcessState(uid);