journeyapps / zxing-android-embedded

Barcode scanner library for Android, based on the ZXing decoder
https://journeyapps.com/
Apache License 2.0
5.73k stars 1.27k forks source link

android.permission.CAMERA in Manifest force other camera access to manage rights #549

Open jeremart opened 4 years ago

jeremart commented 4 years ago

Description of the problem:

Let me explain a little bit more. I build an App which needs to take picture from the camera via startActivityForResult method with a new Intent(MediaStore.ACTION_IMAGE_CAPTURE). For this I don't need to add in my manifest (just ). It worked well until I added dependency on com.journeyapps:zxing-android-embedded. From now, if I don't use the scan feature (from com.journeyapps:zxing-android-embedded IntentIntegrator.initiateScan()) at first, and so don't agree to allow the rights on my camera, I can't take picture as before because I have to ask for rights on runtime. I'm pretty sure it's due to the set into the AndroidManifest.xml file. From my point of view this permission is not mandatory in the Manifest file and could be removed to not interfere with other app features.

Which library version are you using? E.g. 3.2.0. com.journeyapps:zxing-android-embedded:3.4.0, but still the issue on 4.1.0

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5, Android 5.0)

Does the same happen on other devices or an emulator? Yes

Can you reproduce the issue in the sample project included with the library? If not, can you provide your own sample project or sample code that produces this error?

In the case of an error do you have a stack trace or adb logs?

xuanrljp commented 1 year ago

Same here