summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorZim <zezeozue@google.com>2020-09-22 16:00:33 +0100
committerAbhijeet Kaur <abkaur@google.com>2021-02-24 18:27:26 +0000
commite72059c0bd31b93191a1b5ccb9357b1a7bb88a90 (patch)
treecab9f5b30282ea6a13c204b4a469527d50f194fd /core
parentb9c396b87ac6ea085e5aeb040b3f3855dfcd4566 (diff)
Removed unused mount mode constants
Since FUSE in R, there are only 4 mount modes that are used from IVold.aidl: REMOUNT_MODE_NONE REMOUNT_MODE_DEFAULT REMOUNT_MODE_INSTALLER REMOUNT_MODE_PASS_THROUGH REMOUNT_MODE_ANDROID_WRITABLE Bug: 148454884 Test: Manual Change-Id: I62b66083f2099b429474872b6f9c7cffb9fb906d Merged-In: I62b66083f2099b429474872b6f9c7cffb9fb906d
Diffstat (limited to 'core')
-rw-r--r--core/java/android/os/ZygoteProcess.java8
-rw-r--r--core/java/com/android/internal/os/Zygote.java12
-rw-r--r--core/java/com/android/internal/os/ZygoteArguments.java10
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp50
4 files changed, 13 insertions, 67 deletions
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index 9e332e9b0456..06203ff15094 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -657,16 +657,8 @@ public class ZygoteProcess {
argsForZygote.add("--runtime-flags=" + runtimeFlags);
if (mountExternal == Zygote.MOUNT_EXTERNAL_DEFAULT) {
argsForZygote.add("--mount-external-default");
- } else if (mountExternal == Zygote.MOUNT_EXTERNAL_READ) {
- argsForZygote.add("--mount-external-read");
- } else if (mountExternal == Zygote.MOUNT_EXTERNAL_WRITE) {
- argsForZygote.add("--mount-external-write");
- } else if (mountExternal == Zygote.MOUNT_EXTERNAL_FULL) {
- argsForZygote.add("--mount-external-full");
} else if (mountExternal == Zygote.MOUNT_EXTERNAL_INSTALLER) {
argsForZygote.add("--mount-external-installer");
- } else if (mountExternal == Zygote.MOUNT_EXTERNAL_LEGACY) {
- argsForZygote.add("--mount-external-legacy");
} else if (mountExternal == Zygote.MOUNT_EXTERNAL_PASS_THROUGH) {
argsForZygote.add("--mount-external-pass-through");
} else if (mountExternal == Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE) {
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 65beb9360241..82e940be80a8 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -166,23 +166,11 @@ public final class Zygote {
public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE;
/** Default external storage should be mounted. */
public static final int MOUNT_EXTERNAL_DEFAULT = IVold.REMOUNT_MODE_DEFAULT;
- /** Read-only external storage should be mounted. */
- public static final int MOUNT_EXTERNAL_READ = IVold.REMOUNT_MODE_READ;
- /** Read-write external storage should be mounted. */
- public static final int MOUNT_EXTERNAL_WRITE = IVold.REMOUNT_MODE_WRITE;
- /**
- * Mount mode for apps that are already installed on the device before the isolated_storage
- * feature is enabled.
- */
- public static final int MOUNT_EXTERNAL_LEGACY = IVold.REMOUNT_MODE_LEGACY;
/**
* Mount mode for package installers which should give them access to
* all obb dirs in addition to their package sandboxes
*/
public static final int MOUNT_EXTERNAL_INSTALLER = IVold.REMOUNT_MODE_INSTALLER;
- /** Read-write external storage should be mounted instead of package sandbox */
- public static final int MOUNT_EXTERNAL_FULL = IVold.REMOUNT_MODE_FULL;
-
/** The lower file system should be bind mounted directly on external storage */
public static final int MOUNT_EXTERNAL_PASS_THROUGH = IVold.REMOUNT_MODE_PASS_THROUGH;
diff --git a/core/java/com/android/internal/os/ZygoteArguments.java b/core/java/com/android/internal/os/ZygoteArguments.java
index ed074327c3c5..32b808ab2528 100644
--- a/core/java/com/android/internal/os/ZygoteArguments.java
+++ b/core/java/com/android/internal/os/ZygoteArguments.java
@@ -380,16 +380,8 @@ class ZygoteArguments {
mNiceName = getAssignmentValue(arg);
} else if (arg.equals("--mount-external-default")) {
mMountExternal = Zygote.MOUNT_EXTERNAL_DEFAULT;
- } else if (arg.equals("--mount-external-read")) {
- mMountExternal = Zygote.MOUNT_EXTERNAL_READ;
- } else if (arg.equals("--mount-external-write")) {
- mMountExternal = Zygote.MOUNT_EXTERNAL_WRITE;
- } else if (arg.equals("--mount-external-full")) {
- mMountExternal = Zygote.MOUNT_EXTERNAL_FULL;
- } else if (arg.equals("--mount-external-installer")) {
+ } else if (arg.equals("--mount-external-installer")) {
mMountExternal = Zygote.MOUNT_EXTERNAL_INSTALLER;
- } else if (arg.equals("--mount-external-legacy")) {
- mMountExternal = Zygote.MOUNT_EXTERNAL_LEGACY;
} else if (arg.equals("--mount-external-pass-through")) {
mMountExternal = Zygote.MOUNT_EXTERNAL_PASS_THROUGH;
} else if (arg.equals("--mount-external-android-writable")) {
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 903ecaef4938..69a1ae1d202a 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -127,7 +127,6 @@ typedef const std::function<void(std::string)>& fail_fn_t;
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 const char kZygoteClassName[] = "com/android/internal/os/Zygote";
static jclass gZygoteClass;
static jmethodID gCallPostForkSystemServerHooks;
@@ -317,31 +316,15 @@ static std::array<UsapTableEntry, USAP_POOL_SIZE_MAX_LIMIT> gUsapTable;
static FileDescriptorTable* gOpenFdTable = nullptr;
// Must match values in com.android.internal.os.Zygote.
-// The order of entries here must be kept in sync with ExternalStorageViews array values.
+// Note that there are gaps in the constants:
+// This is to further keep the values consistent with IVold.aidl
enum MountExternalKind {
- MOUNT_EXTERNAL_NONE = 0,
- MOUNT_EXTERNAL_DEFAULT = 1,
- MOUNT_EXTERNAL_READ = 2,
- MOUNT_EXTERNAL_WRITE = 3,
- MOUNT_EXTERNAL_LEGACY = 4,
- MOUNT_EXTERNAL_INSTALLER = 5,
- MOUNT_EXTERNAL_FULL = 6,
- MOUNT_EXTERNAL_PASS_THROUGH = 7,
- MOUNT_EXTERNAL_ANDROID_WRITABLE = 8,
- MOUNT_EXTERNAL_COUNT = 9
-};
-
-// The order of entries here must be kept in sync with MountExternalKind enum values.
-static const std::array<const std::string, MOUNT_EXTERNAL_COUNT> ExternalStorageViews = {
- "", // MOUNT_EXTERNAL_NONE
- "/mnt/runtime/default", // MOUNT_EXTERNAL_DEFAULT
- "/mnt/runtime/read", // MOUNT_EXTERNAL_READ
- "/mnt/runtime/write", // MOUNT_EXTERNAL_WRITE
- "/mnt/runtime/write", // MOUNT_EXTERNAL_LEGACY
- "/mnt/runtime/write", // MOUNT_EXTERNAL_INSTALLER
- "/mnt/runtime/full", // MOUNT_EXTERNAL_FULL
- "/mnt/runtime/full", // MOUNT_EXTERNAL_PASS_THROUGH (only used w/ FUSE)
- "/mnt/runtime/full", // MOUNT_EXTERNAL_ANDROID_WRITABLE (only used w/ FUSE)
+ MOUNT_EXTERNAL_NONE = 0,
+ MOUNT_EXTERNAL_DEFAULT = 1,
+ MOUNT_EXTERNAL_INSTALLER = 5,
+ MOUNT_EXTERNAL_PASS_THROUGH = 7,
+ MOUNT_EXTERNAL_ANDROID_WRITABLE = 8,
+ MOUNT_EXTERNAL_COUNT = 9
};
// Must match values in com.android.internal.os.Zygote.
@@ -843,29 +826,20 @@ static void MountEmulatedStorage(uid_t uid, jint mount_mode,
PrepareDir(user_source, 0710, user_id ? AID_ROOT : AID_SHELL,
multiuser_get_uid(user_id, AID_EVERYBODY), fail_fn);
- bool isFuse = GetBoolProperty(kPropFuse, false);
bool isAppDataIsolationEnabled = GetBoolProperty(kVoldAppDataIsolation, false);
- if (isFuse) {
- if (mount_mode == MOUNT_EXTERNAL_PASS_THROUGH) {
+ if (mount_mode == MOUNT_EXTERNAL_PASS_THROUGH) {
const std::string pass_through_source = StringPrintf("/mnt/pass_through/%d", user_id);
PrepareDir(pass_through_source, 0710, AID_ROOT, AID_MEDIA_RW, fail_fn);
BindMount(pass_through_source, "/storage", fail_fn);
- } 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);
BindMount(installer_source, "/storage", fail_fn);
- } else if (isAppDataIsolationEnabled && mount_mode == MOUNT_EXTERNAL_ANDROID_WRITABLE) {
+ } 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 {
- BindMount(user_source, "/storage", fail_fn);
- }
} else {
- const std::string& storage_source = ExternalStorageViews[mount_mode];
- BindMount(storage_source, "/storage", fail_fn);
-
- // Mount user-specific symlink helper into place
- BindMount(user_source, "/storage/self", fail_fn);
+ BindMount(user_source, "/storage", fail_fn);
}
}