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

Commit e208105d authored by Sandro Montanari's avatar Sandro Montanari Committed by Android (Google) Code Review
Browse files

Merge "Add getSdkSandboxApplicationInfoForInstrumentation to SdkSandboxManagerLocal"

parents c18da213 8c228bb0
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -15629,16 +15629,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            return false;
        }
        final ApplicationInfo sdkSandboxInfo;
        try {
            final PackageManager pm = mContext.getPackageManager();
            sdkSandboxInfo = pm.getApplicationInfoAsUser(pm.getSdkSandboxPackageName(), 0, userId);
        } catch (NameNotFoundException e) {
            reportStartInstrumentationFailureLocked(
                    watcher, className, "Can't find SdkSandbox package");
            return false;
        }
        final SdkSandboxManagerLocal sandboxManagerLocal =
                LocalManagerRegistry.getManager(SdkSandboxManagerLocal.class);
        if (sandboxManagerLocal == null) {
@@ -15647,12 +15637,20 @@ public class ActivityManagerService extends IActivityManager.Stub
            return false;
        }
        final String processName = sandboxManagerLocal.getSdkSandboxProcessNameForInstrumentation(
                sdkSandboxClientAppInfo);
        final ApplicationInfo sdkSandboxInfo;
        try {
            sdkSandboxInfo =
                    sandboxManagerLocal.getSdkSandboxApplicationInfoForInstrumentation(
                            sdkSandboxClientAppInfo, userId);
        } catch (NameNotFoundException e) {
            reportStartInstrumentationFailureLocked(
                    watcher, className, "Can't find SdkSandbox package");
            return false;
        }
        ActiveInstrumentation activeInstr = new ActiveInstrumentation(this);
        activeInstr.mClass = className;
        activeInstr.mTargetProcesses = new String[]{processName};
        activeInstr.mTargetProcesses = new String[]{sdkSandboxInfo.processName};
        activeInstr.mTargetInfo = sdkSandboxInfo;
        activeInstr.mProfileFile = profileFile;
        activeInstr.mArguments = arguments;
@@ -15686,7 +15684,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                ProcessRecord app = addAppLocked(
                        sdkSandboxInfo,
                        processName,
                        sdkSandboxInfo.processName,
                        /* isolated= */ false,
                        /* isSdkSandbox= */ true,
                        sdkSandboxUid,