Enable second reboot for FUSE sys prop change to take effect

Regression from http://ag/9759956. System properties change was as
expected but the mounts (fuse vs sdcardfs) change was not as expected.

Second reboot was failing as it was too early in the boot phase to
reboot. Reboot can only be called after systemReady() phase, fix by
calling reboot after bootCompleted() for the first reboot.

Bug: 144419848
Test: Using adb command to change the fuse system property.
      * `adb shell setprop persist.sys.fflag.override.settings_fuse
         true && adb reboot`
      * After reboot run `adb shell getprop persist.sys.fuse` shows true
      * `adb shell ls /sdcard` should be accessible.
      * `adb shell cat /proc/mounts` should have
        `/dev/fuse/storage/emulated fuse`
      * Similarly for false case.
        `adb shell setprop persist.sys.fflag.override.settings_fuse false
         && adb reboot`
      * After reboot run `adb shell getprop persist.sys.fuse` shows
        false.
      * `adb shell ls /sdcard` should be accessible.
      * `adb shell cat /proc/mounts` should have
        `/data/media /storage/emulated sdcardfs`.

Change-Id: I986fa1168b46091009a9dfe9fd04e0d0f5b6efa4
This commit is contained in:
Abhijeet Kaur
2019-12-04 14:17:40 +00:00
parent b984771e99
commit 10c5655ea3

View File

@@ -1557,8 +1557,6 @@ class StorageManagerService extends IStorageManager.Stub
public StorageManagerService(Context context) {
sSelf = this;
updateFusePropFromSettings();
// Snapshot feature flag used for this boot
SystemProperties.set(StorageManager.PROP_ISOLATED_STORAGE_SNAPSHOT, Boolean.toString(
SystemProperties.getBoolean(StorageManager.PROP_ISOLATED_STORAGE, true)));
@@ -1758,6 +1756,7 @@ class StorageManagerService extends IStorageManager.Stub
private void bootCompleted() {
mBootCompleted = true;
mHandler.obtainMessage(H_BOOT_COMPLETED).sendToTarget();
updateFusePropFromSettings();
}
private void handleBootCompleted() {