aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothMapClient.java
diff options
context:
space:
mode:
authorLee Shombert <shombert@google.com>2020-04-09 09:00:46 -0700
committerLee Shombert <shombert@google.com>2020-04-15 13:58:55 -0700
commit54846525c509a2d638e059095b12e64accc5b163 (patch)
tree377450e6c1ac67abc779e49c72e474bd65cdc966 /framework/java/android/bluetooth/BluetoothMapClient.java
parent10a6ecd8062aae3819a04979da36133180e05b3d (diff)
Fix exception handling in getState() binder cache
Bug: 153103051 A binder cache recompute() function cannot compute a result based on any data that is not known to the binder server. If the code depends on local data that can change, then invalidation will not work properly. The original getState() method returned OFF if the bluetooth service was unavailable. This computation now occurs in the getStateInternal() method, outside of the binder cache query() method. The recompute() method converts RemoteExceptions to RuntimeExceptions. Then, the conversion is reversed in getStateInternal(). This double conversion is needed because the cache recompute() method has no throw spec. Test: Create a debug image that enables binder cache VERIFY. Run the following tests: * atest BluetoothInstrumentationTests * atest PtsChreTestCases * atest UserLifecycleTests * manual testing connecting to bluetooth devices and toggling airplane mode. No cache inconsistencies found. No test failures seen. Change-Id: I93b9742587c4eb695d9a11fc6ab145f6a40a0ece
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothMapClient.java')
0 files changed, 0 insertions, 0 deletions