Merge "Restrict access_mtp permission access to Android/"
This commit is contained in:
committed by
Android (Google) Code Review
commit
19fd3c80f5
@@ -3942,8 +3942,12 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
final boolean hasMtp = mIPackageManager.checkUidPermission(ACCESS_MTP, uid) ==
|
||||
PERMISSION_GRANTED;
|
||||
if (mIsFuseEnabled && hasMtp) {
|
||||
// The process hosting the MTP server should be able to write in Android/
|
||||
return Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if caller is holding runtime permission
|
||||
|
||||
Reference in New Issue
Block a user