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
This commit is contained in:
Varun Shah
2023-03-20 23:22:48 +00:00
parent cb05df1584
commit 56ceba436a

View File

@@ -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) {