Fixup SDCARD_RW GID for multi-user.

sdcardfs takes the user-id into account when synthesizing the GID for
package-specific data/obb directories; so make sure we grant the GID
based on user-id as well.

Bug: 148094468
Test: OBB installs as secondary users works
Change-Id: Ibd73d8f2ef7dda14605a6095671a587c2316fc90
This commit is contained in:
Martijn Coenen
2020-01-23 16:56:10 +01:00
parent 1df5bd7630
commit 8b3bbeeb30

View File

@@ -1574,7 +1574,7 @@ public final class ProcessList {
}
if (mountExternal == Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE) {
// For DownloadProviders and MTP: To grant access to /sdcard/Android/
gidList.add(Process.SDCARD_RW_GID);
gidList.add(UserHandle.getUid(UserHandle.getUserId(uid), Process.SDCARD_RW_GID));
}
if (mountExternal == Zygote.MOUNT_EXTERNAL_PASS_THROUGH) {
// For the FUSE daemon: To grant access to the lower filesystem.