Android 10 scoped storage compatibility
See original GitHub issueUsing version 1.0.7 of gallery_saver.
Behavior on an Android 10 device, when using a ‘targetSdkVersion’ of 29:
The albumName
parameter is ignored for both images and videos. This is because your implementation of it is not compliant with Android 10’s scoped storage. As per this link, you should be using MediaColumns.RELATIVE_PATH in order to indicate the target folder/album.
It seems that the behavior on Android 10 is to ignore the DATA
column that you currently use to indicate the desired path, so images and videos end up within the default locations ‘Pictures’ and ‘Movies’.
Behavior on an Android 10 device, when using a ‘targetSdkVersion’ below 29:
The ‘albumName’ parameter works as intended. Saving videos is working as intended. Saving an image will result in a crash at the point of trying to save its thumbnail, with the stack trace below. The crash occurs after successfully saving the image itself, which can found in the expected folder.
W/MediaStore(25518): Failed to obtain thumbnail for content://media/external/images/media/622
W/MediaStore(25518): java.io.FileNotFoundException: open failed: ENOENT (No such file or directory)
W/MediaStore(25518): at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:149)
W/MediaStore(25518): at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:705)
W/MediaStore(25518): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1687)
W/MediaStore(25518): at android.content.ContentResolver.openTypedAssetFile(ContentResolver.java:1592)
W/MediaStore(25518): at android.content.ContentResolver.lambda$loadThumbnail$0(ContentResolver.java:3590)
W/MediaStore(25518): at android.content.-$$Lambda$ContentResolver$7ILY1SWNxC2xhk-fQUG6tAXW9Ik.call(Unknown Source:10)
W/MediaStore(25518): at android.graphics.ImageDecoder$CallableSource.createImageDecoder(ImageDecoder.java:550)
W/MediaStore(25518): at android.graphics.ImageDecoder.decodeBitmapImpl(ImageDecoder.java:1847)
W/MediaStore(25518): at android.graphics.ImageDecoder.decodeBitmap(ImageDecoder.java:1840)
W/MediaStore(25518): at android.content.ContentResolver.loadThumbnail(ContentResolver.java:3589)
W/MediaStore(25518): at android.content.ContentResolver.loadThumbnail(ContentResolver.java:3573)
W/MediaStore(25518): at android.provider.MediaStore$InternalThumbnails.getThumbnail(MediaStore.java:1553)
W/MediaStore(25518): at android.provider.MediaStore$Images$Thumbnails.getThumbnail(MediaStore.java:1912)
W/MediaStore(25518): at a.a.a.a(Unknown Source:178)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:6 (2 by maintainers)
Top GitHub Comments
I am also seeing this… I thought it was only when saving images w/ the Camera in landscape mode at first, but can confirm that this is an Android 10 issue…
Fixed