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

Commit 6b2f64df authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Do not re-use dead shared isolated processes.

If we are trying to bind a service into an existing isolated process shortly after a previous shared process has been killed, we may still find the existing ProcessRecord, because that is only cleaned up after we receive a death notification. When then trying to bring up the service in that process, we notice it is dead, and schedule a restart, which introduces an additional delay into the binding.

Instead, make sure we don't use a ProcessRecord if it has already been killed.

Bug: 380037707
Change-Id: Iea591fad9113f522dae1bcd4ccbd1adc6fbb1076
Test: attest CtsExternalServiceTestCases
Flag: EXEMPT bugfix
parent 067493a5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5845,7 +5845,7 @@ public final class ActiveServices {
            if (r.inSharedIsolatedProcess) {
                app = mAm.mProcessList.getSharedIsolatedProcess(procName, r.appInfo.uid,
                        r.appInfo.packageName);
                if (app != null) {
                if (app != null && !app.isKilled()) {
                    final IApplicationThread thread = app.getThread();
                    final int pid = app.getPid();
                    final UidRecord uidRecord = app.getUidRecord();
@@ -5870,6 +5870,8 @@ public final class ActiveServices {
                        // If a dead object exception was thrown -- fall through to
                        // restart the application.
                    }
                } else {
                    app = null;
                }
            } else {
                // If this service runs in an isolated process, then each time