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

Commit 542027b5 authored by Wei Wang's avatar Wei Wang
Browse files

HintManagerService: only check isolated process for app uid



system_server can initiate ADPF session, which may cause deadlock on
chain AMS -> WMS -> graphics -> HintManagerService -> AMS.
This CL is to skip the AMS call when calling from system.

Test: Boot
Bug: 195257481
Signed-off-by: default avatarWei Wang <wvw@google.com>
Change-Id: I6c8f431193b31d7643d3782563b9f6c33fe69da0
parent 7f95e16a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -255,7 +255,11 @@ public final class HintManagerService extends SystemService {
    private boolean checkTidValid(int uid, int tgid, int [] tids) {
        // Make sure all tids belongs to the same UID (including isolated UID),
        // tids can belong to different application processes.
        List<Integer> eligiblePids = mAmInternal.getIsolatedProcesses(uid);
        List<Integer> eligiblePids = null;
        // To avoid deadlock, do not call into AMS if the call is from system.
        if (uid != Process.SYSTEM_UID) {
            eligiblePids = mAmInternal.getIsolatedProcesses(uid);
        }
        if (eligiblePids == null) {
            eligiblePids = new ArrayList<>();
        }