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
This commit is contained in:
Jing Ji
2021-04-08 10:26:58 -07:00
parent 7972c833b1
commit b53ff45a2f

View File

@@ -15647,9 +15647,11 @@ public class ActivityManagerService extends IActivityManager.Stub
final ActivityServiceConnectionsHolder holder =
(ActivityServiceConnectionsHolder) connectionHolder;
synchronized (ActivityManagerService.this) {
holder.forEachConnection(cr -> mServices.removeConnectionLocked(
(ConnectionRecord) cr, null /* skipApp */, holder /* skipAct */,
false /* enqueueOomAdj */));
synchronized (mProcLock) {
holder.forEachConnection(cr -> mServices.removeConnectionLocked(
(ConnectionRecord) cr, null /* skipApp */, holder /* skipAct */,
false /* enqueueOomAdj */));
}
}
}