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

Commit 8d13df6a authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge changes Ib5bcfb6a,I46c2a472,If0c75774 into tm-dev am: 83645e6d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17125924

Change-Id: Ibbe5bc93b56ef9d0a645f802986e76580a09f46d
parents 9e490e78 83645e6d
Loading
Loading
Loading
Loading
+4 −21
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.provider.MediaStore;
import android.provider.Settings;
import android.sysprop.VoldProperties;
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
@@ -1739,11 +1738,8 @@ public class StorageManager {
     *         false not encrypted or file encrypted
     */
    public static boolean isBlockEncrypted() {
        if (!isEncrypted()) {
        return false;
    }
        return RoSystemProperties.CRYPTO_BLOCK_ENCRYPTED;
    }

    /** {@hide}
     * Is this device block encrypted with credentials?
@@ -1752,20 +1748,9 @@ public class StorageManager {
     *         false not encrypted, file encrypted or default block encrypted
     */
    public static boolean isNonDefaultBlockEncrypted() {
        if (!isBlockEncrypted()) {
        return false;
    }

        try {
            IStorageManager storageManager = IStorageManager.Stub.asInterface(
                    ServiceManager.getService("mount"));
            return storageManager.getPasswordType() != CRYPT_TYPE_DEFAULT;
        } catch (RemoteException e) {
            Log.e(TAG, "Error getting encryption type");
            return false;
        }
    }

    /** {@hide}
     * Is this device in the process of being block encrypted?
     * @return true for encrypting.
@@ -1777,8 +1762,7 @@ public class StorageManager {
     * framework, so no service needs to check for changes during their lifespan
     */
    public static boolean isBlockEncrypting() {
        final String state = VoldProperties.encrypt_progress().orElse("");
        return !"".equalsIgnoreCase(state);
        return false;
    }

    /** {@hide}
@@ -1793,8 +1777,7 @@ public class StorageManager {
     * framework, so no service needs to check for changes during their lifespan
     */
    public static boolean inCryptKeeperBounce() {
        final String status = VoldProperties.decrypt().orElse("");
        return "trigger_restart_min_framework".equals(status);
        return false;
    }

    /** {@hide} */