为什么Images.Media.insertImage不需要WRITE_EXTERNAL_STORAG​​E权限 [英] Why Images.Media.insertImage doesn't require WRITE_EXTERNAL_STORAGE permission

查看:283
本文介绍了为什么Images.Media.insertImage不需要WRITE_EXTERNAL_STORAG​​E权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到,即使我没有

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

在我的`AndroidManifest.xml中

in my `AndroidManifest.xml

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

仍然能够对图像文件的写入位置的/ mnt / SD卡/ DCIM /摄像机。能告诉我为什么会这样呢?

still able to write image file to location /mnt/sdcard/DCIM/Camera. May I know why is it so?

推荐答案

也许在依赖于内容提供商 MediaStore ,您可以通过它来插入,这是一个RPC调用。在源$ C ​​$ c中的 MediaStore 提供商:包装/供应商/ MediaProvider ,在它的表现定义权限

maybe in depend on the content provider MediaStore, you through it to insert, it's a RPC invoke. and the MediaStore provider in source code: packages/providers/MediaProvider, in it's manifest define the permission

&LT;使用许可权的android:NAME =android.permission.WRITE_EXTERNAL_STORAG​​E/&GT;

可能是它的原因。

这篇关于为什么Images.Media.insertImage不需要WRITE_EXTERNAL_STORAG​​E权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆