google / jetpack-camera-app

Apache License 2.0
128 stars 26 forks source link

Improve external storage handling for external intent Image Capture #157

Open JolandaVerhoef opened 5 months ago

JolandaVerhoef commented 5 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 5 months ago

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

temcguir commented 5 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 5 months ago

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