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

Commit 9a076648 authored by Eric Biggers's avatar Eric Biggers
Browse files

Use isFileEncrypted() instead of isFileEncryptedNativeOrEmulated()

Since emulated FBE is no longer supported,
isFileEncryptedNativeOrEmulated() is the same as the new method
isFileEncrypted().  Replace all occurrences of
isFileEncryptedNativeOrEmulated() in this repository with
isFileEncrypted().

Bug: 232458753
Change-Id: I778b343adc85e5e6a45023f588eac509e3d93dd2
parent 295d5556
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -764,7 +764,7 @@ public class LockPatternUtils {
     * @return true if device is file encrypted
     */
    public static boolean isFileEncryptionEnabled() {
        return StorageManager.isFileEncryptedNativeOrEmulated();
        return StorageManager.isFileEncrypted();
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }

        // Suppress all notifications on non-FBE devices for now
        if (!StorageManager.isFileEncryptedNativeOrEmulated()) return;
        if (!StorageManager.isFileEncrypted()) return;

        unlockIntent.setFlags(
                Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+3 −4
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ final class AppDataHelper {
     * requested by the app.
     */
    private boolean maybeMigrateAppDataLIF(AndroidPackage pkg, int userId) {
        if (pkg.isSystem() && !StorageManager.isFileEncryptedNativeOrEmulated()
        if (pkg.isSystem() && !StorageManager.isFileEncrypted()
                && PackageManager.APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) {
            final int storageTarget = pkg.isDefaultToDeviceProtectedStorage()
                    ? StorageManager.FLAG_STORAGE_DE : StorageManager.FLAG_STORAGE_CE;
@@ -390,8 +390,7 @@ final class AppDataHelper {
        // First look for stale data that doesn't belong, and check if things
        // have changed since we did our last restorecon
        if ((flags & StorageManager.FLAG_STORAGE_CE) != 0) {
            if (StorageManager.isFileEncryptedNativeOrEmulated()
                    && !StorageManager.isUserKeyUnlocked(userId)) {
            if (StorageManager.isFileEncrypted() && !StorageManager.isUserKeyUnlocked(userId)) {
                throw new RuntimeException(
                        "Yikes, someone asked us to reconcile CE storage while " + userId
                                + " was still locked; this would have caused massive data loss!");
@@ -493,7 +492,7 @@ final class AppDataHelper {
     */
    public Future<?> fixAppsDataOnBoot() {
        final @StorageManager.StorageFlags int storageFlags;
        if (StorageManager.isFileEncryptedNativeOrEmulated()) {
        if (StorageManager.isFileEncrypted()) {
            storageFlags = StorageManager.FLAG_STORAGE_DE;
        } else {
            storageFlags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;
+1 −2
Original line number Diff line number Diff line
@@ -180,8 +180,7 @@ public final class MovePackageHelper {
        // If we're moving app data around, we need all the users unlocked
        if (moveCompleteApp) {
            for (int userId : installedUserIds) {
                if (StorageManager.isFileEncryptedNativeOrEmulated()
                        && !StorageManager.isUserKeyUnlocked(userId)) {
                if (StorageManager.isFileEncrypted() && !StorageManager.isUserKeyUnlocked(userId)) {
                    freezer.close();
                    throw new PackageManagerException(MOVE_FAILED_LOCKED_USER,
                            "User " + userId + " must be unlocked");
+1 −2
Original line number Diff line number Diff line
@@ -270,7 +270,6 @@ public class AppDataRollbackHelper {
     */
    @VisibleForTesting
    public boolean isUserCredentialLocked(int userId) {
        return StorageManager.isFileEncryptedNativeOrEmulated()
                && !StorageManager.isUserKeyUnlocked(userId);
        return StorageManager.isFileEncrypted() && !StorageManager.isUserKeyUnlocked(userId);
    }
}