diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-04-16 10:32:04 -0700 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2015-04-17 20:43:56 +0000 |
commit | 16a16899505ec0a9ede5b76650bfb8817b3227c7 (patch) | |
tree | ab1ff64e6befd59d55de65dbe7a89614feadcd2f /core/java/android/content | |
parent | d01242946eb7423612998b5bdbc71a6a1b3e8581 (diff) | |
download | frameworks_base-16a16899505ec0a9ede5b76650bfb8817b3227c7.zip frameworks_base-16a16899505ec0a9ede5b76650bfb8817b3227c7.tar.gz frameworks_base-16a16899505ec0a9ede5b76650bfb8817b3227c7.tar.bz2 |
Add OP_READ_PHONE_STATE app op - framework
The READ_PHONE_STATE permission protects PII information and
is in the Phone group. This change is adding the corrseponding
app op for gating access to the API guarded by READ_POHNE state
which will be used instead as an access control for legacy apps.
Change-Id: I2ff895a5a0e529f26ec0ad706266a30d829268ba
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/Context.java | 22 | ||||
-rw-r--r-- | core/java/android/content/ContextWrapper.java | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 370f61c..3bf3f85 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -1608,6 +1608,28 @@ public abstract class Context { public abstract void sendBroadcastAsUser(Intent intent, UserHandle user, @Nullable String receiverPermission); + + /** + * Version of {@link #sendBroadcast(Intent, String)} that allows you to specify the + * user the broadcast will be sent to. This is not available to applications + * that are not pre-installed on the system image. Using it requires holding + * the INTERACT_ACROSS_USERS permission. + * + * @param intent The Intent to broadcast; all receivers matching this + * Intent will receive the broadcast. + * @param user UserHandle to send the intent to. + * @param receiverPermission (optional) String naming a permission that + * a receiver must hold in order to receive your broadcast. + * If null, no permission is required. + * @param appOp The app op associated with the broadcast. + * + * @see #sendBroadcast(Intent, String) + * + * @hide + */ + public abstract void sendBroadcastAsUser(Intent intent, UserHandle user, + @Nullable String receiverPermission, int appOp); + /** * Version of * {@link #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle)} diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java index 92f0079..fb9e194 100644 --- a/core/java/android/content/ContextWrapper.java +++ b/core/java/android/content/ContextWrapper.java @@ -444,6 +444,13 @@ public class ContextWrapper extends Context { mBase.sendBroadcastAsUser(intent, user, receiverPermission); } + /** @hide */ + @Override + public void sendBroadcastAsUser(Intent intent, UserHandle user, + String receiverPermission, int appOp) { + mBase.sendBroadcastAsUser(intent, user, receiverPermission, appOp); + } + @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, |