summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorFyodor Kupolov <fkupolov@google.com>2015-07-13 19:19:25 -0700
committerFyodor Kupolov <fkupolov@google.com>2015-07-14 17:25:42 -0700
commitd4fd8c766da8a70e3359bbc7efbbc79496efe71a (patch)
tree971bad23792d3f9486e1ef7a0b0fe6f2952c84b9 /cmds/am
parentb42cb352a350bac198470f65125aa151ecacff13 (diff)
downloadframeworks_base-d4fd8c766da8a70e3359bbc7efbbc79496efe71a.zip
frameworks_base-d4fd8c766da8a70e3359bbc7efbbc79496efe71a.tar.gz
frameworks_base-d4fd8c766da8a70e3359bbc7efbbc79496efe71a.tar.bz2
Added sendBroadcastMultiplePermissions method
Added Context.sendBroadcastMultiplePermissions(Intent intent, String[] receiverPermissions) method, which allows an array of required permissions to be enforced. Bug: 21852542 Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 844900d..9f4bc52 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -1003,8 +1003,10 @@ public class Am extends BaseCommand {
private void sendBroadcast() throws Exception {
Intent intent = makeIntent(UserHandle.USER_CURRENT);
IntentReceiver receiver = new IntentReceiver();
+ String[] requiredPermissions = mReceiverPermission == null ? null
+ : new String[] {mReceiverPermission};
System.out.println("Broadcasting: " + intent);
- mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, mReceiverPermission,
+ mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, requiredPermissions,
android.app.AppOpsManager.OP_NONE, null, true, false, mUserId);
receiver.waitForFinish();
}