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

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

Merge changes from topic "remove-fde" into tm-dev

* changes:
  Remove unused FDE methods from StorageManager
  Stop checking FDE password cache
  Remove checks for FDE in 'adb backup'
parents b6468930 ad08fcc7
Loading
Loading
Loading
Loading
+0 −53
Original line number Diff line number Diff line
@@ -77,37 +77,10 @@ interface IStorageManager {
     * Gets the path to the mounted Opaque Binary Blob (OBB).
     */
    String getMountedObbPath(in String rawPath) = 24;
    /**
     * Decrypts any encrypted volumes.
     */
    int decryptStorage(in String password) = 26;
    /**
     * Encrypts storage.
     */
    int encryptStorage(int type, in String password) = 27;
    /**
     * Changes the encryption password.
     */
    int changeEncryptionPassword(int type, in String password) = 28;
    /**
     * Returns list of all mountable volumes for the specified userId
     */
    StorageVolume[] getVolumeList(int userId, in String callingPackage, int flags) = 29;
    /**
     * Determines the encryption state of the volume.
     * @return a numerical value. See {@code ENCRYPTION_STATE_*} for possible
     * values.
     * Note that this has been replaced in most cases by the APIs in
     * StorageManager (see isEncryptable and below)
     * This is still useful to get the error state when encryption has failed
     * and CryptKeeper needs to throw up a screen advising the user what to do
     */
    int getEncryptionState() = 31;
    /**
     * Verify the encryption password against the stored volume.  This method
     * may only be called by the system process.
     */
    int verifyEncryptionPassword(in String password) = 32;
    /**
     * Ensure that all directories along given path exist, creating parent
     * directories as needed. Validates that given path is absolute and that it
@@ -116,32 +89,6 @@ interface IStorageManager {
     * external storage data or OBB directory belonging to calling app.
     */
    void mkdirs(in String callingPkg, in String path) = 34;
    /**
     * Determines the type of the encryption password
     * @return PasswordType
     */
    int getPasswordType() = 35;
    /**
     * Get password from vold
     * @return password or empty string
     */
    String getPassword() = 36;
    /**
     * Securely clear password from vold
     */
    oneway void clearPassword() = 37;
    /**
     * Set a field in the crypto header.
     * @param field field to set
     * @param contents contents to set in field
     */
    oneway void setField(in String field, in String contents) = 38;
    /**
     * Gets a field from the crypto header.
     * @param field field to get
     * @return contents of field
     */
    String getField(in String field) = 39;
    /**
     * Report the time of the last maintenance operation such as fstrim.
     * @return Timestamp of the last maintenance operation, in the
+0 −10
Original line number Diff line number Diff line
@@ -3044,14 +3044,4 @@ public class StorageManager {
    public static final int CRYPT_TYPE_PATTERN = IVold.PASSWORD_TYPE_PATTERN;
    /** @hide */
    public static final int CRYPT_TYPE_PIN = IVold.PASSWORD_TYPE_PIN;

    // Constants for the data available via StorageManagerService.getField.
    /** @hide */
    public static final String SYSTEM_LOCALE_KEY = "SystemLocale";
    /** @hide */
    public static final String OWNER_INFO_KEY = "OwnerInfo";
    /** @hide */
    public static final String PATTERN_VISIBLE_KEY = "PatternVisible";
    /** @hide */
    public static final String PASSWORD_VISIBLE_KEY = "PasswordVisible";
}
+0 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ interface ILockSettings {
    VerifyCredentialResponse verifyTiedProfileChallenge(in LockscreenCredential credential, int userId, int flags);
    VerifyCredentialResponse verifyGatekeeperPasswordHandle(long gatekeeperPasswordHandle, long challenge, int userId);
    void removeGatekeeperPasswordHandle(long gatekeeperPasswordHandle);
    boolean checkVoldPassword(int userId);
    int getCredentialType(int userId);
    byte[] getHashFactor(in LockscreenCredential currentCredential, int userId);
    void setSeparateProfileChallengeEnabled(int userId, boolean enabled, in LockscreenCredential managedUserPassword);
+0 −14
Original line number Diff line number Diff line
@@ -525,20 +525,6 @@ public class LockPatternUtils {
        }
    }

    /**
     * Check to see if vold already has the password.
     * Note that this also clears vold's copy of the password.
     * @return Whether the vold password matches or not.
     */
    public boolean checkVoldPassword(int userId) {
        try {
            return getLockSettings().checkVoldPassword(userId);
        } catch (RemoteException re) {
            Log.e(TAG, "failed to check vold password", re);
            return false;
        }
    }

    /**
     * Returns the password history hash factor, needed to check new password against password
     * history with {@link #checkPasswordHistory(byte[], byte[], int)}
+0 −36
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@ enum {
    TRANSACTION_isObbMounted,
    TRANSACTION_getMountedObbPath,
    TRANSACTION_isExternalStorageEmulated,
    TRANSACTION_decryptStorage,
    TRANSACTION_encryptStorage,
};

class BpMountService: public BpInterface<IMountService>
@@ -517,40 +515,6 @@ public:
        path = reply.readString16();
        return true;
    }

    int32_t decryptStorage(const String16& password)
    {
        Parcel data, reply;
        data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
        data.writeString16(password);
        if (remote()->transact(TRANSACTION_decryptStorage, data, &reply) != NO_ERROR) {
            ALOGD("decryptStorage could not contact remote\n");
            return -1;
        }
        int32_t err = reply.readExceptionCode();
        if (err < 0) {
            ALOGD("decryptStorage caught exception %d\n", err);
            return err;
        }
        return reply.readInt32();
    }

    int32_t encryptStorage(const String16& password)
    {
        Parcel data, reply;
        data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
        data.writeString16(password);
        if (remote()->transact(TRANSACTION_encryptStorage, data, &reply) != NO_ERROR) {
            ALOGD("encryptStorage could not contact remote\n");
            return -1;
        }
        int32_t err = reply.readExceptionCode();
        if (err < 0) {
            ALOGD("encryptStorage caught exception %d\n", err);
            return err;
        }
        return reply.readInt32();
    }
};

IMPLEMENT_META_INTERFACE(MountService, "android.os.storage.IStorageManager")
Loading