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
This commit is contained in:
Martijn Coenen
2023-05-11 13:21:36 +00:00
parent 4fd131eee5
commit a2728a3804

View File

@@ -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)) {