diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-03-25 08:34:12 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-25 08:34:12 +0000 |
| commit | 9bbdb759d8d2fe79e460aa5674d8ca6c395abf51 (patch) | |
| tree | 6ca7fc75edf99f9e3b808eed0bbcdc4626c74960 /core/java/android | |
| parent | 8b5a3a8529e4e1617ebae26a9cd3de6158b96d24 (diff) | |
| parent | 83084f25f70483a57ae3f6fd4a1f9f7be0c24e23 (diff) | |
Merge "PackageManager: Restrict some camera intents to MATCH_SYSTEM_ONLY" into rvc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/content/Intent.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 95385ee9b79c..b1d6c830d3b7 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -11215,6 +11215,17 @@ public class Intent implements Parcelable, Cloneable { && hasWebURI(); } + private boolean isImageCaptureIntent() { + return (MediaStore.ACTION_IMAGE_CAPTURE.equals(mAction) + || MediaStore.ACTION_IMAGE_CAPTURE_SECURE.equals(mAction) + || MediaStore.ACTION_VIDEO_CAPTURE.equals(mAction)); + } + + /** @hide */ + public boolean isImplicitImageCaptureIntent() { + return mPackage == null && mComponent == null && isImageCaptureIntent(); + } + /** * @hide */ @@ -11241,9 +11252,7 @@ public class Intent implements Parcelable, Cloneable { } putParcelableArrayListExtra(EXTRA_STREAM, newStreams); } - } else if (MediaStore.ACTION_IMAGE_CAPTURE.equals(action) - || MediaStore.ACTION_IMAGE_CAPTURE_SECURE.equals(action) - || MediaStore.ACTION_VIDEO_CAPTURE.equals(action)) { + } else if (isImageCaptureIntent()) { final Uri output = getParcelableExtra(MediaStore.EXTRA_OUTPUT); if (output != null) { putExtra(MediaStore.EXTRA_OUTPUT, maybeAddUserId(output, contentUserHint)); @@ -11349,9 +11358,7 @@ public class Intent implements Parcelable, Cloneable { } } catch (ClassCastException e) { } - } else if (MediaStore.ACTION_IMAGE_CAPTURE.equals(action) - || MediaStore.ACTION_IMAGE_CAPTURE_SECURE.equals(action) - || MediaStore.ACTION_VIDEO_CAPTURE.equals(action)) { + } else if (isImageCaptureIntent()) { final Uri output; try { output = getParcelableExtra(MediaStore.EXTRA_OUTPUT); |
