diff options
-rw-r--r-- | services/core/java/com/android/server/StorageManagerService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index e17dde9a766e..a08bdb23dd22 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -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 |