summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/Context.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-08-02 18:31:26 -0700
committerDianne Hackborn <hackbod@google.com>2012-08-02 19:07:57 -0700
commitb4163a6e12ee7100c758c6d3d062ade1f2843fce (patch)
tree2948e83dec184906f2c44ee332431f219b78359d /core/java/android/content/Context.java
parentb1758cf8cd007bfffb3d8adceca25f3b0c82bd77 (diff)
downloadframeworks_base-b4163a6e12ee7100c758c6d3d062ade1f2843fce.zip
frameworks_base-b4163a6e12ee7100c758c6d3d062ade1f2843fce.tar.gz
frameworks_base-b4163a6e12ee7100c758c6d3d062ade1f2843fce.tar.bz2
Add APIs for interacting across users.
- Expose the existing Context.sendBroadcast() as Context.sendBroadcastAsUser(). - Add new android:singleUser attribute for services. - Add new INTERACT_ACROSS_USERS_FULL permission for full system-level access to cross-user interface (allows sendBroadcastAsUser() to send to any receiver). - Add new INTERACT_ACROSS_USERS_FULL permission for more restricted cross-user interaction: this is required for android:singleUser, and allows you to use sendBroadcastAsUser() but only to send to your own receivers. Change-Id: I0de88f6718e9505f4de72e3f45d29c0f503b76e9
Diffstat (limited to 'core/java/android/content/Context.java')
-rw-r--r--core/java/android/content/Context.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 8597993..af8b213 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -988,12 +988,14 @@ public abstract class Context {
public abstract void sendBroadcast(Intent intent);
/**
- * Same as #sendBroadcast(Intent intent), but for a specific user. Used by the system only.
+ * Same as #sendBroadcast(Intent intent), but for a specific user. This broadcast
+ * can only be sent to receivers that are part of the calling application. It
+ * requires holding the {@link android.Manifest.permission#INTERACT_ACROSS_USERS}
+ * permission.
* @param intent the intent to broadcast
* @param userId user to send the intent to
- * @hide
*/
- public void sendBroadcast(Intent intent, int userId) {
+ public void sendBroadcastToUser(Intent intent, int userId) {
throw new RuntimeException("Not implemented. Must override in a subclass.");
}