Adds instant app visibility to instumentation

This change grants visibility to instant apps of instrumentation
components that are targetting their package name. This allows
instrumentation tests to run just as installed apps do.

Change-Id: I3786390986cf9a65472da888257833f5b294a937
Fixes: 73078297
Test: manual - connected test passes as instant app
Test: atest EphemeralTest passes
This commit is contained in:
Patrick Baumann
2018-03-05 12:44:33 -08:00
parent 343c2157fc
commit ea18c501d4

View File

@@ -4096,8 +4096,15 @@ public class PackageManagerService extends IPackageManager.Stub
return false;
}
if (callerIsInstantApp) {
// request for a specific component; if it hasn't been explicitly exposed, filter
// request for a specific component; if it hasn't been explicitly exposed through
// property or instrumentation target, filter
if (component != null) {
final PackageParser.Instrumentation instrumentation =
mInstrumentation.get(component);
if (instrumentation != null
&& isCallerSameApp(instrumentation.info.targetPackage, callingUid)) {
return false;
}
return !isComponentVisibleToInstantApp(component, componentType);
}
// request for application; if no components have been explicitly exposed, filter