Skip to content

Commit 2bca868

Browse files
committed
Iteration on multi-user external storage.
Remove single-user bind mounts, since they need to remain as raw mounts to correctly propagate when remounted. This means we're back to using sdcard_r GID to enforce READ_EXTERNAL_STORAGE. Bug: 6925012 Change-Id: I41b5d7ddc985a5df2e288632a0a80d4724089e00
1 parent df5c3a5 commit 2bca868

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

core/java/android/os/Process.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,7 @@ private static ProcessStartResult startViaZygote(final String processClass,
582582
if ((debugFlags & Zygote.DEBUG_ENABLE_ASSERT) != 0) {
583583
argsForZygote.add("--enable-assert");
584584
}
585-
if (mountExternal == Zygote.MOUNT_EXTERNAL_SINGLEUSER) {
586-
argsForZygote.add("--mount-external-singleuser");
587-
} else if (mountExternal == Zygote.MOUNT_EXTERNAL_MULTIUSER) {
585+
if (mountExternal == Zygote.MOUNT_EXTERNAL_MULTIUSER) {
588586
argsForZygote.add("--mount-external-multiuser");
589587
}
590588
argsForZygote.add("--target-sdk-version=" + targetSdkVersion);

core/java/com/android/internal/os/ZygoteConnection.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,6 @@ private void parseArgs(String args[])
527527
"Duplicate arg specified");
528528
}
529529
niceName = arg.substring(arg.indexOf('=') + 1);
530-
} else if (arg.equals("--mount-external-singleuser")) {
531-
mountExternal = Zygote.MOUNT_EXTERNAL_SINGLEUSER;
532530
} else if (arg.equals("--mount-external-multiuser")) {
533531
mountExternal = Zygote.MOUNT_EXTERNAL_MULTIUSER;
534532
} else {

services/java/com/android/server/am/ActivityManagerService.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,18 +1982,13 @@ private final void startProcessLocked(ProcessRecord app,
19821982
try {
19831983
final PackageManager pm = mContext.getPackageManager();
19841984
gids = pm.getPackageGids(app.info.packageName);
1985-
if (pm.checkPermission(
1986-
android.Manifest.permission.READ_EXTERNAL_STORAGE, app.info.packageName)
1987-
== PERMISSION_GRANTED) {
1988-
if (Environment.isExternalStorageEmulated()) {
1989-
mountExternal = Zygote.MOUNT_EXTERNAL_MULTIUSER;
1990-
} else {
1991-
mountExternal = Zygote.MOUNT_EXTERNAL_SINGLEUSER;
1992-
}
1993-
}
19941985
} catch (PackageManager.NameNotFoundException e) {
19951986
Slog.w(TAG, "Unable to retrieve gids", e);
19961987
}
1988+
1989+
if (Environment.isExternalStorageEmulated()) {
1990+
mountExternal = Zygote.MOUNT_EXTERNAL_MULTIUSER;
1991+
}
19971992
}
19981993
if (mFactoryTest != SystemServer.FACTORY_TEST_OFF) {
19991994
if (mFactoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL

0 commit comments

Comments
 (0)