diff options
| author | 2025-01-10 19:22:50 +0000 | |
|---|---|---|
| committer | 2025-01-11 00:33:06 +0000 | |
| commit | e2cb02c23938b9751a1c59d4daa08329a45a5800 (patch) | |
| tree | af163bedb72d4c43c6c34b4e1e69b76deda16e1d /libs/androidfw/FileStream.cpp | |
| parent | d5d714466fef3026f79fcaa5d366004fe661d33f (diff) | |
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
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions