From 0e989d00ed1e95be0ccb77c29846ee0b6ac33356 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Fri, 13 Jan 2017 14:15:36 -0800 Subject: Grant access to ephemeral metadata When an ephemeral application explicitly accesses an installed application, it grants access to its package metadata. The ephemeral application effectively stays hidden if it doesn't explicitly connect to any activity, service or provider [i.e. implicit connections using an ACTION_VIEW/CATEGORY_BROWSABLE intent will not expose its metadata]. Bug: 34123112 Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest Change-Id: I7e1680902599b3ada0d4fba5998af30566017051 --- .../android/content/pm/PackageManagerInternal.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'core/java/android') diff --git a/core/java/android/content/pm/PackageManagerInternal.java b/core/java/android/content/pm/PackageManagerInternal.java index 2590a6beda39..62f38483250a 100644 --- a/core/java/android/content/pm/PackageManagerInternal.java +++ b/core/java/android/content/pm/PackageManagerInternal.java @@ -222,6 +222,27 @@ public abstract class PackageManagerInternal { Intent origIntent, String resolvedType, Intent launchIntent, String callingPackage, int userId); + /** + * Grants access to the package metadata for an ephemeral application. + *

+ * When an ephemeral application explicitly tries to interact with a full + * install application [via an activity, service or provider that has been + * exposed using the {@code visibleToInstantApp} attribute], the normal + * application must be able to see metadata about the connecting ephemeral + * app. If the ephemeral application uses an implicit intent [ie action VIEW, + * category BROWSABLE], it remains hidden from the launched activity. + *

+ * If the {@code sourceUid} is not for an ephemeral app or {@code targetUid} + * is not for a fully installed app, this method will be a no-op. + * + * @param userId the user + * @param intent the intent that triggered the grant + * @param targetAppId The app ID of the fully installed application + * @param ephemeralAppId The app ID of the ephemeral application + */ + public abstract void grantEphemeralAccess(int userId, Intent intent, + int targetAppId, int ephemeralAppId); + /** * @return The SetupWizard package name. */ -- cgit v1.2.3