SecurityException: Permission Denial when opening image
- Android version: 4.4.2
- Phone model: Samsung GT-I9301I (s3ve3gxx)
- Briar version: 1.3.6 (445ef081)
Stacktrace:
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/835 from pid=28044, uid=10227 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1472)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:148)
at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:682)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1066)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:907)
at android.content.ContentResolver.openInputStream(ContentResolver.java:632)
at org.briarproject.briar.android.settings.SettingsViewModel.trySetAvatar(SettingsViewModel.java:230)
at org.briarproject.briar.android.settings.SettingsViewModel.lambda$setAvatar$2(SettingsViewModel.java:214)
at org.briarproject.briar.android.settings.SettingsViewModel.lambda$setAvatar$2$SettingsViewModel(SettingsViewModel.java)
at org.briarproject.briar.android.settings.-$$Lambda$SettingsViewModel$nVOlNd9texPikn4W8A-1eS1Xxu4.run(lambda)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
I'm not sure whether we need to request READ_EXTERNAL_STORAGE on API 19, or whether this is caused by a bug in the app supplying the image and we just need to handle the exception cleanly.