Merge changes from topic "change_period" am: c0de6d8184 am: 3d81e0ba06 am: aa259e7ee0

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2043104

Change-Id: I93577a23c99808054e77e41948f5c0fb704c6dce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Utils.cpp b/Utils.cpp
index ba6afd8..e8049ed 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1765,5 +1765,15 @@
     return {std::move(fd), std::move(linkPath)};
 }
 
+bool IsFuseBpfEnabled() {
+    std::string bpf_override = android::base::GetProperty("persist.sys.fuse.bpf.override", "");
+    if (bpf_override == "true") {
+        return true;
+    } else if (bpf_override == "false") {
+        return false;
+    }
+    return base::GetBoolProperty("ro.fuse.bpf.enabled", false);
+}
+
 }  // namespace vold
 }  // namespace android
diff --git a/Utils.h b/Utils.h
index 71eb5eb..429669b 100644
--- a/Utils.h
+++ b/Utils.h
@@ -37,7 +37,6 @@
 
 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.override";
 
 static constexpr std::chrono::seconds kUntrustedFsckSleepTime(45);
 
@@ -206,6 +205,8 @@
 
 status_t PrepareAndroidDirs(const std::string& volumeRoot);
 
+bool IsFuseBpfEnabled();
+
 // Open a given directory as an FD, and return that and the corresponding procfs virtual
 // symlink path that can be used in any API that accepts a path string. Path stays valid until
 // the directory FD is closed.
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index 7c8a4e0..270d097 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -49,7 +49,7 @@
     mRawPath = rawPath;
     mLabel = "emulated";
     mFuseMounted = false;
-    mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
+    mFuseBpfEnabled = IsFuseBpfEnabled();
     mUseSdcardFs = IsSdcardfsUsed();
     mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
 }
@@ -61,7 +61,7 @@
     mRawPath = rawPath;
     mLabel = fsUuid;
     mFuseMounted = false;
-    mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
+    mFuseBpfEnabled = IsFuseBpfEnabled();
     mUseSdcardFs = IsSdcardfsUsed();
     mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
 }