google / jetpack-camera-app

Apache License 2.0
152 stars 29 forks source link

Improve external storage handling for external intent Image Capture #157

Open JolandaVerhoef opened 8 months ago

JolandaVerhoef commented 8 months ago

AndroidManifest.xml gives a lint warning for this code:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

The warning is:

... is deprecated (and is not granted) when targeting Android 13+. If you need to query or interact 
with MediaStore or media files on the shared storage, you should instead use one or more new 
storage permissions: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO or READ_MEDIA_AUDIO. 
Anshu-Bijarnia commented 8 months ago

Hi, I can try to fix this issue. Can you assign me this issue ?

temcguir commented 8 months ago

Oops I just changed this code in #154 , but please take a look to see if there are any improvements that could be made. There were a lot of changes made around this permission and scoped storage between APIs 28-30, so it may be worth testing on emulators running on 27-31 to see if it is working correctly to take pictures / videos.

We can discuss on this issue if you have any questions.

Anshu-Bijarnia commented 8 months ago

I think a better approach would be permissions based on android version?