Use MessageLoopThread in A2DP source, JNI, BTA, HCI and module bring-up
* Replace OSI thread with MessageLoopThread in - btif_a2dp_source (A2DP encoding thread) - btif_core (JNI thread) - btu_init (BTA thread) - hci_layer (HCI thread) - module (module bring up thread) - various unit test threads * Code that uses reactor from OSI thread is not replaced in this change because they need to move from using reactor to message loop first * Main difference: - HCI layer no longer has access to mutex protecting message loop set up and tear down. Messages posted to thread after ShutDown() is called become no-op - In all cases QuitClosure() is used instead of QuitWhenIdleClosure(). This means that we will never force kill a thread. An infinite loop will delay the shutdown of Bluetooth stack. * do_in_hci_thread is actually do_in_bta_thread * Move the definition of do_in_bta_thread from bta to btu since btu is where the thread actually lives * Remove bta_closure_api.h and replace it with stack/include/btu.h * Remove header inclusion in bta_sys.h and include stack/include/btu.h in individual compilation units * Fixed a bug in btif_cleanup_bluetooth where btif_jni_disassociate() was not called on the JNI thread * Make setting real time priority a requirement * Crash during the following scenario: - When btif_profile_queue cleanup failed to be scheduled on JNI thread - When A2DP encoder thread failed to gain real time priority - When BTA thread failed to start up - When BTA thread failed to gain real time priority - When BTA thread failed to schedule its first callback * Turn off Bluetooth in the following scenario: - When HCI thread failed to gain real time priority - When bt_workqueue thread failed to gain real time priority Bug: 110303473 Test: make, native and Java unit tests, Connect to headset and listen to music through A2DP, testplans/details/184455/3975 Change-Id: Ib448992fc0ba5af82c2d117dd65f1abd45d2acb6
Showing
- system/bta/ag/bta_ag_api.cc 1 addition, 0 deletionssystem/bta/ag/bta_ag_api.cc
- system/bta/ag/bta_ag_rfc.cc 1 addition, 0 deletionssystem/bta/ag/bta_ag_rfc.cc
- system/bta/ag/bta_ag_sco.cc 1 addition, 0 deletionssystem/bta/ag/bta_ag_sco.cc
- system/bta/ag/bta_ag_sdp.cc 1 addition, 0 deletionssystem/bta/ag/bta_ag_sdp.cc
- system/bta/dm/bta_dm_api.cc 1 addition, 1 deletionsystem/bta/dm/bta_dm_api.cc
- system/bta/dm/bta_dm_ci.cc 2 additions, 1 deletionsystem/bta/dm/bta_dm_ci.cc
- system/bta/dm/bta_dm_pm.cc 1 addition, 0 deletionssystem/bta/dm/bta_dm_pm.cc
- system/bta/gatt/bta_gattc_act.cc 1 addition, 1 deletionsystem/bta/gatt/bta_gattc_act.cc
- system/bta/gatt/bta_gattc_api.cc 1 addition, 1 deletionsystem/bta/gatt/bta_gattc_api.cc
- system/bta/gatt/bta_gatts_api.cc 1 addition, 1 deletionsystem/bta/gatt/bta_gatts_api.cc
- system/bta/include/bta_closure_api.h 0 additions, 38 deletionssystem/bta/include/bta_closure_api.h
- system/bta/jv/bta_jv_api.cc 1 addition, 1 deletionsystem/bta/jv/bta_jv_api.cc
- system/bta/sys/bta_sys.h 0 additions, 2 deletionssystem/bta/sys/bta_sys.h
- system/bta/sys/bta_sys_main.cc 0 additions, 36 deletionssystem/bta/sys/bta_sys_main.cc
- system/btcore/include/module.h 4 additions, 3 deletionssystem/btcore/include/module.h
- system/btcore/src/module.cc 34 additions, 41 deletionssystem/btcore/src/module.cc
- system/btif/Android.bp 1 addition, 0 deletionssystem/btif/Android.bp
- system/btif/avrcp/avrcp_service.cc 1 addition, 1 deletionsystem/btif/avrcp/avrcp_service.cc
- system/btif/include/btif_common.h 2 additions, 2 deletionssystem/btif/include/btif_common.h
- system/btif/src/btif_a2dp_audio_interface.cc 1 addition, 0 deletionssystem/btif/src/btif_a2dp_audio_interface.cc
Loading
Please register or sign in to comment