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

Commit daff51d0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents e068a20e ed7a2c16
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
@@ -2751,10 +2751,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();
            }