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

Bug: 209061624
Test: instrumentation test in a dependent change
Change-Id: Ieca69008bc12f9450f6b239c92f50b221ca77a38
This commit is contained in:
Nikita Ioffe
2022-03-14 18:41:54 +00:00
parent b7b3316789
commit 44318af94f

View File

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