summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Activity.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-07-16 10:52:52 -0700
committerDianne Hackborn <hackbod@google.com>2015-07-16 10:52:52 -0700
commita7cfbe0e548ac76f20915b65851b8bc9095aa541 (patch)
tree8317ab2db6c305fcb9e24813cf919420b6fbe032 /core/java/android/app/Activity.java
parentf6586cbde7d4612963eb2e8a2413235630676b83 (diff)
downloadframeworks_base-a7cfbe0e548ac76f20915b65851b8bc9095aa541.zip
frameworks_base-a7cfbe0e548ac76f20915b65851b8bc9095aa541.tar.gz
frameworks_base-a7cfbe0e548ac76f20915b65851b8bc9095aa541.tar.bz2
Work on issue #22516282: ChooserTarget URI grants not forwarded
Add new option to startActivityAsCaller() which allows you to specify that we should not do security checks on the target activity being launched. Change-Id: Ie6b28807b96fef35ccdff93b0a01066cfd8fa307
Diffstat (limited to 'core/java/android/app/Activity.java')
-rw-r--r--core/java/android/app/Activity.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 7572799..96c7f84 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -3977,16 +3977,24 @@ public class Activity extends ContextThemeWrapper
* as intermediaries that dispatch their intent to the target the user selects -- to
* do this, they must perform all security checks including permission grants as if
* their launch had come from the original activity.
+ * @param intent The Intent to start.
+ * @param options ActivityOptions or null.
+ * @param ignoreTargetSecurity If true, the activity manager will not check whether the
+ * caller it is doing the start is, is actually allowed to start the target activity.
+ * If you set this to true, you must set an explicit component in the Intent and do any
+ * appropriate security checks yourself.
+ * @param userId The user the new activity should run as.
* @hide
*/
- public void startActivityAsCaller(Intent intent, @Nullable Bundle options, int userId) {
+ public void startActivityAsCaller(Intent intent, @Nullable Bundle options,
+ boolean ignoreTargetSecurity, int userId) {
if (mParent != null) {
throw new RuntimeException("Can't be called from a child");
}
Instrumentation.ActivityResult ar =
mInstrumentation.execStartActivityAsCaller(
this, mMainThread.getApplicationThread(), mToken, this,
- intent, -1, options, userId);
+ intent, -1, options, ignoreTargetSecurity, userId);
if (ar != null) {
mMainThread.sendActivityResult(
mToken, mEmbeddedID, -1, ar.getResultCode(),