Skip to content
Snippets Groups Projects
Commit 63d2fa3e authored by Jack He's avatar Jack He
Browse files

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
parent 0ac5b1b6
No related branches found
No related tags found
No related merge requests found
Showing
with 55 additions and 129 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment