diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index a04f25b0d20c6..ffdaa65eb91a4 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -3941,8 +3941,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