From 80f0223307c96bddb55c693d9e194c8f096bbc59 Mon Sep 17 00:00:00 2001 From: Nandana Dutt Date: Wed, 18 Mar 2020 14:21:55 +0000 Subject: [PATCH] Remove mount hack Now that fuse is default, this hack can be removed BUG: 147137425 Test: manual, R targeting app with requestLegacyExternalStorage can access file paths. Test: atest CtsDeqpTestCases Test: atest RestrictedPermissionsTest Test: atest RestrictedStoragePermissionSharedUidTest Change-Id: Iafa69be2624427d41b844c943d41d0b72707a1e7 --- .../com/android/server/StorageManagerService.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index b7d050a25484c..722b8c4de6969 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -4088,19 +4088,6 @@ class StorageManagerService extends IStorageManager.Stub boolean hasLegacy = mIAppOpsService.checkOperation(OP_LEGACY_STORAGE, uid, packageName) == MODE_ALLOWED; - // Hack(b/147137425): we have to honor hasRequestedLegacyExternalStorage for a short - // while to enable 2 cases. - // 1) Apps that want to be in scoped storage in R, but want to opt out in Q devices, - // because they want to use raw file paths, would fail until fuse is enabled by default. - // 2) Test apps that target current sdk will fail. They would fail even after fuse is - // enabled, but we are fixing it with b/142395442. We are not planning to enable - // fuse by default until b/142395442 is fixed. - if (!hasLegacy && !mIsFuseEnabled) { - ApplicationInfo ai = mIPackageManager.getApplicationInfo(packageName, - 0, UserHandle.getUserId(uid)); - hasLegacy = (ai != null && ai.hasRequestedLegacyExternalStorage()); - } - if (hasLegacy && hasWrite) { return Zygote.MOUNT_EXTERNAL_WRITE; } else if (hasLegacy && hasRead) {