From a2728a38041686b5b0bc5462871fa6bf4ecbcb8b Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Thu, 11 May 2023 13:21:36 +0000 Subject: [PATCH] Fix race condition in binding isolated services in shared process. When a new isolated service is being bound in a shared isolated process that is not yet completely brought up, the service is added to the pending services list. However, when the shared isolated process does come up, the pending service is not considered, because the UID does not match. Set isolationHostProc correctly in the ServiceRecord, to ensure that the pending service logic knows to put this service in the shared isolated process. Bug: 280918250 Test: atest CtsVoiceInteractionTestCases Change-Id: Iaf0bcdec2c777e72a0e18246fa0e5ccca117def1 --- services/core/java/com/android/server/am/ActiveServices.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 96766a20c8030..14b7c839de056 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -5243,6 +5243,7 @@ public final class ActiveServices { final IApplicationThread thread = app.getThread(); final int pid = app.getPid(); final UidRecord uidRecord = app.getUidRecord(); + r.isolationHostProc = app; if (thread != null) { try { if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) {