collect
collect copied to clipboard
User is unable to take pictures when allowing camera access after choosing deny and don’t ask again on Redmi 9T-Android 10
ODK Collect version
v2022.1.0
Android version
Android 10
Device used
Xiaomi Redmi 9T
Problem description
Allowing access to camera in device settings after choosing "deny & don’t ask again” in permission dialog, doesn’t allow to take pictures via Image widget or Video widget but allows to take pictures in the Selfie widget. Sometimes trying to take a picture in Image widgets results in the camera popping up and hiding really quickly.
https://user-images.githubusercontent.com/56479916/191047395-da5f1180-1b1a-4eab-bbac-1bb285a24597.mp4
Steps to reproduce the problem
- Go to All widgets form.
- Go to Image widget.
- Tap "Take Picture”.
- Deny access to pictures and recording video.
- Tap "ok” in the next camera permission dialog.
- Tap "Take Picture”.
- Tap "deny & don’t ask again”.
- Tap "open settings” in the next camera permission dialog.
- In device settings allow camera access.
- Swipe to Selfie widget.
- Tap "Take Picture”.
- Swipe back to Image widget.
- Tap "Take Picture”.
Expected behavior
After granting permission to access the camera the user should be able to take pictures.
Other information
I wasn't able to reproduce this issue on different devices.
I tried to reproduce this issue again and I think I missed one thing. In Redmi it’s easy to deny access to the main camera, so I granted Collect access to camera but denied access to the main camera in phone settings.
I tried to do the same thing on Samsung Galaxy M12, but more difficult to change the main camera permissions (so the user is unlikely to do that) and there are extra dialog asking to change that setting while trying to take a picture.
In Redmi it’s easy to deny access to the main camera, so I granted Collect access to camera but denied access to the main camera in phone settings.
Just to clarify: you mean that Collect has the "Camera" permission, but the phone's Camera app no longer has it right?
Yes, but I think it's only possible to get to that point because of the layout of settings in Redmi (easier to change settings like that). So I don't know if the case is relevant.
Yes, but I think it's only possible to get to that point because of the layout of settings in Redmi (easier to change settings like that). So I don't know if the case is relevant.
I don't think that's true. Are you unable to remove the Camera permission from the Samsung's default camera app? If so, that's definitely a (pretty nasty) customization they've made to Android. A camera app should work like any other and have permissions that can be granted/revoked.
It is possible on Samsung but the user needs to find that settings (in Redmi all camera permission settings are on one list). In Samsung there is also dialog connected with that setting
It is possible on Samsung but the user needs to find that settings (in Redmi all camera permission settings are on one list). In Samsung there is also dialog connected with that setting
It sounds like Samsung have made it harder than it should be. In "stock Android" you can generally get to a "Permission manager" screen through "Privacy" or "Apps" in Settings - it looks like that's what you're seeing on Redmi, and I'd expect it to be present in most Android devices. It's probably somewhere in Samsung's custom settings (part of One UI), but maybe just buried. If I'm correct, you should be able to reproduce this problem in an emulator (closest to stock Android) and we can just make this issue general to all devices.
I think the problem for the standard Image Widget here is that we ask for the Camera permission and then hand the user to their default camera app - which is actually where the permission is needed. Most camera apps (like Samsung's) will probably do a better job of handling denied permission, but it looks like Redmi's just closes. There's nothing we can do about that, but it might be that we could just stop asking the user for the Camera permission (as we don't need it), to make the situation less confusing.
We should investigate whether Collect actually needs the Camera permission for the (non-selfie) Image and Video widgets.
We should investigate whether Collect actually needs the Camera permission for the (non-selfie) Image and Video widgets.
We can't remove that permission from our app. This is very confusing and not documented well but you can read about it here:
- https://issuetracker.google.com/issues/37063818
- https://developer.android.com/reference/android/provider/MediaStore#ACTION_IMAGE_CAPTURE
- https://stackoverflow.com/a/33290921/5479029
I've also tried that on my own and got a SecurityException
.
I would expect this page to explicitly say that we need to request camera permission even if we use intents but it doesn't do that.
It looks like there is nothing we can do here so I'm closing the issue.