Added the deviceLocked and earlyBootEnded implementations to KeyMintDevice in km)compat. This fixes the build errors.

Test: n/a
Bug: b/179062062

Change-Id: I7458faa917317612536d640f42372489d30d960f
This commit is contained in:
Chirag Pathak 2021-02-02 07:35:38 +00:00
parent 2bb8575ea0
commit d889aff463
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.