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

Commit fbb75b3e authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove lock for internal isGetTasksAllowed

The method only checks recents and permission. The former is a field
which won't change since boot. The latter doesn't involve any WM
stuffs. Other places also use it without lock.

This avoids unnecessary lock contention when calling ActivityManager#
getRunningAppProcesses, getProcessMemoryInfo, getRunningServices.

Bug: 204870457
Test: Test: CtsWindowManagerDeviceTestCases
Change-Id: Ie1f1d1f58543cf25197f42caa01565039ced4b32
parent 318be1a4
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -5488,11 +5488,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {

        @Override
        public boolean isGetTasksAllowed(String caller, int callingPid, int callingUid) {
            synchronized (mGlobalLock) {
            return ActivityTaskManagerService.this.isGetTasksAllowed(
                    caller, callingPid, callingUid);
        }
        }

        @HotPath(caller = HotPath.PROCESS_CHANGE)
        @Override