Fixed picking file from download on Samsung s8 with Oreo
This commit is contained in:
parent
133fdb350f
commit
34e9e8e7a1
1 changed files with 9 additions and 3 deletions
|
@ -756,10 +756,16 @@ public final class LinphoneUtils {
|
||||||
else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
|
else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
|
||||||
|
|
||||||
final String id = DocumentsContract.getDocumentId(uri);
|
final String id = DocumentsContract.getDocumentId(uri);
|
||||||
|
try {
|
||||||
final Uri contentUri = ContentUris.withAppendedId(
|
final Uri contentUri = ContentUris.withAppendedId(
|
||||||
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
|
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
|
||||||
|
|
||||||
return getDataColumn(context, contentUri, null, null);
|
return getDataColumn(context, contentUri, null, null);
|
||||||
|
} catch (NumberFormatException nfe) {
|
||||||
|
if (id.startsWith("raw:")) {
|
||||||
|
return id.substring(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// MediaProvider
|
// MediaProvider
|
||||||
else if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
|
else if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
|
||||||
|
|
Loading…
Reference in a new issue