Merge "Added the deviceLocked and earlyBootEnded implementations to KeyMintDevice in km)compat. This fixes the build errors. Test: n/a Bug: b/179062062"

This commit is contained in:
Treehugger Robot 2021-02-13 22:11:52 +00:00 committed by Gerrit Code Review
commit 1e283ee2f3
2 changed files with 26 additions and 1 deletions

View file

@ -500,6 +500,29 @@ ScopedAStatus KeyMintDevice::begin(KeyPurpose in_inPurpose,
return convertErrorCode(errorCode);
}
ScopedAStatus KeyMintDevice::deviceLocked(bool passwordOnly,
const std::optional<TimeStampToken>& timestampToken) {
V4_0_VerificationToken token;
if (timestampToken.has_value()) {
token = convertTimestampTokenToLegacy(timestampToken.value());
}
auto ret = mDevice->deviceLocked(passwordOnly, token);
if (!ret.isOk()) {
return convertErrorCode(KMV1::ErrorCode::UNKNOWN_ERROR);
} else {
return convertErrorCode(KMV1::ErrorCode::OK);
}
}
ScopedAStatus KeyMintDevice::earlyBootEnded() {
auto ret = mDevice->earlyBootEnded();
if (!ret.isOk()) {
return convertErrorCode(KMV1::ErrorCode::UNKNOWN_ERROR);
} else {
return convertErrorCode(KMV1::ErrorCode::OK);
}
}
ScopedAStatus KeyMintOperation::update(const std::optional<KeyParameterArray>& in_inParams,
const std::optional<std::vector<uint8_t>>& in_input,
const std::optional<HardwareAuthToken>& in_inAuthToken,

View file

@ -110,7 +110,9 @@ class KeyMintDevice : public aidl::android::hardware::security::keymint::BnKeyMi
const std::vector<KeyParameter>& in_inParams,
const HardwareAuthToken& in_inAuthToken,
BeginResult* _aidl_return) override;
ScopedAStatus deviceLocked(bool passwordOnly,
const std::optional<TimeStampToken>& timestampToken) override;
ScopedAStatus earlyBootEnded() override;
// These are public to allow testing code to use them directly.
// This class should not be used publicly anyway.