Merge "Starting sandbox activity should not start a new sandbox process" into udc-dev

This commit is contained in:
Mohammed Rashidy
2023-05-19 09:31:55 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 0 deletions

View File

@@ -3182,6 +3182,10 @@ public final class ProcessList {
if (isSdkSandbox) {
uid = sdkSandboxUid;
}
if (Process.isSdkSandboxUid(uid) && (!isSdkSandbox || sdkSandboxClientAppPackage == null)) {
Slog.e(TAG, "Abort creating new sandbox process as required parameters are missing.");
return null;
}
if (isolated) {
if (isolatedUid == 0) {
IsolatedUidRange uidRange = getOrCreateIsolatedUidRangeLocked(info, hostingRecord);

View File

@@ -1074,6 +1074,12 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
// Remove the process record so it won't be considered as alive.
mService.mProcessNames.remove(wpc.mName, wpc.mUid);
mService.mProcessMap.remove(wpc.getPid());
} else if (r.intent.isSandboxActivity(mService.mContext)) {
Slog.e(TAG, "Abort sandbox activity launching as no sandbox process to host it.");
r.finishIfPossible("No sandbox process for the activity", false /* oomAdj */);
r.launchFailed = true;
r.detachFromProcess();
return;
}
r.notifyUnknownVisibilityLaunchedForKeyguardTransition();