diff options
author | Jack He <siyuanh@google.com> | 2017-08-17 12:11:18 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2017-09-07 08:43:16 +0000 |
commit | 0146463d70355592da85c3605aaaef4cf0b7335e (patch) | |
tree | c8ac808fd8d4c745c72ce6cf03b60312c6e2b5df /libs/hwui/renderthread/DrawFrameTask.cpp | |
parent | b6a1c5f06bb6f19dfecfbd77548096a3f7523075 (diff) |
Bluetooth: Thread-safe binder invocation
* Binder object may become null between null check and actual invocation
if using a instance private variable assignable by service connection
callbacks
* The solution to this problem without locking is to assign existing
binder variable to a local final variable before the null check
* Any further invocation to a disconnected binder object will result in
RemoteException that is caught by the try-catch block
* Read and write to volatile variable is always atomic and hence thread-safe
* Removed unnecessary synchronization in BluetoothAdapter constructor
* Private mConnection objects should be final
* Simplfied several return statements where booleans can be returned
directly
* Removed unnecessary catches for NPE since there won't be any
Bug: 64724692
Test: make, pair and use devices, no functional change
Change-Id: Ifc9d6337c0d451a01484b61243230725d5314f8e
(cherry picked from commit 16eeac356c68f3674677169b618774718ec982b2)
Diffstat (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp')
0 files changed, 0 insertions, 0 deletions