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

Commit 04fe67bb authored by Eric Biggers's avatar Eric Biggers Committed by android-build-merger
Browse files

Revert "With native FBE, lock user directories when framework is started"

am: 1127d92a

Change-Id: I5fe6104af582efe3cc0df0205c2b7c5833ea1843
parents 71079d97 1127d92a
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -929,20 +929,13 @@ class StorageManagerService extends IStorageManager.Stub
    private void initIfBootedAndConnected() {
        Slog.d(TAG, "Thinking about init, mBootCompleted=" + mBootCompleted
                + ", mDaemonConnected=" + mDaemonConnected);
        if (mBootCompleted && mDaemonConnected) {
            // Tell vold to lock or unlock the user directories based on the
            // current file-based encryption status.
            final boolean initLocked;
            if (StorageManager.isFileEncryptedNativeOrEmulated()) {
                // For native FBE this is a no-op after reboot, but this is
                // still needed in case of framework restarts.
                Slog.d(TAG, "FBE is enabled; ensuring all user directories are locked.");
                initLocked = true;
            } else {
                // This is in case FBE emulation was turned off.
                Slog.d(TAG, "FBE is disabled; ensuring the FBE emulation state is cleared.");
                initLocked = false;
            }
        if (mBootCompleted && mDaemonConnected
                && !StorageManager.isFileEncryptedNativeOnly()) {
            // When booting a device without native support, make sure that our
            // user directories are locked or unlocked based on the current
            // emulation status.
            final boolean initLocked = StorageManager.isFileEncryptedEmulatedOnly();
            Slog.d(TAG, "Setting up emulation state, initlocked=" + initLocked);
            final List<UserInfo> users = mContext.getSystemService(UserManager.class).getUsers();
            for (UserInfo user : users) {
                try {