Merge changes Ia7d1cdff,I55d1df7e into main
* changes:
fix linkedcallback typo
bootctl: set on_unlinked
diff --git a/boot/aidl/client/BootControlClient.cpp b/boot/aidl/client/BootControlClient.cpp
index 5cca183..7aab5b4 100644
--- a/boot/aidl/client/BootControlClient.cpp
+++ b/boot/aidl/client/BootControlClient.cpp
@@ -80,6 +80,7 @@
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 @@
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();
diff --git a/health/aidl/default/LinkedCallback.h b/health/aidl/default/LinkedCallback.h
index 8c9c997..6b17be0 100644
--- a/health/aidl/default/LinkedCallback.h
+++ b/health/aidl/default/LinkedCallback.h
@@ -36,7 +36,7 @@
// 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: