Loading services/core/java/com/android/server/StorageManagerService.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -3942,9 +3942,13 @@ class StorageManagerService extends IStorageManager.Stub final boolean hasMtp = mIPackageManager.checkUidPermission(ACCESS_MTP, uid) == final boolean hasMtp = mIPackageManager.checkUidPermission(ACCESS_MTP, uid) == PERMISSION_GRANTED; PERMISSION_GRANTED; if (mIsFuseEnabled && hasMtp) { if (mIsFuseEnabled && hasMtp) { // The process hosting the MTP server should be able to write in Android/ ApplicationInfo ai = mIPackageManager.getApplicationInfo(packageName, 0, UserHandle.getUserId(uid)); if (ai.isSignedWithPlatformKey()) { // Platform processes hosting the MTP server should be able to write in Android/ return Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE; return Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE; } } } // Determine if caller is holding runtime permission // Determine if caller is holding runtime permission final boolean hasRead = StorageManager.checkPermissionAndCheckOp(mContext, false, 0, final boolean hasRead = StorageManager.checkPermissionAndCheckOp(mContext, false, 0, Loading Loading
services/core/java/com/android/server/StorageManagerService.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -3942,9 +3942,13 @@ class StorageManagerService extends IStorageManager.Stub final boolean hasMtp = mIPackageManager.checkUidPermission(ACCESS_MTP, uid) == final boolean hasMtp = mIPackageManager.checkUidPermission(ACCESS_MTP, uid) == PERMISSION_GRANTED; PERMISSION_GRANTED; if (mIsFuseEnabled && hasMtp) { if (mIsFuseEnabled && hasMtp) { // The process hosting the MTP server should be able to write in Android/ ApplicationInfo ai = mIPackageManager.getApplicationInfo(packageName, 0, UserHandle.getUserId(uid)); if (ai.isSignedWithPlatformKey()) { // Platform processes hosting the MTP server should be able to write in Android/ return Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE; return Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE; } } } // Determine if caller is holding runtime permission // Determine if caller is holding runtime permission final boolean hasRead = StorageManager.checkPermissionAndCheckOp(mContext, false, 0, final boolean hasRead = StorageManager.checkPermissionAndCheckOp(mContext, false, 0, Loading