From 10c5655ea3a75513286c6bfc2bba388742b01855 Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Wed, 4 Dec 2019 14:17:40 +0000 Subject: [PATCH] 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 --- .../core/java/com/android/server/StorageManagerService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index 7639c4d60c456..9e81ea678382f 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -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() {