Loading _docs/history.html +2 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ Version 1.43.1 (Work in progress) FIXED Crash when selecting antibanding setting on devices with no support for antibanding; this option is now removed on such devices. FIXED Fixed some crashes. FIXED Crash when using Storage Access Framework to select "Downloads" on Android 8+. FIXED Fixed some other crashes. Version 1.43 (2018/04/10) Loading app/src/main/java/net/sourceforge/opencamera/StorageUtils.java +21 −10 Original line number Diff line number Diff line Loading @@ -368,6 +368,7 @@ public class StorageUtils { } } else if( "com.android.providers.downloads.documents".equals(uri.getAuthority()) ) { if( !is_folder ) { final String id = DocumentsContract.getDocumentId(uri); final Uri contentUri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.parseLong(id)); Loading @@ -376,6 +377,16 @@ public class StorageUtils { if( filename != null ) file = new File(filename); } else { if( MyDebug.LOG ) Log.d(TAG, "downloads uri not supported for folders"); // This codepath can be reproduced by enabling SAF and selecting Downloads. // DocumentsContract.getDocumentId() throws IllegalArgumentException for // this (content://com.android.providers.downloads.documents/tree/downloads). // If we use DocumentsContract.getTreeDocumentId() for folders, it returns // "downloads" - not clear how to parse this! } } else if( "com.android.providers.media.documents".equals(uri.getAuthority()) ) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); Loading Loading
_docs/history.html +2 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ Version 1.43.1 (Work in progress) FIXED Crash when selecting antibanding setting on devices with no support for antibanding; this option is now removed on such devices. FIXED Fixed some crashes. FIXED Crash when using Storage Access Framework to select "Downloads" on Android 8+. FIXED Fixed some other crashes. Version 1.43 (2018/04/10) Loading
app/src/main/java/net/sourceforge/opencamera/StorageUtils.java +21 −10 Original line number Diff line number Diff line Loading @@ -368,6 +368,7 @@ public class StorageUtils { } } else if( "com.android.providers.downloads.documents".equals(uri.getAuthority()) ) { if( !is_folder ) { final String id = DocumentsContract.getDocumentId(uri); final Uri contentUri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.parseLong(id)); Loading @@ -376,6 +377,16 @@ public class StorageUtils { if( filename != null ) file = new File(filename); } else { if( MyDebug.LOG ) Log.d(TAG, "downloads uri not supported for folders"); // This codepath can be reproduced by enabling SAF and selecting Downloads. // DocumentsContract.getDocumentId() throws IllegalArgumentException for // this (content://com.android.providers.downloads.documents/tree/downloads). // If we use DocumentsContract.getTreeDocumentId() for folders, it returns // "downloads" - not clear how to parse this! } } else if( "com.android.providers.media.documents".equals(uri.getAuthority()) ) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); Loading