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

Commit 56e4b9fb authored by Maunik Shah's avatar Maunik Shah Committed by Steve Kondik
Browse files

framework/base: get proper obb mountpoint based on user handle

Due to invalid obb mount point, CTS test case was failing to mount
obb file at /mnt/shell/emulated/0. Added new API to support user
based mount point for obb.

Change-Id: I9f113bd98ab3a4af00dd7f788b2dc3bc45627d6c
CRs-Fixed: 587497
parent 180efee1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -207,6 +207,10 @@ public class Environment {
            return buildPaths(mExternalDirsForApp, DIR_ANDROID, DIR_OBB);
        }

        public File[] buildExternalStorageAndroidObbDirsForVold() {
            return buildPaths(mExternalDirsForVold, DIR_ANDROID, DIR_OBB);
        }

        public File[] buildExternalStorageAppDataDirs(String packageName) {
            return buildPaths(mExternalDirsForApp, DIR_ANDROID, DIR_DATA, packageName);
        }
+3 −2
Original line number Diff line number Diff line
@@ -2792,10 +2792,11 @@ class MountService extends IMountService.Stub
        if (path.startsWith(obbPath)) {
            path = path.substring(obbPath.length() + 1);

            final UserEnvironment ownerEnv = new UserEnvironment(UserHandle.USER_OWNER);
            if (forVold) {
                return new File(Environment.getEmulatedStorageObbSource(), path).getAbsolutePath();
                return new File(ownerEnv.buildExternalStorageAndroidObbDirsForVold()[0], path)
                        .getAbsolutePath();
            } else {
                final UserEnvironment ownerEnv = new UserEnvironment(UserHandle.USER_OWNER);
                return new File(ownerEnv.buildExternalStorageAndroidObbDirs()[0], path)
                        .getAbsolutePath();
            }