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

Commit b53ff45a authored by Jing Ji's avatar Jing Ji
Browse files

Acquire proc lock prior to the call into AM service connection holder

Since that holder could grab the WM lock and call back into AMS.

Bug: 182885705
Test: atest CtsAppTestCases:ServiceTest
Change-Id: I41c477595caf4a43d8efad91343fe57bbb981a70
parent 7972c833
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -15647,11 +15647,13 @@ public class ActivityManagerService extends IActivityManager.Stub
            final ActivityServiceConnectionsHolder holder =
            final ActivityServiceConnectionsHolder holder =
                    (ActivityServiceConnectionsHolder) connectionHolder;
                    (ActivityServiceConnectionsHolder) connectionHolder;
            synchronized (ActivityManagerService.this) {
            synchronized (ActivityManagerService.this) {
                synchronized (mProcLock) {
                    holder.forEachConnection(cr -> mServices.removeConnectionLocked(
                    holder.forEachConnection(cr -> mServices.removeConnectionLocked(
                            (ConnectionRecord) cr, null /* skipApp */, holder /* skipAct */,
                            (ConnectionRecord) cr, null /* skipApp */, holder /* skipAct */,
                            false /* enqueueOomAdj */));
                            false /* enqueueOomAdj */));
                }
                }
            }
            }
        }
        public void cleanUpServices(int userId, ComponentName component, Intent baseIntent) {
        public void cleanUpServices(int userId, ComponentName component, Intent baseIntent) {
            synchronized(ActivityManagerService.this) {
            synchronized(ActivityManagerService.this) {