summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/Context.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-09-20 16:06:08 -0700
committerJeff Sharkey <jsharkey@android.com>2012-09-21 19:49:43 -0700
commit6d51571835737c7502a2e111ee9dc2527ebad984 (patch)
tree8298f3a36bdfbdb95a4fdd52681f82e7f396d31b /core/java/android/content/Context.java
parent08681adda06f4699f85838861170fbb062c9fdfe (diff)
downloadframeworks_base-6d51571835737c7502a2e111ee9dc2527ebad984.zip
frameworks_base-6d51571835737c7502a2e111ee9dc2527ebad984.tar.gz
frameworks_base-6d51571835737c7502a2e111ee9dc2527ebad984.tar.bz2
Allow acquiring ContentProviders across users.
Otherwise services like SystemUI will always open content://-style Uris as USER_OWNER. Surfaces through createPackageContextAsUser() which points all ContentResolver operations towards a given user. Start using in RemoteViews, so that Notifications correctly resolve image Uris to the sending user. Also add user support for "content" shell tool. Bug: 7202982 Change-Id: I8cb7fb8a812e825bb0b5833799dba87055ff8699
Diffstat (limited to 'core/java/android/content/Context.java')
-rw-r--r--core/java/android/content/Context.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 161670f..524962cb 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2574,6 +2574,17 @@ public abstract class Context {
int flags) throws PackageManager.NameNotFoundException;
/**
+ * Similar to {@link #createPackageContext(String, int)}, but with a
+ * different {@link UserHandle}. For example, {@link #getContentResolver()}
+ * will open any {@link Uri} as the given user.
+ *
+ * @hide
+ */
+ public abstract Context createPackageContextAsUser(
+ String packageName, int flags, UserHandle user)
+ throws PackageManager.NameNotFoundException;
+
+ /**
* Return a new Context object for the current Context but whose resources
* are adjusted to match the given Configuration. Each call to this method
* returns a new instance of a Context object; Context objects are not