Merge "Stop using FDE-related constants from IVold" am: 489ba5ac07 am: 84f05b1b9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2031025 Change-Id: Id7be68ef1c367fb461236a0c14b4dbb8e0ca5bdd
This commit is contained in:
@@ -286,28 +286,7 @@ public class StorageManager {
|
|||||||
|
|
||||||
/** @hide The volume is not encrypted. */
|
/** @hide The volume is not encrypted. */
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public static final int ENCRYPTION_STATE_NONE =
|
public static final int ENCRYPTION_STATE_NONE = 1;
|
||||||
IVold.ENCRYPTION_STATE_NONE;
|
|
||||||
|
|
||||||
/** @hide The volume has been encrypted succesfully. */
|
|
||||||
public static final int ENCRYPTION_STATE_OK =
|
|
||||||
IVold.ENCRYPTION_STATE_OK;
|
|
||||||
|
|
||||||
/** @hide The volume is in a bad state. */
|
|
||||||
public static final int ENCRYPTION_STATE_ERROR_UNKNOWN =
|
|
||||||
IVold.ENCRYPTION_STATE_ERROR_UNKNOWN;
|
|
||||||
|
|
||||||
/** @hide Encryption is incomplete */
|
|
||||||
public static final int ENCRYPTION_STATE_ERROR_INCOMPLETE =
|
|
||||||
IVold.ENCRYPTION_STATE_ERROR_INCOMPLETE;
|
|
||||||
|
|
||||||
/** @hide Encryption is incomplete and irrecoverable */
|
|
||||||
public static final int ENCRYPTION_STATE_ERROR_INCONSISTENT =
|
|
||||||
IVold.ENCRYPTION_STATE_ERROR_INCONSISTENT;
|
|
||||||
|
|
||||||
/** @hide Underlying data is corrupt */
|
|
||||||
public static final int ENCRYPTION_STATE_ERROR_CORRUPT =
|
|
||||||
IVold.ENCRYPTION_STATE_ERROR_CORRUPT;
|
|
||||||
|
|
||||||
private static volatile IStorageManager sStorageManager = null;
|
private static volatile IStorageManager sStorageManager = null;
|
||||||
|
|
||||||
@@ -2893,15 +2872,10 @@ public class StorageManager {
|
|||||||
@GuardedBy("mFuseAppLoopLock")
|
@GuardedBy("mFuseAppLoopLock")
|
||||||
private @Nullable FuseAppLoop mFuseAppLoop = null;
|
private @Nullable FuseAppLoop mFuseAppLoop = null;
|
||||||
|
|
||||||
/// Consts to match the password types in cryptfs.h
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public static final int CRYPT_TYPE_PASSWORD = IVold.PASSWORD_TYPE_PASSWORD;
|
public static final int CRYPT_TYPE_PASSWORD = 0;
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
public static final int CRYPT_TYPE_DEFAULT = IVold.PASSWORD_TYPE_DEFAULT;
|
public static final int CRYPT_TYPE_DEFAULT = 1;
|
||||||
/** @hide */
|
|
||||||
public static final int CRYPT_TYPE_PATTERN = IVold.PASSWORD_TYPE_PATTERN;
|
|
||||||
/** @hide */
|
|
||||||
public static final int CRYPT_TYPE_PIN = IVold.PASSWORD_TYPE_PIN;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,27 +175,6 @@ public class LockscreenCredential implements Parcelable, AutoCloseable {
|
|||||||
return mCredential;
|
return mCredential;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the credential type recognized by {@link StorageManager}. Can be one of
|
|
||||||
* {@link StorageManager#CRYPT_TYPE_DEFAULT}, {@link StorageManager#CRYPT_TYPE_PATTERN},
|
|
||||||
* {@link StorageManager#CRYPT_TYPE_PIN} or {@link StorageManager#CRYPT_TYPE_PASSWORD}.
|
|
||||||
*/
|
|
||||||
public int getStorageCryptType() {
|
|
||||||
if (isNone()) {
|
|
||||||
return StorageManager.CRYPT_TYPE_DEFAULT;
|
|
||||||
}
|
|
||||||
if (isPattern()) {
|
|
||||||
return StorageManager.CRYPT_TYPE_PATTERN;
|
|
||||||
}
|
|
||||||
if (isPin()) {
|
|
||||||
return StorageManager.CRYPT_TYPE_PIN;
|
|
||||||
}
|
|
||||||
if (isPassword()) {
|
|
||||||
return StorageManager.CRYPT_TYPE_PASSWORD;
|
|
||||||
}
|
|
||||||
throw new IllegalStateException("Unhandled credential type");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns whether this is an empty credential */
|
/** Returns whether this is an empty credential */
|
||||||
public boolean isNone() {
|
public boolean isNone() {
|
||||||
ensureNotZeroized();
|
ensureNotZeroized();
|
||||||
|
|||||||
@@ -595,12 +595,6 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** List of crypto types.
|
|
||||||
* These must match CRYPT_TYPE_XXX in cryptfs.h AND their
|
|
||||||
* corresponding commands in CommandListener.cpp */
|
|
||||||
public static final String[] CRYPTO_TYPES
|
|
||||||
= { "password", "default", "pattern", "pin" };
|
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final ContentResolver mResolver;
|
private final ContentResolver mResolver;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user