From aea50fc06a40afbb83edb67d9545e232dffa19ad Mon Sep 17 00:00:00 2001 From: "Philip P. Moltmann" Date: Thu, 5 Mar 2020 15:01:29 -0800 Subject: Rename featureId -> attributionTag In the core functionality this changes everything including aidl's and field names: - Context - ContentProvider - AppOps* - Package parsing For the rest, this is a shallow change to only change to the changed APIs. This keeps the change small-ish Exempt-From-Owner-Approval: Rename Fixes: 148792795 Test: TH Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a --- core/java/android/content/Context.java | 41 +++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'core/java/android/content/Context.java') diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 5e9ed6026083..318ae11759db 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -815,16 +815,25 @@ public abstract class Context { } /** - *

Features are used in complex apps to logically separate parts of the app. E.g. a - * blogging app might also have a instant messaging app built in. + *

Attribution can be used in complex apps to logically separate parts of the app. E.g. a + * blogging app might also have a instant messaging app built in. In this case two separate tags + * can for used each sub-feature. * - * @return the feature id this context is for or {@code null} if this is the default - * feature. + * @return the attribution tag this context is for or {@code null} if this is the default. */ - public @Nullable String getFeatureId() { + public @Nullable String getAttributionTag() { return null; } + // TODO moltmann: Remove + /** + * @removed + */ + @Deprecated + public @Nullable String getFeatureId() { + return getAttributionTag(); + } + /** Return the full application info for this context's package. */ public abstract ApplicationInfo getApplicationInfo(); @@ -5826,19 +5835,29 @@ public abstract class Context { } /** - * Return a new Context object for the current Context but for a different feature in the app. - * Features can be used by complex apps to separate logical parts. + * Return a new Context object for the current Context but attribute to a different tag. + * In complex apps attribution tagging can be used to distinguish between separate logical + * parts. * - * @param featureId The feature id or {@code null} to create a context for the default feature. + * @param attributionTag The tag or {@code null} to create a context for the default. * - * @return A {@link Context} for the feature + * @return A {@link Context} that is tagged for the new attribution * - * @see #getFeatureId() + * @see #getAttributionTag() */ - public @NonNull Context createFeatureContext(@Nullable String featureId) { + public @NonNull Context createAttributionContext(@Nullable String attributionTag) { throw new RuntimeException("Not implemented. Must override in a subclass."); } + // TODO moltmann: remove + /** + * @removed + */ + @Deprecated + public @NonNull Context createFeatureContext(@Nullable String featureId) { + return createAttributionContext(featureId); + } + /** * Return a new Context object for the current Context but whose storage * APIs are backed by device-protected storage. -- cgit v1.2.3