OSDN Git Service

HFP: Cleanup bt_hf_callbacks on the jni thread.
authorweichinweng <weichinweng@google.com>
Thu, 12 Mar 2020 06:47:27 +0000 (14:47 +0800)
committerweichinweng <weichinweng@google.com>
Fri, 27 Mar 2020 01:03:06 +0000 (09:03 +0800)
commitaf8630eddd1712b17280cda10746086017be6533
tree0e47daaabf68c1a4bd9cc39559e3dbdaf88b815a
parent3a484b387867ca3636db9b2d4b8cd7b73156e9e0
HFP: Cleanup bt_hf_callbacks on the jni thread.

For the race condition, the bt_hf_callbacks will be set null on main
thread when doing btif_hf_upstreams_evt on jni thread. Then it will
trigger crash due to btif_hf_upstreams_evt calling a null point.
The patch is cleanup bt_hf_callbacks on the jni thread to avoid the race
condition.

Bug: 140781191
Test: manual, unit test, auto script stress test.

Change-Id: I67400749120aebe13fa3e791f624c8e595d63379
Merged-In: I67400749120aebe13fa3e791f624c8e595d63379
btif/src/btif_hf.cc