google / google/jetpack-camera-app
JCA 1.0.0-rc01: Image Capture Failure Due to Missing WRITE_EXTERNAL_STORAGE Permission (SM-A520W)
- Dominant language
- Kotlin
- Stars
- 341
- Forks
- 71
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 7
Description
After installing JCA 1.0.0-rc01 on an SM-A520W device, attempting to capture a photo results in an "Image Capture failure" message. This is likely due to the app not requesting the necessary WRITE_EXTERNAL_STORAGE permission.
Reproduce steps:
Install JCA 1.0.0-rc01 on an SM-A520W device.
Open the app and navigate to the photo capture function.
Attempt to take a photo.
Expected Behavior:
The app should request the WRITE_EXTERNAL_STORAGE permission upon installation or before attempting image capture.
The user should be presented with a clear permission request dialog.
Upon granting the permission, the app should be able to capture and save photos successfully.
Actual Behavior:
The app does not request the WRITE_EXTERNAL_STORAGE permission.
The user encounters an "Image Capture failure" error when attempting to take a photo.
The app would be better to request the WRITE_EXTERNAL_STORAGE permission and user would be able to allow the app to use the permission
- Device: SM-A520W
[ro.build.PDA]: [A520WVLSECTJ1]
[ro.build.changelist]: [16556433]
[ro.build.characteristics]: [phone,emulator]
[ro.build.date]: [Fri Oct 23 00:56:56 KST 2020]
[ro.build.date.utc]: [1603382216]
[ro.build.description]: [a5y17ltevl-user 8.0.0 R16NW A520WVLSECTJ1 release-keys]
[ro.build.display.id]: [R16NW.A520WVLSECTJ1]
[ro.build.fingerprint]: [samsung/a5y17ltevl/a5y17ltecan:8.0.0/R16NW/A520WVLSECTJ1:user/release-keys]
[ro.build.flavor]: [a5y17ltevl-user]
[ro.build.host]: [SWDH7914]
[ro.build.id]: [R16NW]
[ro.build.official.release]: [true]
[ro.build.product]: [a5y17ltecan]
[ro.build.scafe.version]: [2018A]
[ro.build.selinux]: [1]
[ro.build.selinux.enforce]: [1]
[ro.build.tags]: [release-keys]
[ro.build.type]: [user]
[ro.build.user]: [dpi]
[ro.build.version.all_codenames]: [REL]
[ro.build.version.base_os]: [samsung/a5y17ltevl/a5y17ltecan:8.0.0/R16NW/A520WVLU9CSH3:user/release-keys]
[ro.build.version.codename]: [REL]
[ro.build.version.incremental]: [A520WVLSECTJ1]
[ro.build.version.preview_sdk]: [0]
[ro.build.version.release]: [8.0.0]
[ro.build.version.sdk]: [26]
[ro.build.version.security_index]: [1]
[ro.build.version.security_patch]: [2020-11-01]
[ro.build.version.sem]: [2601]
[ro.build.version.sep]: [90000]
- Issue log:
```
04-17 08:09:49.024 15645 15645 D TakePictureManager: Issue the next TakePictureRequest.
04-17 08:09:49.025 15645 15645 D TakePictureManager: No new request.
04-17 08:09:49.119 15645 15656 I zygote64: Background concurrent copying GC freed 32580(1413KB) AllocSpace objects, 23(13MB) LOS objects, 49% free, 10MB/20MB, paused 8.031ms total 92.318ms
04-17 08:09:49.130 2548 18817 W ExynosCamera3: [CAM_ID(0)][]-WARN(m_internalFrameThreadFunc):wait timeout
04-17 08:09:49.131 2548 18816 W ExynosCamera3: [CAM_ID(0)][]-WANR(m_selectBayerThreadFunc[4475]):Wait timeout
04-17 08:09:49.131 2548 18816 D ExynosCamera3: DEBUG:duration time( 150 msec):(m_selectBayerThreadFunc)
04-17 08:09:49.152 2548 18818 W ExynosCamera3: [CAM_ID(0)][]-WARN(m_captureThreadFunc):Wait timeout
04-17 08:09:49.152 2548 18818 D ExynosCamera3: DEBUG:duration time( 151 msec):(m_captureThreadFunc)
04-17 08:09:49.232 16955 16967 E DatabaseUtils: Writing exception to parcel
04-17 08:09:49.232 16955 16967 E DatabaseUtils: java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=15645, uid=10083 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
04-17 08:09:49.232 16955 16967 E DatabaseUtils: at android.content.ContentProvider.enforceWritePermissionInner(ContentProvider.java:715)
04-17 08:09:49.232 16955 16967 E DatabaseUtils: at android.content.ContentProvider$Transport.enforceWritePermission(ContentProvider.java:521)
04-17 08:09:49.232 16955 16967 E DatabaseUtils: at android.content.ContentProvider$Transport.insert(ContentProvider.java:265)
04-17 08:09:49.232 16955 16967 E DatabaseUtils: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:152)
04-17 08:09:49.232 16955 16967 E DatabaseUtils: at android.os.Binder.execTransact(Binder.java:682)
04-17 08:09:49.236 2984 2994 I ActivityManager: KPU : put [com.sec.spp.push:remoteRuna] : 0 K
04-17 08:09:49.236 2984 2994 I ActivityManager: Killing 18394:com.sec.spp.push:remoteRuna/u0a33 (adj 906): DHA:empty #17
04-17 08:09:49.238 15645 15662 D CameraXCameraUseCase: takePicture onError: androidx.camera.core.ImageCaptureException: Failed to write to MediaStore URI: null
04-17 08:09:49.239 15645 15645 D PreviewViewModel: cameraUseCase.takePicture error
04-17 08:09:49.239 15645 15645 D PreviewViewModel: androidx.camera.core.ImageCaptureException: Failed to write to MediaStore URI: null
04-17 08:09:49.250 15645 15645 D PreviewScreen: PreviewScreen
```
Contributor guide
Assessment
This issue has not been assessed yet.