读外部存储的权限READ_EXTERNAL_STORAGE

READ_EXTERNAL_STORAGE

Added in  API level 16
String READ_EXTERNAL_STORAGE

Allows an application to read from external storage.

Any app that declares the WRITE_EXTERNAL_STORAGE permission is implicitly granted this permission.

This permission is enforced starting in API level 19. Before API level 19, this permission is not enforced and all apps still have access to read from external storage. You can test your app with the permission enforced by enabling Protect USB storage under Developer options in the Settings app on a device running Android 4.1 or higher.

Also starting in API level 19, this permission is not required to read/write files in your application-specific directories returned bygetExternalFilesDir(String) and getExternalCacheDir().

Note: If both your minSdkVersion and targetSdkVersion values are set to 3 or lower, the system implicitly grants your app this permission. If you don't need this permission, be sure your targetSdkVersion is 4 or higher.

Protection level: dangerous

Constant Value: "android.permission.READ_EXTERNAL_STORAGE"

已经声明了写外置存储的权限WRITE_EXTERNAL_STORAGE,则隐式的赋予了读外置存储权限。
所以,在系统自带app媒体存储MediaProvider的AndroidManifest.xml中未显式声明读权限,因为已经声明了写权限:

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_MTP" />
    <uses-permission android:name="android.permission.MANAGE_USERS" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
http://androidxref.com/6.0.1_r10/xref/packages/providers/MediaProvider/AndroidManifest.xml

官网:https://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE


转载于:https://www.cnblogs.com/muyuge/p/6152413.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值