parent
d9c9baf516
commit
95aea4291e
|
@ -648,8 +648,13 @@ public class FileBackend {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOriginalPath(Uri uri) {
|
public String getOriginalPath(final Uri uri) {
|
||||||
return FileUtils.getPath(mXmppConnectionService, uri);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
// On Android 11+ we don’t have access to the original file
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return FileUtils.getPath(mXmppConnectionService, uri);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyFileToPrivateStorage(File file, Uri uri) throws FileCopyException {
|
private void copyFileToPrivateStorage(File file, Uri uri) throws FileCopyException {
|
||||||
|
|
|
@ -34,10 +34,8 @@ public class FileUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
|
|
||||||
|
|
||||||
// DocumentProvider
|
// DocumentProvider
|
||||||
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
|
if (DocumentsContract.isDocumentUri(context, uri)) {
|
||||||
// ExternalStorageProvider
|
// ExternalStorageProvider
|
||||||
if (isExternalStorageDocument(uri)) {
|
if (isExternalStorageDocument(uri)) {
|
||||||
final String docId = DocumentsContract.getDocumentId(uri);
|
final String docId = DocumentsContract.getDocumentId(uri);
|
||||||
|
|
Loading…
Reference in a new issue