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

Commit c1bd6103 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Implement oemlock AIDL default"

parents 1b038bc6 204599a3
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -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();
}

+4 −0
Original line number Diff line number Diff line
@@ -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