Guard against shared content not having proper permissions.
Fixes #11269
This commit is contained in:
parent
ecc8d1738e
commit
b4111cffef
1 changed files with 6 additions and 1 deletions
|
@ -89,7 +89,12 @@ class ShareRepository {
|
||||||
if (PartAuthority.isLocalUri(uri)) {
|
if (PartAuthority.isLocalUri(uri)) {
|
||||||
return ShareData.forIntentData(uri, mimeType, false, false);
|
return ShareData.forIntentData(uri, mimeType, false, false);
|
||||||
} else {
|
} else {
|
||||||
InputStream stream = context.getContentResolver().openInputStream(uri);
|
InputStream stream = null;
|
||||||
|
try {
|
||||||
|
stream = context.getContentResolver().openInputStream(uri);
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
Log.w(TAG, "Failed to read stream!", e);
|
||||||
|
}
|
||||||
|
|
||||||
if (stream == null) {
|
if (stream == null) {
|
||||||
throw new IOException("Failed to open stream!");
|
throw new IOException("Failed to open stream!");
|
||||||
|
|
Loading…
Add table
Reference in a new issue