现象
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>