Why Images.Media.insertImage does not require WRITE_EXTERNAL_STORAGE permission

I understand that even I don’t have

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

in my `AndroidManifest.xml

 String path = Images.Media.insertImage(((Activity)MainView.this.getContext()).getContentResolver(), screenCaptureBitmap, "Title", "Description"); 

you can still write the image file to the /mnt/sdcard/DCIM/Camera folder. May I find out why this is so?

+4
source share
1 answer

maybe it depends on the content provider MediaStore , you can embed it, it calls RPC. and MediaStore in the source code: packages/providers/MediaProvider , in it the manifest determines the resolution

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

may be the reason.

-2
source

Source: https://habr.com/ru/post/1397982/


All Articles