KeyMapper icon indicating copy to clipboard operation
KeyMapper copied to clipboard

App requests camera permission to use torch

Open ph00lt0 opened this issue 1 year ago • 6 comments

Developer TODO (don't remove)

  • [ ] create new branch. put issue number at start of name if not a very quick fix.
  • [ ] write tests. put issue number in comment
  • [ ] update documentation
  • [ ] merge and delete branch (don't squash because want commit history to see why I made changes)

Discord message link/email recipient

Describe the bug App keeps requesting permission for camera while this is completely unnecessary to activate the torch.

To Reproduce Create an action using torch.

Expected behavior No requests for access to camera permission

Smartphone (please complete the following information):

  • Device: Pixel 5a
  • Android version: 12

ph00lt0 avatar Jul 31 '22 17:07 ph00lt0

Android asks for the permission to be able to do anything with a camera unless you've read somewhere that an app can use the flashlight without requesting this permission?

sds100 avatar Jul 31 '22 19:07 sds100

Well I do not give this permission and the flashlight works fine, it simply isn't required. I believe this came around the time they switched to camera API 2.

ph00lt0 avatar Aug 01 '22 14:08 ph00lt0

Do you know an app that can do that?

sds100 avatar Aug 01 '22 19:08 sds100

your own app can? it just works even with permission not granted. It all works fine it just keeps complaining about wanting camera access.

https://github.com/SimpleMobileTools/Simple-Flashlight/ is another app but really any flashlight app works without camera access.

ph00lt0 avatar Aug 01 '22 20:08 ph00lt0

Okay, I'll look into if there is an API to control the flash that doesn't require camera permission. But I'm still confused how you are getting Key Mapper to actually turn the flashlight on as an action. It checks for the permission before it does the action and so should complain every time you try to trigger it. Does the flashlight actually turn on and off when Key Mapper complains?

sds100 avatar Aug 02 '22 03:08 sds100

It only complains inside the app really. But yeah the flashlight turns on and off without any issues.

ph00lt0 avatar Aug 02 '22 09:08 ph00lt0