diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 90ad2da6fb184..ac9e636adb2a0 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -346,6 +346,11 @@ static bool MountEmulatedStorage(uid_t uid, jint mount_mode, return false; } + // Handle force_mount_namespace with MOUNT_EXTERNAL_NONE. + if (mount_mode == MOUNT_EXTERNAL_NONE) { + return true; + } + if (TEMP_FAILURE_RETRY(mount(storageSource.string(), "/storage", NULL, MS_BIND | MS_REC | MS_SLAVE, NULL)) == -1) { ALOGW("Failed to mount %s to /storage: %s", storageSource.string(), strerror(errno));