Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b499a06 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Always copy value from DeviceConfig.

The value could have been set during a previous boot, before we
started watching for dynamic changes, so always pick up the current
value from DeviceConfig.

Bug: 112545973
Test: manual
Change-Id: I84fe655718ee444f073f53d53af246baf96e04fa
parent 87969723
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -802,10 +802,7 @@ class StorageManagerService extends IStorageManager.Stub
        // For now, simply clone property when it changes
        DeviceConfig.addOnPropertyChangedListener(DeviceConfig.Storage.NAMESPACE,
                mContext.getMainExecutor(), (namespace, name, value) -> {
                    if (DeviceConfig.Storage.ISOLATED_STORAGE_ENABLED.equals(name)) {
                        Settings.Global.putString(mResolver,
                                Settings.Global.ISOLATED_STORAGE_REMOTE, value);
                    }
                    refreshIsolatedStorageSettings();
                });
        refreshIsolatedStorageSettings();
    }
@@ -840,6 +837,12 @@ class StorageManagerService extends IStorageManager.Stub
    }

    private void refreshIsolatedStorageSettings() {
        // Always copy value from newer DeviceConfig location
        Settings.Global.putString(mResolver,
                Settings.Global.ISOLATED_STORAGE_REMOTE,
                DeviceConfig.getProperty(DeviceConfig.Storage.NAMESPACE,
                        DeviceConfig.Storage.ISOLATED_STORAGE_ENABLED));

        final int local = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.ISOLATED_STORAGE_LOCAL, 0);
        final int remote = Settings.Global.getInt(mContext.getContentResolver(),