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

Commit b193b4ac authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Mount /storage to /mnt/androidwritable for...

Merge "Merge "Mount /storage to /mnt/androidwritable for MOUNT_EXTERNAL_ANDROID_WRITABLE apps" into rvc-dev am: fb2186cd am: ba994026 am: a5db2fc1" into rvc-qpr-dev-plus-aosp am: fba528ad

Change-Id: Id805c0fb74fec796077df153631d0bf331e3cc0d
parents 321f3a2e fba528ad
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -122,6 +122,7 @@ typedef const std::function<void(std::string)>& fail_fn_t;


static pid_t gSystemServerPid = 0;
static pid_t gSystemServerPid = 0;


static constexpr const char* kVoldAppDataIsolation = "persist.sys.vold_app_data_isolation_enabled";
static constexpr const char* kPropFuse = "persist.sys.fuse";
static constexpr const char* kPropFuse = "persist.sys.fuse";
static const char kZygoteClassName[] = "com/android/internal/os/Zygote";
static const char kZygoteClassName[] = "com/android/internal/os/Zygote";
static jclass gZygoteClass;
static jclass gZygoteClass;
@@ -836,6 +837,7 @@ static void MountEmulatedStorage(uid_t uid, jint mount_mode,
             multiuser_get_uid(user_id, AID_EVERYBODY), fail_fn);
             multiuser_get_uid(user_id, AID_EVERYBODY), fail_fn);


  bool isFuse = GetBoolProperty(kPropFuse, false);
  bool isFuse = GetBoolProperty(kPropFuse, false);
  bool isAppDataIsolationEnabled = GetBoolProperty(kVoldAppDataIsolation, false);


  if (isFuse) {
  if (isFuse) {
    if (mount_mode == MOUNT_EXTERNAL_PASS_THROUGH) {
    if (mount_mode == MOUNT_EXTERNAL_PASS_THROUGH) {
@@ -845,6 +847,9 @@ static void MountEmulatedStorage(uid_t uid, jint mount_mode,
    } else if (mount_mode == MOUNT_EXTERNAL_INSTALLER) {
    } else if (mount_mode == MOUNT_EXTERNAL_INSTALLER) {
      const std::string installer_source = StringPrintf("/mnt/installer/%d", user_id);
      const std::string installer_source = StringPrintf("/mnt/installer/%d", user_id);
      BindMount(installer_source, "/storage", fail_fn);
      BindMount(installer_source, "/storage", fail_fn);
    } else if (isAppDataIsolationEnabled && mount_mode == MOUNT_EXTERNAL_ANDROID_WRITABLE) {
      const std::string writable_source = StringPrintf("/mnt/androidwritable/%d", user_id);
      BindMount(writable_source, "/storage", fail_fn);
    } else {
    } else {
      BindMount(user_source, "/storage", fail_fn);
      BindMount(user_source, "/storage", fail_fn);
    }
    }