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

Commit da8df986 authored by Zim's avatar Zim
Browse files

Grant apps with pass_through mount mode media_rw gid

This is necessary to allow the FUSE daemon access to the lower
filesystem on devices without sdcardfs

Test: FUSE daemon has media_rw gid
Bug: 144914977
Change-Id: I2ed3ab00fa1a4293703e1d066283334cadd1cd49
parent 3982e546
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1574,8 +1574,15 @@ public final class ProcessList {
            gidList.add(userGid);
        }
        if (mountExternal == Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE) {
            // For DownloadProviders and MTP: To grant access to /sdcard/Android/
            gidList.add(Process.SDCARD_RW_GID);
        }
        if (mountExternal == Zygote.MOUNT_EXTERNAL_PASS_THROUGH) {
            // For the FUSE daemon: To grant access to the lower filesystem.
            // EmulatedVolumes: /data/media and /mnt/expand/<volume>/data/media
            // PublicVolumes: /mnt/media_rw/<volume>
            gidList.add(Process.MEDIA_RW_GID);
        }
        if (packageName.equals("com.android.externalstorage")) {
            // Allows access to 'unreliable' (USB OTG) volumes via SAF
            gidList.add(Process.MEDIA_RW_GID);