Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Zheng
917cca5e93 bootctl: check for nullptr
Add check for nullptr in module_ in case bootctl service dies.

Test: th
Change-Id: Ibd36007db715434620be457d5793c1d4f5532c1c
2024-10-22 16:10:29 -07:00
Daniel Zheng
01d5a1d2f1 bootctl: fix reconnect logic
Instead of just logging an error message, let's try reonnecting to the
bootctl service if our death recipient is invoked. We should also
reconnect our death recipient here.

If binder is killed, our death recipient is automatically unlinked.

Bug: 369289491
Test: kill bootctl service on CVD. Apply OTA
Change-Id: I914643baaf1fa6fe1e192517a2e43e07ee749b70
2024-10-21 11:39:00 -07:00
Daniel Zheng
d5d0c5500a bootctl: pass cookie to death recipient
On binder death, the cookie is the value that is passed to the death
recipient. This value shouldn't be nullptr here since our onDeath()
function expects an instance of BootControlClientAidl. If that doesn't
exist, we have a null pointer dereference which will cause update_engine
to crash.

Bug: 369289491
Test: crash bootctl service
Change-Id: I0bed4680c23b7d3516ed43aa566c4474962244fa
2024-10-16 14:04:19 -07:00
Daniel Zheng
cba986107b boot_control: use overrides
BootControlClientAIDL and BootControlClientHIDL are child classes of BootControlClient. We should
use proper inheritance and override the base class methods.

Test: th
Change-Id: Ia741f28bc463b55dc075a17901a024566324564a
2024-10-10 09:57:38 -07:00
Daniel Zheng
28b6b2b1b6 boot_control death recipient
When boot control service dies, we should log that it is no longer
available. To do this, we should register a death recipient in the
client.

Bug: 369289491
Test: kill bootctl service while running OTA
Change-Id: If766451cafe939725e7a88b1ca23b2a4af0d1a80
2024-10-09 21:19:44 +00:00
Kelvin Zhang
781b4ff19e Check if AIDL service is declared before calling wait
If bootctl AIDL service is not installed and we call waitForService,
caller will block indefinitely. So check with
AServiceManager_isDeclared before calling waitForService.

Test: th
Bug: 227536004
Change-Id: I551040b222c6c9127fe79aceb36bb3d69b52c3b6
2022-06-27 16:34:28 -07:00
Kelvin Zhang
b66d2a08f0 Add a wrapper for callers of BootControl HAL
We are switching BootControl from HIDL to AIDL. All clients must be
compatible with both implementations. To ease implementation, create a
wrapper that will use AIDL if possible, and fallback to HIDL otherwise.

Test: th
Bug: 227536004
Change-Id: Ia40cb384058a0052f7c5c39766534c23a095ca59
2022-06-17 10:22:17 -07:00