Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ebbd460 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Temporarily grant legacy storage to certain apps.

We've gone to great lengths to return "_data" columns that can be
successfully opened from managed code, which is thankfully how most
apps are working with media.

However, a small handful of apps appear to be passing these "_data"
paths down into native code, where we can't hook the open() syscall.

The only workaround we have is to grant these apps the "legacy"
storage view (meaning they can see the entire storage device), until
those developers can update their apps.

Bug: 124818022, 123996076, 124767356, 124531483
Test: manual
Change-Id: I995520e7c0071075dcae9daa8f311f17a187ae1b
parent befee0b6
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -3688,8 +3688,17 @@ class StorageManagerService extends IStorageManager.Stub
            } else if (mPmInternal.isInstantApp(packageName, UserHandle.getUserId(uid))) {
                return Zygote.MOUNT_EXTERNAL_NONE;
            } else {
                // STOPSHIP: remove this temporary workaround once developers
                // fix bugs where they're opening _data paths in native code
                switch (packageName) {
                    case "com.facebook.katana": // b/123996076
                    case "jp.naver.line.android": // b/124767356
                    case "com.mxtech.videoplayer.ad": // b/124531483
                        return Zygote.MOUNT_EXTERNAL_LEGACY;
                    default:
                        return Zygote.MOUNT_EXTERNAL_WRITE;
                }
            }
        } catch (RemoteException e) {
            // Should not happen
        }