现象
storage下可读取,但/mnt/media_rw不可读取
结论
1 base/core/res/AndroidManifest.xml
–安卓12
-----已替代android.permission.WRITE_MEDIA_STORAGE
安卓新版本适配是真谛烦 =。=
<!-- @SystemApi @TestApi Allows an application to write to internal media storage
@deprecated This permission is no longer honored in the system and no longer adds
the media_rw gid as a supplementary gid to the holder. Use the
android.permission.MANAGE_EXTERNAL_STORAGE instead.
@hide -->
<permission android:name="android.permission.WRITE_MEDIA_STORAGE"
android:protectionLevel="signature|privileged" />
2 framework/base/data/etc/platform.xml
看情况是否需要添加此处,否则media_rw权限不可读文章来源:https://www.toymoban.com/news/detail-731336.html
<permission name="android.permission.WRITE_MEDIA_STORAGE" >
<group gid="media_rw" />
<group gid="sdcard_rw" />
</permission>
文章来源地址https://www.toymoban.com/news/detail-731336.html
到了这里,关于android 12 /mnt/media的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!