Use snapshot value sys.fuse_snapshot instead of persist.sys.fuse
This will allow us to receive values from server flags and store them in
persist.sys.fuse without risking flag consistency during a boot.
Test: manual - flip persist.sys.fuse both ways and make sure FuseDaemon
works as expected.
Bug: 140803239
Change-Id: I839a1973c98b4eda982226d20be48d1c08e7464a
diff --git a/Utils.h b/Utils.h
index e0102a7..f607c81 100644
--- a/Utils.h
+++ b/Utils.h
@@ -34,7 +34,7 @@
namespace android {
namespace vold {
-static const char* kPropFuse = "persist.sys.fuse";
+static const char* kPropFuseSnapshot = "sys.fuse_snapshot";
/* SELinux contexts used depending on the block device type */
extern security_context_t sBlkidContext;
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index adb4a5c..5b23116 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -382,7 +382,7 @@
}
int VolumeManager::linkPrimary(userid_t userId) {
- bool isFuse = GetBoolProperty(android::vold::kPropFuse, false);
+ bool isFuse = GetBoolProperty(android::vold::kPropFuseSnapshot, false);
if (isFuse) {
// Here we have to touch /mnt/user/userid>/<volumeid> which was already mounted as part of
@@ -464,7 +464,7 @@
}
int VolumeManager::remountUid(uid_t uid, int32_t mountMode) {
- if (GetBoolProperty(android::vold::kPropFuse, false)) {
+ if (GetBoolProperty(android::vold::kPropFuseSnapshot, false)) {
// TODO(135341433): Implement fuse specific logic.
return 0;
}
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index 022ff42..41f42d1 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -84,7 +84,7 @@
dev_t before = GetDevice(mFuseFull);
- bool isFuse = base::GetBoolProperty(kPropFuse, false);
+ bool isFuse = base::GetBoolProperty(kPropFuseSnapshot, false);
if (isFuse) {
LOG(INFO) << "Mounting emulated fuse volume";
@@ -150,7 +150,7 @@
// error code and might cause broken behaviour in applications.
KillProcessesUsingPath(getPath());
- bool isFuse = base::GetBoolProperty(kPropFuse, false);
+ bool isFuse = base::GetBoolProperty(kPropFuseSnapshot, false);
if (isFuse) {
// We could have migrated storage to an adopted private volume, so always
// call primary storage "emulated" to avoid media rescans.
diff --git a/model/PublicVolume.cpp b/model/PublicVolume.cpp
index ebcb91a..3f003a9 100644
--- a/model/PublicVolume.cpp
+++ b/model/PublicVolume.cpp
@@ -169,7 +169,7 @@
dev_t before = GetDevice(mFuseFull);
- bool isFuse = base::GetBoolProperty(kPropFuse, false);
+ bool isFuse = base::GetBoolProperty(kPropFuseSnapshot, false);
if (isFuse) {
LOG(INFO) << "Mounting public fuse volume";
@@ -245,7 +245,7 @@
// error code and might cause broken behaviour in applications.
KillProcessesUsingPath(getPath());
- bool isFuse = base::GetBoolProperty(kPropFuse, false);
+ bool isFuse = base::GetBoolProperty(kPropFuseSnapshot, false);
if (isFuse) {
// Use UUID as stable name, if available
std::string stableName = getId();