Merge "Remove StubVolume disks upon vold reset events"
diff --git a/Android.bp b/Android.bp
index d9d6e12..1550264 100644
--- a/Android.bp
+++ b/Android.bp
@@ -107,6 +107,7 @@
defaults: [
"vold_default_flags",
"vold_default_libs",
+ "keystore2_use_latest_aidl_ndk_shared",
],
srcs: [
@@ -164,7 +165,6 @@
shared_libs: [
"android.hardware.health.storage@1.0",
"android.hardware.health.storage-V1-ndk",
- "android.system.keystore2-V1-ndk",
"android.security.maintenance-ndk",
"libbinder_ndk",
"libkeymint_support",
@@ -180,6 +180,7 @@
defaults: [
"vold_default_flags",
"vold_default_libs",
+ "keystore2_use_latest_aidl_ndk_shared",
],
srcs: ["main.cpp"],
@@ -197,7 +198,6 @@
shared_libs: [
"android.hardware.health.storage@1.0",
"android.hardware.health.storage-V1-ndk",
- "android.system.keystore2-V1-ndk",
"android.security.maintenance-ndk",
"libbinder_ndk",
"libkeymint_support",
diff --git a/Utils.h b/Utils.h
index bb6615c..df322b8 100644
--- a/Utils.h
+++ b/Utils.h
@@ -36,6 +36,7 @@
static const char* kVoldAppDataIsolationEnabled = "persist.sys.vold_app_data_isolation_enabled";
static const char* kExternalStorageSdcardfs = "external_storage.sdcardfs.enabled";
+static const char* kFuseBpfEnabled = "persist.sys.fuse.bpf.enable";
/* SELinux contexts used depending on the block device type */
extern char* sBlkidContext;
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index b686437..7c8a4e0 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -49,6 +49,7 @@
mRawPath = rawPath;
mLabel = "emulated";
mFuseMounted = false;
+ mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
mUseSdcardFs = IsSdcardfsUsed();
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
}
@@ -60,6 +61,7 @@
mRawPath = rawPath;
mLabel = fsUuid;
mFuseMounted = false;
+ mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
mUseSdcardFs = IsSdcardfsUsed();
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
}
@@ -359,10 +361,12 @@
}
}
- // Only do the bind-mounts when we know for sure the FUSE daemon can resolve the path.
- res = mountFuseBindMounts();
- if (res != OK) {
- return res;
+ if (!mFuseBpfEnabled) {
+ // Only do the bind-mounts when we know for sure the FUSE daemon can resolve the path.
+ res = mountFuseBindMounts();
+ if (res != OK) {
+ return res;
+ }
}
ConfigureReadAheadForFuse(GetFuseMountPathForUser(user_id, label), 256u);
@@ -416,9 +420,11 @@
if (mFuseMounted) {
std::string label = getLabel();
- // Ignoring unmount return status because we do want to try to unmount
- // the rest cleanly.
- unmountFuseBindMounts();
+ if (!mFuseBpfEnabled) {
+ // Ignoring unmount return status because we do want to try to
+ // unmount the rest cleanly.
+ unmountFuseBindMounts();
+ }
if (UnmountUserFuse(userId, getInternalPath(), label) != OK) {
PLOG(INFO) << "UnmountUserFuse failed on emulated fuse volume";
diff --git a/model/EmulatedVolume.h b/model/EmulatedVolume.h
index 1d2385d..0f39fbd 100644
--- a/model/EmulatedVolume.h
+++ b/model/EmulatedVolume.h
@@ -64,6 +64,9 @@
/* Whether we mounted FUSE for this volume */
bool mFuseMounted;
+ /* Whether the FUSE BPF feature is enabled */
+ bool mFuseBpfEnabled;
+
/* Whether to use sdcardfs for this volume */
bool mUseSdcardFs;