diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2013-04-03 16:33:52 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-04-03 16:33:52 -0700 |
| commit | 5c1994eeff841ab6c44113d7138bc4e34e6694dd (patch) | |
| tree | ea066f07e21e82673bd1d9a6d28605242e190228 /core/java/android/content/Intent.java | |
| parent | 997af33eb1930ab3b5fc6fa2d55f9d0345ffcd88 (diff) | |
| parent | 04e740a65e2399c4a4b211408bd84f2d545d9f4a (diff) | |
am 04e740a6: am 0f8e8b03: Merge "Warn when exposing file:// Uris beyond a process." into jb-mr2-dev
* commit '04e740a65e2399c4a4b211408bd84f2d545d9f4a':
Warn when exposing file:// Uris beyond a process.
Diffstat (limited to 'core/java/android/content/Intent.java')
| -rw-r--r-- | core/java/android/content/Intent.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 52541055d1e7..e36f8152a609 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -32,6 +32,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; +import android.os.StrictMode; import android.util.AttributeSet; import android.util.Log; @@ -6965,6 +6966,32 @@ public class Intent implements Parcelable, Cloneable { } /** + * Prepare this {@link Intent} to leave an app process. + * + * @hide + */ + public void prepareToLeaveProcess() { + setAllowFds(false); + + if (mSelector != null) { + mSelector.prepareToLeaveProcess(); + } + if (mClipData != null) { + mClipData.prepareToLeaveProcess(); + } + + if (mData != null && StrictMode.vmFileUriExposureEnabled()) { + // There are several ACTION_MEDIA_* broadcasts that send file:// + // Uris, so only check common actions. + if (ACTION_VIEW.equals(mAction) || + ACTION_EDIT.equals(mAction) || + ACTION_ATTACH_DATA.equals(mAction)) { + mData.checkFileUriExposed("Intent.getData()"); + } + } + } + + /** * Migrate any {@link #EXTRA_STREAM} in {@link #ACTION_SEND} and * {@link #ACTION_SEND_MULTIPLE} to {@link ClipData}. Also inspects nested * intents in {@link #ACTION_CHOOSER}. |
