From 02ffba940ca96988ed3e7774c606b43c58373b5e Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 8 Mar 2013 16:13:15 -0800 Subject: Handle finished bugreports, share from private. Show notification when a bugreport is finished, letting the user launch a SEND_MULTIPLE intent to share them. Add dialog that warns user about contents before sharing. Since bugreports are now stored in private app data of the Shell app, use FileProvider to build Uris that we can grant others access to. Define BUGREPORT_FINISHED as being a protected broadcast. Delete older bugreports automatically to reclaim disk space. Migrate any Intent extras to ClipData when building PendingIntents. Add --receiver-permission support to am shell command. Bug: 7005318 Change-Id: If6c607dbcf137362d5887eac482ff7391563890f --- cmds/am/src/com/android/commands/am/Am.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmds/am') diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 9fa7dbb..1c02960 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -63,6 +63,7 @@ public class Am { private int mRepeat = 0; private int mUserId; + private String mReceiverPermission; private String mProfileFile; @@ -332,6 +333,8 @@ public class Am { mStartFlags |= ActivityManager.START_FLAG_OPENGL_TRACES; } else if (opt.equals("--user")) { mUserId = parseUserArg(nextArgRequired()); + } else if (opt.equals("--receiver-permission")) { + mReceiverPermission = nextArgRequired(); } else { System.err.println("Error: Unknown option: " + opt); return null; @@ -608,7 +611,7 @@ public class Am { Intent intent = makeIntent(UserHandle.USER_ALL); IntentReceiver receiver = new IntentReceiver(); System.out.println("Broadcasting: " + intent); - mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, null, + mAm.broadcastIntent(null, intent, null, receiver, 0, null, null, mReceiverPermission, android.app.AppOpsManager.OP_NONE, true, false, mUserId); receiver.waitForFinish(); } @@ -1408,6 +1411,7 @@ public class Am { "am broadcast: send a broadcast Intent. Options are:\n" + " --user | all | current: Specify which user to send to; if not\n" + " specified then send to all users.\n" + + " --receiver-permission : Require receiver to hold permission.\n" + "\n" + "am instrument: start an Instrumentation. Typically this target \n" + " is the form /. Options are:\n" + -- cgit v1.1