Filter instant apps with different names
ag/2447596 introduced a regression that caused instant apps to be
made visible to one another.
Change-Id: I5db9a43f05dd5bec991cc0934b1c9a9406dfade6
Fixes: 62998487
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 70f6a04..0a7698a 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -7207,12 +7207,15 @@
// load resources from the correct package
installerInfo.resolvePackageName = info.getComponentInfo().packageName;
resolveInfos.set(i, installerInfo);
+ continue;
}
- continue;
}
// caller is a full app, don't need to apply any other filtering
if (ephemeralPkgName == null) {
continue;
+ } else if (ephemeralPkgName.equals(info.activityInfo.packageName)) {
+ // caller is same app; don't need to apply any other filtering
+ continue;
}
// allow activities that have been explicitly exposed to ephemeral apps
if (!isEphemeralApp