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

Commit 44318af9 authored by Nikita Ioffe's avatar Nikita Ioffe
Browse files

Sdk Sandbox should be able to see it's client app

Bug: 209061624
Test: instrumentation test in a dependent change
Change-Id: Ieca69008bc12f9450f6b239c92f50b221ca77a38
parent b7b33167
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -129,8 +129,6 @@ import com.android.server.pm.parsing.PackageInfoUtils;
import com.android.server.pm.parsing.pkg.AndroidPackage;
import com.android.server.pm.parsing.pkg.AndroidPackageUtils;
import com.android.server.pm.permission.PermissionManagerServiceInternal;
import com.android.server.pm.pkg.PackageState;
import com.android.server.pm.pkg.PackageStateImpl;
import com.android.server.pm.pkg.PackageStateInternal;
import com.android.server.pm.pkg.PackageStateUtils;
import com.android.server.pm.pkg.PackageUserStateInternal;
@@ -2638,6 +2636,13 @@ public class ComputerEngine implements Computer {
    public final boolean shouldFilterApplication(@Nullable PackageStateInternal ps,
            int callingUid, @Nullable ComponentName component,
            @PackageManager.ComponentType int componentType, int userId) {
        if (Process.isSdkSandboxUid(callingUid)) {
            int clientAppUid = Process.getAppUidForSdkSandboxUid(callingUid);
            // SDK sandbox should be able to see it's client app
            if (clientAppUid == UserHandle.getUid(userId, ps.getAppId())) {
                return false;
            }
        }
        // if we're in an isolated process, get the real calling UID
        if (Process.isIsolated(callingUid)) {
            callingUid = getIsolatedOwner(callingUid);