mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Implement oemlock AIDL default
Test: atest OemLockAidlTest Bug: 233850220 Change-Id: Icec67b5c46e35468ad98b94017ac373b5583c1af
This commit is contained in:
@@ -24,29 +24,31 @@ namespace oemlock {
|
||||
// Methods from ::android::hardware::oemlock::IOemLock follow.
|
||||
|
||||
::ndk::ScopedAStatus OemLock::getName(std::string *out_name) {
|
||||
(void)out_name;
|
||||
*out_name = "SomeCoolName";
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus OemLock::setOemUnlockAllowedByCarrier(bool in_allowed, const std::vector<uint8_t> &in_signature, OemLockSecureStatus *_aidl_return) {
|
||||
(void)in_allowed;
|
||||
// Default impl doesn't care about a valid vendor signature
|
||||
(void)in_signature;
|
||||
(void)_aidl_return;
|
||||
|
||||
mAllowedByCarrier = in_allowed;
|
||||
*_aidl_return = OemLockSecureStatus::OK;
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus OemLock::isOemUnlockAllowedByCarrier(bool *out_allowed) {
|
||||
(void)out_allowed;
|
||||
*out_allowed = mAllowedByCarrier;
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus OemLock::setOemUnlockAllowedByDevice(bool in_allowed) {
|
||||
(void)in_allowed;
|
||||
mAllowedByDevice = in_allowed;
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus OemLock::isOemUnlockAllowedByDevice(bool *out_allowed) {
|
||||
(void)out_allowed;
|
||||
*out_allowed = mAllowedByDevice;
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ public:
|
||||
::ndk::ScopedAStatus isOemUnlockAllowedByDevice(bool* out_allowed) override;
|
||||
::ndk::ScopedAStatus setOemUnlockAllowedByCarrier(bool in_allowed, const std::vector<uint8_t>& in_signature, OemLockSecureStatus* _aidl_return) override;
|
||||
::ndk::ScopedAStatus setOemUnlockAllowedByDevice(bool in_allowed) override;
|
||||
|
||||
private:
|
||||
bool mAllowedByCarrier = false;
|
||||
bool mAllowedByDevice = false;
|
||||
};
|
||||
|
||||
} // namespace oemlock
|
||||
|
||||
Reference in New Issue
Block a user