summaryrefslogtreecommitdiff
path: root/core/java/android/content/Context.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/content/Context.java')
-rw-r--r--core/java/android/content/Context.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 3eb066e9d99e..0aab2086b911 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -811,6 +811,17 @@ public abstract class Context {
throw new RuntimeException("Not implemented. Must override in a subclass.");
}
+ /**
+ * <p>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.
+ *
+ * @return the feature id this context is for or {@code null} if this is the default
+ * feature.
+ */
+ public @Nullable String getFeatureId() {
+ return null;
+ }
+
/** Return the full application info for this context's package. */
public abstract ApplicationInfo getApplicationInfo();
@@ -5332,6 +5343,20 @@ public abstract class Context {
public abstract Context createDisplayContext(@NonNull Display display);
/**
+ * 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.
+ *
+ * @param featureId The feature id or {@code null} to create a context for the default feature.
+ *
+ * @return A {@link Context} for the feature
+ *
+ * @see #getFeatureId()
+ */
+ public @NonNull Context createFeatureContext(@Nullable String featureId) {
+ return this;
+ }
+
+ /**
* Return a new Context object for the current Context but whose storage
* APIs are backed by device-protected storage.
* <p>