android 12 /mnt/media

现象

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权限不可读

复制代码
<permission name="android.permission.WRITE_MEDIA_STORAGE" >
    <group gid="media_rw" />
    <group gid="sdcard_rw" />
</permission>
相关推荐
Jerry1 天前
Compose 5 个简短动画,让您的应用脱颖而出
android
PenguinLetsGo1 天前
你的App是否有出现过幽灵调用?
android
没有了遇见1 天前
Android ViewPager2 嵌套 RecyclerView 滑动冲突解决方案
android
咖啡の猫1 天前
Android开发-选择按钮
android·gitee
火柴就是我1 天前
android 以maven的方式 引入本地的aar
android
过-眼-云-烟1 天前
新版Android Studio能打包但无法run ‘app‘,编译通过后手机中没有安装,顶部一直转圈
android·ide·android studio
hedalei1 天前
android14 硬键盘ESC改BACK按键返回无效问题
android·android14·esc·back按键
hcgeng1 天前
android 如何判定底部导航栏显示时 不是键盘显示
android·底部导航·导航高度
和煦的春风1 天前
性能案例分析 | Waiting for GPU completion
android·linux
用户2018792831671 天前
ConcurrentHashMap:用 “社区超市” 故事讲透并发的设计哲学
android