Snapshot persist.sys.fuse into sys.fuse_snapshot

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: I4424770926f98bccda06dab6a447ee5637e5eb6e
This commit is contained in:
shafik
2019-09-25 13:50:04 +01:00
parent 781e42dda4
commit 78fcd5049b
2 changed files with 10 additions and 2 deletions

View File

@@ -153,6 +153,11 @@ public class StorageManager {
public static final String PROP_ISOLATED_STORAGE = "persist.sys.isolated_storage";
/** {@hide} */
public static final String PROP_ISOLATED_STORAGE_SNAPSHOT = "sys.isolated_storage_snapshot";
/** {@hide} */
public static final String PROP_FUSE = "persist.sys.fuse";
/** {@hide} */
public static final String PROP_FUSE_SNAPSHOT = "sys.fuse_snapshot";
/** {@hide} */
public static final String UUID_PRIVATE_INTERNAL = null;

View File

@@ -197,7 +197,7 @@ class StorageManagerService extends IStorageManager.Stub
"persist.sys.zram_enabled";
private static final boolean IS_FUSE_ENABLED =
SystemProperties.getBoolean("persist.sys.fuse", false);
SystemProperties.getBoolean(StorageManager.PROP_FUSE, false);
private static final boolean ENABLE_ISOLATED_STORAGE = StorageManager.hasIsolatedStorage();
@@ -1526,6 +1526,9 @@ class StorageManagerService extends IStorageManager.Stub
SystemProperties.set(StorageManager.PROP_ISOLATED_STORAGE_SNAPSHOT, Boolean.toString(
SystemProperties.getBoolean(StorageManager.PROP_ISOLATED_STORAGE, true)));
SystemProperties.set(StorageManager.PROP_FUSE_SNAPSHOT, Boolean.toString(
SystemProperties.getBoolean(StorageManager.PROP_FUSE, false)));
mContext = context;
mResolver = mContext.getContentResolver();
@@ -1858,7 +1861,7 @@ class StorageManagerService extends IStorageManager.Stub
// This means the mountUserId on such volumes is USER_NULL. This breaks fuse which
// requires a valid user to mount a volume. Create individual volumes per user in vold
// and remove this property check
int userId = SystemProperties.getBoolean("persist.sys.fuse", false)
int userId = SystemProperties.getBoolean(StorageManager.PROP_FUSE_SNAPSHOT, false)
? mCurrentUserId : vol.mountUserId;
return mVold.mount(vol.id, vol.mountFlags, userId);
} catch (Exception e) {