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

Commit e2cb02c2 authored by Arthur Ishiguro's avatar Arthur Ishiguro
Browse files

Fix race conditions in HubEndpoint

The current logic is error-prone because it's possible that mServiceToken becomes null between null checks and calling the interface. Instead, this CL modfiies the logic such that mServiceToken is never nullified, and we rely on the service implementation's error handling (IllegalStateException, as noted in the javadocs). For callbacks, it's always possible to hit this race condition if we were still handling a previously invoked callback before the endpoint was unregistered, in which case we log a warning.

Bug: 378974199
Flag: android.chre.flags.offload_implementation
Test: Tests pass

Change-Id: Ic2c9eeb1684caddacbcdfb4bdc431afa5b663c36
parent d5d71446
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment