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

Commit 342b4bf3 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Snapshot isolated storage feature flag at boot.

The currently requested feature flag value may lag behind what's
actually active for the current boot, so take a snapshot of the value
that's being used for the current boot.

Bug: 121195267
Test: manual
Change-Id: I969f1d9d385e7610b366df41d2c7728a596d114c
parent b0c363b2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ public class StorageManager {
    public static final String PROP_VIRTUAL_DISK = "persist.sys.virtual_disk";
    /** {@hide} */
    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_FORCE_AUDIO = "persist.fw.force_audio";
@@ -1540,7 +1542,9 @@ public class StorageManager {
    /** {@hide} */
    @TestApi
    public static boolean hasIsolatedStorage() {
        return SystemProperties.getBoolean(PROP_ISOLATED_STORAGE, false);
        // Prefer to use snapshot for current boot when available
        return SystemProperties.getBoolean(PROP_ISOLATED_STORAGE_SNAPSHOT,
                SystemProperties.getBoolean(PROP_ISOLATED_STORAGE, false));
    }

    /**
+4 −0
Original line number Diff line number Diff line
@@ -1504,6 +1504,10 @@ class StorageManagerService extends IStorageManager.Stub
    public StorageManagerService(Context context) {
        sSelf = this;

        // Snapshot feature flag used for this boot
        SystemProperties.set(StorageManager.PROP_ISOLATED_STORAGE_SNAPSHOT, Boolean.toString(
                SystemProperties.getBoolean(StorageManager.PROP_ISOLATED_STORAGE, false)));

        mContext = context;
        mCallbacks = new Callbacks(FgThread.get().getLooper());
        mLockPatternUtils = new LockPatternUtils(mContext);