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

Commit 3c5af93b authored by Eric Biggers's avatar Eric Biggers Committed by Android (Google) Code Review
Browse files

Merge changes I778b343a,I2af1e6ec

* changes:
  Use isFileEncrypted() instead of isFileEncryptedNativeOrEmulated()
  Use isFileEncrypted() instead of isFileEncryptedNativeOnly()
parents 959cbb00 9a076648
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
@@ -1456,7 +1456,7 @@ public class SystemConfig {

        // Some devices can be field-converted to FBE, so offer to splice in
        // those features if not already defined by the static config
        if (StorageManager.isFileEncryptedNativeOnly()) {
        if (StorageManager.isFileEncrypted()) {
            addFeature(PackageManager.FEATURE_FILE_BASED_ENCRYPTION, 0);
            addFeature(PackageManager.FEATURE_SECURELY_REMOVES_USERS, 0);
        }
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ public class DiskStatsService extends Binder {
        reportFreeSpace(Environment.getMetadataDirectory(), "Metadata", pw, proto,
                DiskStatsFreeSpaceProto.FOLDER_METADATA);

        boolean fileBased = StorageManager.isFileEncryptedNativeOnly();
        boolean fileBased = StorageManager.isFileEncrypted();
        if (protoFormat) {
            if (fileBased) {
                proto.write(DiskStatsServiceDumpProto.ENCRYPTION,
+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;
Loading