diff options
| author | 2023-03-20 23:22:48 +0000 | |
|---|---|---|
| committer | 2023-04-05 20:39:08 +0000 | |
| commit | 56ceba436a4998ab565bd53ca71cc9ad20c931e0 (patch) | |
| tree | 918df14aaf90ecfb21a8363997152aa1870715bf | |
| parent | cb05df1584c5624ef427f708f41c5514ccea90b7 (diff) | |
Restrict adding the implicit READ_URI grant flag.
Only implicitly add FLAG_GRANT_READ_URI_PERMISSION if the stream is not null.
Bug: 223589582
Change-Id: Ie6c52ca52c4d006bdc650a3ad51183e4dbafa842
Test: manual
| -rw-r--r-- | core/java/android/content/Intent.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 154068eb9e09..764826baae07 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -12348,7 +12348,9 @@ public class Intent implements Parcelable, Cloneable { null, new String[] { getType() }, new ClipData.Item(text, htmlText, null, stream)); setClipData(clipData); - addFlags(FLAG_GRANT_READ_URI_PERMISSION); + if (stream != null) { + addFlags(FLAG_GRANT_READ_URI_PERMISSION); + } return true; } } catch (ClassCastException e) { @@ -12387,7 +12389,9 @@ public class Intent implements Parcelable, Cloneable { } setClipData(clipData); - addFlags(FLAG_GRANT_READ_URI_PERMISSION); + if (streams != null) { + addFlags(FLAG_GRANT_READ_URI_PERMISSION); + } return true; } } catch (ClassCastException e) { |