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

Commit 1d8ecc05 authored by Daniel Zheng's avatar Daniel Zheng Committed by Gerrit Code Review
Browse files

Merge changes Ia7d1cdff,I55d1df7e into main

* changes:
  fix linkedcallback typo
  bootctl: set on_unlinked
parents 63526a9a d8ed80da
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ class BootControlClientAidl final : public BootControlClient {
    explicit BootControlClientAidl(std::shared_ptr<IBootControl> module)
        : module_(module),
          boot_control_death_recipient(AIBinder_DeathRecipient_new(onBootControlServiceDied)) {
        AIBinder_DeathRecipient_setOnUnlinked(boot_control_death_recipient, onCallbackUnlinked);
        binder_status_t status =
                AIBinder_linkToDeath(module->asBinder().get(), boot_control_death_recipient, this);
        if (status != STATUS_OK) {
@@ -236,6 +237,11 @@ class BootControlClientAidl final : public BootControlClient {
  private:
    std::shared_ptr<IBootControl> module_;
    AIBinder_DeathRecipient* boot_control_death_recipient;
    static void onCallbackUnlinked(void* /*client*/) {
        // this is an empty function needed to suppress the "AIBinder_linkToDeath is being called
        // with a non-null cookie and no onUnlink callback set. This might not be intended.
        // AIBinder_DeathRecipient_setOnUnlinked should be called first." warning
    }
    static void onBootControlServiceDied(void* client) {
        BootControlClientAidl* self = static_cast<BootControlClientAidl*>(client);
        self->onBootControlServiceDied();
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ class LinkedCallback {
    // cookie when it's unlinked.
    static ::android::base::Result<LinkedCallback*> Make(
            std::shared_ptr<Health> service, std::shared_ptr<IHealthInfoCallback> callback);
    // On callback died, unreigster it from the service.
    // On callback died, unregister it from the service.
    void OnCallbackDied();

  private: