把androID P上被谷歌架空的media write权限补回来,解决外置存储卡复制、移动等 *** 作,提示需要root权限的问题。
frameworks/base/data/etc/platform.xml <permission name="androID.permission.WRITE_MEDIA_STORAGE" > <group gID="sdcard_r" /> <group gID="sdcard_rw" /> <group gID="sdcard_all" /> <group gID="media_rw" /> </permission>frameworks/base/services/core/java/com/androID/server/pm/PackageManagerService.java@OverrIDepublic voID systemReady() {... StorageManagerInternal.addExternalStoragePolicy( new StorageManagerInternal.ExternalStorageMountPolicy() { @OverrIDe public int getMountMode(int uID, String packagename) { if (Process.isIsolated(uID)) { return Zygote.MOUNT_EXTERNAL_NONE; } // +{ for BUG if (checkUIDPermission(WRITE_MEDIA_STORAGE, uID) == PERMISSION_GRANTED) { return Zygote.MOUNT_EXTERNAL_DEFAulT; } // + } for BUG if (checkUIDPermission(READ_EXTERNAL_STORAGE, uID) == PERMISSION_DENIED) { return Zygote.MOUNT_EXTERNAL_DEFAulT; } if (checkUIDPermission(WRITE_EXTERNAL_STORAGE, uID) == PERMISSION_DENIED) { return Zygote.MOUNT_EXTERNAL_READ; } return Zygote.MOUNT_EXTERNAL_WRITE; } }...}
总结 以上是内存溢出为你收集整理的android sd卡权限全部内容,希望文章能够帮你解决android sd卡权限所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)