OSDN Git Service
gitbuildkicker [Mon, 29 Jan 2018 19:58:15 +0000 (11:58 -0800)]
merge in pi-release history after reset to master
android-build-team Robot [Sun, 28 Jan 2018 08:23:19 +0000 (08:23 +0000)]
Snap for
4571561 from
801981950eccd1aebe1b1f5c6218a43305f001c6 to pi-release
Change-Id: I8d8834d22d339682d93f7544f00b7bd97b968d5c
Jakub Pawlowski [Sat, 27 Jan 2018 16:12:35 +0000 (16:12 +0000)]
Report LE CoC credits to GAP clients am:
b9c95d5a61 am:
8be4723e4f
am:
ee7cf54934
Change-Id: Idab769a64573b6c34131a1fc52b32b7a0a3e67d1
Jakub Pawlowski [Sat, 27 Jan 2018 16:10:06 +0000 (16:10 +0000)]
Report LE CoC credits to GAP clients am:
b9c95d5a61
am:
8be4723e4f
Change-Id: I5aaf41b5c5bbd712d2391a4ae486e869483c6a27
Jakub Pawlowski [Sat, 27 Jan 2018 16:07:34 +0000 (16:07 +0000)]
Report LE CoC credits to GAP clients
am:
b9c95d5a61
Change-Id: I28db97500b79b8e4d90ab31334310deb2779c158
Jakub Pawlowski [Sat, 27 Jan 2018 01:18:52 +0000 (17:18 -0800)]
Report LE CoC credits to GAP clients
Test: manual with HA
Change-Id: Ic4552b05b6e6c7dad5311e0b893da3166bf1895c
Jakub Pawlowski [Sat, 27 Jan 2018 04:18:10 +0000 (04:18 +0000)]
Merge "Report credit count change, when credits are received for LE CoC" am:
f6f158713a am:
bf2e4207dc
am:
5a96517f8d
Change-Id: I728699d3507360ef74ec34ed02d164addf26e619
Jakub Pawlowski [Sat, 27 Jan 2018 04:16:09 +0000 (04:16 +0000)]
Merge "Report credit count change, when credits are received for LE CoC" am:
f6f158713a
am:
bf2e4207dc
Change-Id: I958928f1ec83d23a3841fb72b2bd1ef6b3118eee
Jakub Pawlowski [Sat, 27 Jan 2018 04:13:08 +0000 (04:13 +0000)]
Merge "Report credit count change, when credits are received for LE CoC"
am:
f6f158713a
Change-Id: I6bc20a0b10414c9e73333bce9e550e8b32390d74
Treehugger Robot [Sat, 27 Jan 2018 04:08:05 +0000 (04:08 +0000)]
Merge "Report credit count change, when credits are received for LE CoC"
Jack He [Sat, 27 Jan 2018 03:56:00 +0000 (03:56 +0000)]
Merge "HFP: Fix NPE in error logging for voice recognition events" am:
7676c7df90 am:
0a751debcb
am:
acdb0705f3
Change-Id: I5759eed828279a98c5c7d0218425ad8d16aa0549
Jack He [Sat, 27 Jan 2018 03:52:41 +0000 (03:52 +0000)]
Merge "HFP: Fix NPE in error logging for voice recognition events" am:
7676c7df90
am:
0a751debcb
Change-Id: I21dfe961d6e727b3b60c86d7eb5b4073dc0d1b13
Jack He [Sat, 27 Jan 2018 03:50:17 +0000 (03:50 +0000)]
Merge "HFP: Fix NPE in error logging for voice recognition events"
am:
7676c7df90
Change-Id: I03f15ceda56a53616ec514fc46419288a624cdf3
Treehugger Robot [Sat, 27 Jan 2018 03:44:34 +0000 (03:44 +0000)]
Merge "HFP: Fix NPE in error logging for voice recognition events"
Pavlin Radoslavov [Sat, 27 Jan 2018 03:06:37 +0000 (03:06 +0000)]
Disable host compilation on Darwin for net_test_btif_state_machine am:
7b593eb9c9 am:
17125714ad
am:
6d3c2f423e
Change-Id: I686da0e37d8a74e9a831115efb35ac4be3d75767
Pavlin Radoslavov [Sat, 27 Jan 2018 02:53:25 +0000 (02:53 +0000)]
Disable host compilation on Darwin for net_test_btif_state_machine am:
7b593eb9c9
am:
17125714ad
Change-Id: I42b72d5990ddd7b9aea09ab6cd8fc3d383e6dfce
Pavlin Radoslavov [Sat, 27 Jan 2018 02:42:26 +0000 (02:42 +0000)]
Disable host compilation on Darwin for net_test_btif_state_machine
am:
7b593eb9c9
Change-Id: Ia8f39cc6fa9abac85c0aab07e37651fcfc45f44b
Pavlin Radoslavov [Sat, 27 Jan 2018 02:20:08 +0000 (02:20 +0000)]
Add a workaround for A2DP devices that request Role Change am:
829a8f8f53 am:
fb20ba494c
am:
8740ce4962
Change-Id: I8134843a223fc090b9a41e7e78342d1c2d88b6c4
Pavlin Radoslavov [Sat, 27 Jan 2018 02:03:52 +0000 (02:03 +0000)]
Add a workaround for A2DP devices that request Role Change am:
829a8f8f53
am:
fb20ba494c
Change-Id: I12ada703d69d915a240d9948c8564623bb8a7b85
Pavlin Radoslavov [Sat, 27 Jan 2018 01:59:58 +0000 (01:59 +0000)]
Add a workaround for A2DP devices that request Role Change
am:
829a8f8f53
Change-Id: Ia8348c9aca0e2eb8986c3f89e104801d3828855c
Jakub Pawlowski [Sun, 21 Jan 2018 00:07:10 +0000 (16:07 -0800)]
Report credit count change, when credits are received for LE CoC
Test: manual with HA
Bug:
69623109
Change-Id: I1c6f240eaf08d876bb285f3ffa737365f392925e
Jack He [Sat, 27 Jan 2018 01:39:23 +0000 (17:39 -0800)]
HFP: Fix NPE in error logging for voice recognition events
Bug:
72506800
Test: make and test with VREC events
Change-Id: I126b75d9e991b312e795ed38672b0153ca03dcea
Pavlin Radoslavov [Thu, 25 Jan 2018 13:15:38 +0000 (05:15 -0800)]
Disable host compilation on Darwin for net_test_btif_state_machine
The net_test_btif_state_machine unit test depends on libosi,
and that library itself is disabled for Darwin.
Test: Code compilation on Linux
Change-Id: I143015370988657e2903f86175244308c01d5162
(cherry picked from commit
8fb98a5350f8b5893b9fc160fa030fd7dbae06a9)
Pavlin Radoslavov [Sat, 27 Jan 2018 00:12:54 +0000 (00:12 +0000)]
Add support for Multi-A2DP state machines per device am:
d752229b61 am:
bce489b8ae
am:
473d406bec -s ours
Change-Id: I0e1e0ea660c4864e034c5b02fa58ff5ee6c39d35
Pavlin Radoslavov [Sat, 27 Jan 2018 00:02:40 +0000 (00:02 +0000)]
Add support for Multi-A2DP state machines per device am:
d752229b61
am:
bce489b8ae
Change-Id: I7348bf5fcf03eb039b260f8cf6209e5d3d4e492f
Pavlin Radoslavov [Fri, 26 Jan 2018 23:54:07 +0000 (23:54 +0000)]
Add support for Multi-A2DP state machines per device
am:
d752229b61
Change-Id: Ie81f523d742a1fc57a8840915df5d7f11dc4e9d7
Tom Cherry [Fri, 26 Jan 2018 23:16:39 +0000 (23:16 +0000)]
Merge "btif: Name the unique_lock in initialize_transaction()" am:
625973a024 am:
4a71b2e39c
am:
111de864e2
Change-Id: I5e1a7645d68160c177b9813bfe7a7a92cab7ba9d
Tom Cherry [Fri, 26 Jan 2018 23:04:42 +0000 (23:04 +0000)]
Merge "btif: Name the unique_lock in initialize_transaction()" am:
625973a024
am:
4a71b2e39c
Change-Id: If449137110d6cdee4b6806020d02a9a370f28704
Tom Cherry [Fri, 26 Jan 2018 23:01:35 +0000 (23:01 +0000)]
Merge "btif: Name the unique_lock in initialize_transaction()"
am:
625973a024
Change-Id: I794c19e52bf9613bb17e6d62fe614af262bc3b25
Pavlin Radoslavov [Tue, 16 Jan 2018 18:48:13 +0000 (10:48 -0800)]
Add a workaround for A2DP devices that request Role Change
Certain A2DP devices request Role Change after connection,
and typically the Phone grants it - as a result the Phone is the Slave.
However, with Multi-A2DP, follow-up A2DP connections require that the
Phone becomes the Master: within the existing stack we have function
bta_av_switch_if_needed() that checks whether the Phone needs to request
Role Change and become again the Master.
Some A2DP devices will refuse the Phone to become the Master again, and
this prevents/blocks the Phone from having multiple A2DP connections
that are open.
Test: Manual
Bug:
72122792
Bug:
70350399
Change-Id: I749c73a38e3fb10262143ba6b41a7d65309ddf49
(cherry picked from commit
0f82fe7b83dc765d245a8996ed758359643d5b0b)
Pavlin Radoslavov [Sat, 25 Nov 2017 03:12:11 +0000 (19:12 -0800)]
Add support for Multi-A2DP state machines per device
* Reimplement most of the BTIF AV state machinery in C++
- Separate the BTIF AV Source from BTIF AV Sink state:
btif_av_source and btif_av_sink
- Remove the single btif_av_cb control block instance
- Add C++ based BtifStateMachine and remove the older C-based
btif_sm state machine
- Introduce C++ class BtifAvPeer to keep state per peer, and use
a single state machine instance per peer
- Update BTA_AvStart() and BTA_AvStop() to take tBTA_AV_HNDL handle
argument
- Register the BTA handles when enabling the Source/Sink service.
This needs to be done in advance during service startup, otherwise
a connection to a remote device will fail.
- Move local event_handler functions inside C++ ProcessEvent methods,
and pocess the BTIF, BTA AV and BTA AVRCP events per state machine
instance
- Cleanup callbacks and use do_in_jni_thread() to schedule the processing
- Add BTIF AV API that needs to be called by the AVRCP module for certain
AVRCP events: btif_av_avrcp_event_open(), btif_av_avrcp_event_close()
btif_av_avrcp_event_remote_play()
- Add a mechanism to set the active device
- Add BluetoothDevice argument to the codec-related internal Binder
APIs: getCodecStatus(), enableOptionalCodecs(),
disableOptionalCodecs(), setCodecConfigPreference()
- Rename btif_av_move_idle() to btif_av_acl_disconnected() and
refactor the processing to happen within each state machine on the
correct thread.
- Process cleanup_src and cleanup_sink on the JNI thread
- Add a mechanism to track the maximum number of connected devices.
- Add unit tests for the new BtifStateMachine class
* Redesign some of the AVDTP internals so it can handle multiple connected
devices
- Change some of the AVDTP struct entries to C++ classes.
This simplifies significantly the design fixes
- Reorganize the AvdtpScb entries: for each connection the
corresponding SEP entries are within the corresponding AvdtpCcb entry.
- Pass peer address as argument to the API functions inside bta_av_co.cc,
and update the peer address inside the corresponding peer entry in
bta_av_co.cc
- Add various log mesages
- Store precomputed BTA AV SCB index in the AvdtpCcb entry and use it as
appropriate.
- Fix the TCID computation and handling for the AvdtpAdaptationLayer
- Fix the computed value for AVDT_NUM_RT_TBL
- Remove video-related code inside AVDTP
- Refactor/cleanup hard-coded callbacks that depend on the BTA_AV_NUM_STRS
value.
- Update various #define values to support a larger number of connected
devices:
- Maximum number of streams:
BTA_AV_NUM_STRS: 2 -> 6
- BT_RC_NUM_APP: 1 -> 12 (AVRCP-related - 2 * MaxDevices)
- MAX_L2CAP_LINKS: 7 -> 13
- MAX_L2CAP_CHANNELS: 16 -> 32
- AVDT_NUM_LINKS: 2 -> 6
- AVDT_NUM_SEPS: (6 * AVDT_NUM_LINKS) -> 6
Now the value is used for the maximum number of SEPs per device
- AVDT_NUM_TC_TBL: 6 -> (AVDT_NUM_SEPS + AVDT_NUM_LINKS)
- AVCT_NUM_LINKS: 2 -> 6
- AVCT_NUM_CONN: 3 -> 14 (2 * MaxDevices + 2)
Also:
- Update the JNI codec-related calls to use const reference
instead of a pointer
- Update the implementation of bta_av_chk_2nd_start() so it is aligned
with bta_av_chk_start() and cleaned up both functions.
- Rename btif_dispatch_sm_event() to btif_av_dispatch_sm_event() and
btif_report_source_codec_state() to btif_av_report_source_codec_state()
for consistency with the rest of the BTIF AV API.
- Add new function btif_rc_is_connected_peer() and remove
btif_rc_get_connected_peer()
- Add new AVRCP header file btif/include/btif_rc.h
and move the AVRCP "extern" declarations from btif_av.cc there.
- Rename btif_av_execute_service() to btif_av_source_execute_service()
- Cleanup the btif_av.h API descriptions
- Print the BTIF AV state in the "dumpsys bluetooth_manager" output
- Print the BTA AV state in the "dumpsys bluetooth_manager" output
- Print the AVDTP state in the "dumpsys bluetooth_manager" output
- Refactor btif_a2dp_source_cb into a class with internal state.
- Refactor A2DP Source worker thread handling and replace it with
libchrome message handler
- Refactor BtaAvCo component (bta_av_co.cc)
- C++ classes and state
- Rename bta_av_co_audio_src_data_path to
bta_av_co_audio_source_data_path
- Remove most BTA_AV_CO_CP_SCMS_T checks
- Replace mutex_global_lock() usage with local mutex
- Keep codec-specific state per peer
- Keep state about the active peer - the first connected peer is the
default active peer
- Report source codec state only for valid peers; i.e., don't report
source codec state for empty RawAddress
- Keep the contect_protect_active flag per peer
- Print the BTA AV CO state in the dumpsys bluetooth_manager" output
- Misc cleanup in BTA AV
- Add ToString() method to struct btav_a2dp_codec_config_t
- Additional cleanup
Bug:
70350399
Test: Manual and unit tests
Change-Id: Icecd7fd44a222d939b63a7473a2239ae0679f08c
Merged-In: Icecd7fd44a222d939b63a7473a2239ae0679f08c
(cherry picked from commit
c7242818d4180dec4eae2e75f9fb91f7f6a160aa)
Treehugger Robot [Fri, 26 Jan 2018 21:26:24 +0000 (21:26 +0000)]
Merge "btif: Name the unique_lock in initialize_transaction()"
Hemant Gupta [Fri, 26 Jan 2018 20:02:10 +0000 (20:02 +0000)]
Cancel LE Advertising related timers during shutdown am:
c3049d6b6c am:
1f8152e0ba
am:
6dac2213d5
Change-Id: Ib11384a41ea4b7218cbd5c46989507fd01be982d
Jakub Pawlowski [Fri, 26 Jan 2018 20:01:59 +0000 (20:01 +0000)]
Use weak pointer when refering to AdvertisingManager am:
ce0d65f4b9 am:
b380808af7
am:
36ef1af5ec
Change-Id: Ic22a71a8de9d65686bbf020e55d6926c9cf20c4b
Hemant Gupta [Fri, 26 Jan 2018 19:48:09 +0000 (19:48 +0000)]
Cancel LE Advertising related timers during shutdown am:
c3049d6b6c
am:
1f8152e0ba
Change-Id: I8169f61ec0cf8357195cdc5d2feb38fc7be9062a
Jakub Pawlowski [Fri, 26 Jan 2018 19:48:01 +0000 (19:48 +0000)]
Use weak pointer when refering to AdvertisingManager am:
ce0d65f4b9
am:
b380808af7
Change-Id: Ia8fd3c5b95483045bd86c1e93195e8ab5261ce6b
Hemant Gupta [Fri, 26 Jan 2018 19:37:48 +0000 (19:37 +0000)]
Cancel LE Advertising related timers during shutdown
am:
c3049d6b6c
Change-Id: I6d5d4200e16dc2aec4e50a459cd01e61640f3318
Jakub Pawlowski [Fri, 26 Jan 2018 19:37:39 +0000 (19:37 +0000)]
Use weak pointer when refering to AdvertisingManager
am:
ce0d65f4b9
Change-Id: Ic1ec6e485cf9f66f6dd134a3757a93c4a1ff1521
Tom Cherry [Fri, 26 Jan 2018 17:43:35 +0000 (09:43 -0800)]
btif: Name the unique_lock in initialize_transaction()
initialize_transaction()'s unique_lock is released immediately as a
temporary variable because it does not have a name.
Bug:
72525761
Test: None
Change-Id: Ic1b1a0bd3ab1e5f993ffe5e81b0cc390cb4e34ab
Hemant Gupta [Tue, 23 Jan 2018 00:54:33 +0000 (16:54 -0800)]
Cancel LE Advertising related timers during shutdown
Failure to cancel advertising timers might lead to them being executed
after AdvertisingManager is destroyed.
Test: ran all advertising tests, no regression
Fixes:
71051865
Change-Id: I4431f5e0fe82501dbdbb9ca816eb092dde7c9436
Jakub Pawlowski [Thu, 25 Jan 2018 18:53:57 +0000 (10:53 -0800)]
Use weak pointer when refering to AdvertisingManager
In btif layer, we schedule tasks for execution on
AdvertisingManager on bta thread. Before the scheduling we check if
AdvertisingManager is initialized. We don't check if AdvertisingManager
is still valid, when the command execution is starting on the bta thread.
This is a race condition, that can cause crashes.
To fix that, always post task for execution using weak reference, rather
than raw pointer. Thanks to it, the MessageLoop will check if the
weak_ptr is valid before attempt to execute the task. The check happens
on the target thread, right before the execution, eliminating all
possible race conditions.
Test: ran all advertising tests, no regression
Bug:
71051865
Change-Id: I7fd8255879d5272d47aa79974bb79bdaacb55800
Jakub Pawlowski [Fri, 26 Jan 2018 01:50:24 +0000 (01:50 +0000)]
Merge "Fixed L2CAP Buffer Length when transmit packets" am:
935513cbab am:
3ba64555cc
am:
0125f76c34
Change-Id: I3d221a243ac222ca18468a12ac39ee99782496d2
Jakub Pawlowski [Thu, 25 Jan 2018 23:09:50 +0000 (23:09 +0000)]
Merge "Fixed L2CAP Buffer Length when transmit packets" am:
935513cbab
am:
3ba64555cc
Change-Id: I2c982afaefc31ccee49fd8326bde02f5af2b4d2a
Jakub Pawlowski [Thu, 25 Jan 2018 22:53:15 +0000 (22:53 +0000)]
Merge "Fixed L2CAP Buffer Length when transmit packets"
am:
935513cbab
Change-Id: I84dd547ead33d9099ea5265a8685f137781371fa
Jakub Pawlowski [Thu, 25 Jan 2018 22:37:16 +0000 (22:37 +0000)]
Merge "Fixed L2CAP Buffer Length when transmit packets"
Stanley Tng [Thu, 25 Jan 2018 19:40:35 +0000 (11:40 -0800)]
Fixed L2CAP Buffer Length when transmit packets
Fixed the problem of the L2CAP buffer length is incorrect than blasting
multiple small data packets from java layer. The buffer length should be
what is actually read rather than what is possible to be read.
Test: Ran the new ACTS Tests for LE CoC
Bug:
70683224
Change-Id: I6cf4d465a41e4e936420f76b49ce2dbda20d41fb
Pavlin Radoslavov [Thu, 25 Jan 2018 17:27:12 +0000 (17:27 +0000)]
Merge "Disable host compilation on Darwin for net_test_btif_state_machine"
Zach Johnson [Thu, 25 Jan 2018 16:52:07 +0000 (16:52 +0000)]
Don't pack and align GATT structs am:
1eda2929c9 am:
e2e36999d1
am:
90606c2cc0
Change-Id: Ia54ee6e17fd8bbf12025ae966cd670cfa0738eb8
Zach Johnson [Thu, 25 Jan 2018 16:49:35 +0000 (16:49 +0000)]
Don't pack and align GATT structs am:
1eda2929c9
am:
e2e36999d1
Change-Id: Ia16fdda3dc1fa7bb8e0b6a93d0b619315cc5eb78
Zach Johnson [Thu, 25 Jan 2018 16:46:36 +0000 (16:46 +0000)]
Don't pack and align GATT structs
am:
1eda2929c9
Change-Id: Iffeb0f1a7c85d194dcefbcaa8353918fa6f09916
Pavlin Radoslavov [Thu, 25 Jan 2018 13:15:38 +0000 (05:15 -0800)]
Disable host compilation on Darwin for net_test_btif_state_machine
The net_test_btif_state_machine unit test depends on libosi,
and that library itself is disabled for Darwin.
Test: Code compilation on Linux
Change-Id: I143015370988657e2903f86175244308c01d5162
android-build-team Robot [Thu, 25 Jan 2018 09:06:59 +0000 (09:06 +0000)]
Snap for
4565898 from
6f8df0ff662c844e2dd641fac23ef6fa550d8807 to pi-release
Change-Id: Ida7d6a9e0390cb1549f5df843a163247310a22f6
Pavlin Radoslavov [Tue, 16 Jan 2018 18:48:13 +0000 (10:48 -0800)]
Add a workaround for A2DP devices that request Role Change
Certain A2DP devices request Role Change after connection,
and typically the Phone grants it - as a result the Phone is the Slave.
However, with Multi-A2DP, follow-up A2DP connections require that the
Phone becomes the Master: within the existing stack we have function
bta_av_switch_if_needed() that checks whether the Phone needs to request
Role Change and become again the Master.
Some A2DP devices will refuse the Phone to become the Master again, and
this prevents/blocks the Phone from having multiple A2DP connections
that are open.
Test: Manual
Bug:
72122792
Bug:
70350399
Change-Id: I749c73a38e3fb10262143ba6b41a7d65309ddf49
Pavlin Radoslavov [Sat, 25 Nov 2017 03:12:11 +0000 (19:12 -0800)]
Add support for Multi-A2DP state machines per device
* Reimplement most of the BTIF AV state machinery in C++
- Separate the BTIF AV Source from BTIF AV Sink state:
btif_av_source and btif_av_sink
- Remove the single btif_av_cb control block instance
- Add C++ based BtifStateMachine and remove the older C-based
btif_sm state machine
- Introduce C++ class BtifAvPeer to keep state per peer, and use
a single state machine instance per peer
- Update BTA_AvStart() and BTA_AvStop() to take tBTA_AV_HNDL handle
argument
- Register the BTA handles when enabling the Source/Sink service.
This needs to be done in advance during service startup, otherwise
a connection to a remote device will fail.
- Move local event_handler functions inside C++ ProcessEvent methods,
and pocess the BTIF, BTA AV and BTA AVRCP events per state machine
instance
- Cleanup callbacks and use do_in_jni_thread() to schedule the processing
- Add BTIF AV API that needs to be called by the AVRCP module for certain
AVRCP events: btif_av_avrcp_event_open(), btif_av_avrcp_event_close()
btif_av_avrcp_event_remote_play()
- Add a mechanism to set the active device
- Add BluetoothDevice argument to the codec-related internal Binder
APIs: getCodecStatus(), enableOptionalCodecs(),
disableOptionalCodecs(), setCodecConfigPreference()
- Rename btif_av_move_idle() to btif_av_acl_disconnected() and
refactor the processing to happen within each state machine on the
correct thread.
- Process cleanup_src and cleanup_sink on the JNI thread
- Add a mechanism to track the maximum number of connected devices.
- Add unit tests for the new BtifStateMachine class
* Redesign some of the AVDTP internals so it can handle multiple connected
devices
- Change some of the AVDTP struct entries to C++ classes.
This simplifies significantly the design fixes
- Reorganize the AvdtpScb entries: for each connection the
corresponding SEP entries are within the corresponding AvdtpCcb entry.
- Pass peer address as argument to the API functions inside bta_av_co.cc,
and update the peer address inside the corresponding peer entry in
bta_av_co.cc
- Add various log mesages
- Store precomputed BTA AV SCB index in the AvdtpCcb entry and use it as
appropriate.
- Fix the TCID computation and handling for the AvdtpAdaptationLayer
- Fix the computed value for AVDT_NUM_RT_TBL
- Remove video-related code inside AVDTP
- Refactor/cleanup hard-coded callbacks that depend on the BTA_AV_NUM_STRS
value.
- Update various #define values to support a larger number of connected
devices:
- Maximum number of streams:
BTA_AV_NUM_STRS: 2 -> 6
- BT_RC_NUM_APP: 1 -> 12 (AVRCP-related - 2 * MaxDevices)
- MAX_L2CAP_LINKS: 7 -> 13
- MAX_L2CAP_CHANNELS: 16 -> 32
- AVDT_NUM_LINKS: 2 -> 6
- AVDT_NUM_SEPS: (6 * AVDT_NUM_LINKS) -> 6
Now the value is used for the maximum number of SEPs per device
- AVDT_NUM_TC_TBL: 6 -> (AVDT_NUM_SEPS + AVDT_NUM_LINKS)
- AVCT_NUM_LINKS: 2 -> 6
- AVCT_NUM_CONN: 3 -> 14 (2 * MaxDevices + 2)
Also:
- Update the JNI codec-related calls to use const reference
instead of a pointer
- Update the implementation of bta_av_chk_2nd_start() so it is aligned
with bta_av_chk_start() and cleaned up both functions.
- Rename btif_dispatch_sm_event() to btif_av_dispatch_sm_event() and
btif_report_source_codec_state() to btif_av_report_source_codec_state()
for consistency with the rest of the BTIF AV API.
- Add new function btif_rc_is_connected_peer() and remove
btif_rc_get_connected_peer()
- Add new AVRCP header file btif/include/btif_rc.h
and move the AVRCP "extern" declarations from btif_av.cc there.
- Rename btif_av_execute_service() to btif_av_source_execute_service()
- Cleanup the btif_av.h API descriptions
- Print the BTIF AV state in the "dumpsys bluetooth_manager" output
- Print the BTA AV state in the "dumpsys bluetooth_manager" output
- Print the AVDTP state in the "dumpsys bluetooth_manager" output
- Refactor btif_a2dp_source_cb into a class with internal state.
- Refactor A2DP Source worker thread handling and replace it with
libchrome message handler
- Refactor BtaAvCo component (bta_av_co.cc)
- C++ classes and state
- Rename bta_av_co_audio_src_data_path to
bta_av_co_audio_source_data_path
- Remove most BTA_AV_CO_CP_SCMS_T checks
- Replace mutex_global_lock() usage with local mutex
- Keep codec-specific state per peer
- Keep state about the active peer - the first connected peer is the
default active peer
- Report source codec state only for valid peers; i.e., don't report
source codec state for empty RawAddress
- Keep the contect_protect_active flag per peer
- Print the BTA AV CO state in the dumpsys bluetooth_manager" output
- Misc cleanup in BTA AV
- Add ToString() method to struct btav_a2dp_codec_config_t
- Additional cleanup
Bug:
70350399
Test: Manual and unit tests
Change-Id: Icecd7fd44a222d939b63a7473a2239ae0679f08c
Zach Johnson [Thu, 25 Jan 2018 02:22:14 +0000 (18:22 -0800)]
Don't pack and align GATT structs
Causes BUS_ADRALEN on some architectures.
Change-Id: I50c2e1b4ef81fa8cd223cba09285099da8d7f67d
Fixes:
70571956
Test: 100% repro on bug before change, retest and 0% repro
Jakub Pawlowski [Wed, 24 Jan 2018 23:06:03 +0000 (23:06 +0000)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead am:
0d4868040f am:
ccd75ed157
am:
a512b6f2c8
Change-Id: I7e30b91576af3b976e01f9a9b5bbff252e527011
Jakub Pawlowski [Wed, 24 Jan 2018 20:58:49 +0000 (20:58 +0000)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead am:
0d4868040f
am:
ccd75ed157
Change-Id: I5eccfce4aa6c27df33f51786ad4bf74032a68bfc
Jakub Pawlowski [Wed, 24 Jan 2018 20:55:22 +0000 (20:55 +0000)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead
am:
0d4868040f
Change-Id: I3ce30945bd3127204161d81d3a9bf3dafeb77a0a
Jakub Pawlowski [Tue, 23 Jan 2018 20:46:07 +0000 (12:46 -0800)]
Get rid of BTA_SYS_DM - use do_in_bta_thread instead
Test: Bond, change device name, scan for classic devices
Change-Id: If8d95976c4bb9ee6f346682590285cfc9d163ff5
Jack He [Wed, 24 Jan 2018 19:54:15 +0000 (19:54 +0000)]
HFP: Add support for Multi-HFP (2/2) am:
ca7d6f5912 am:
35f2dae044
am:
cfd374515e
Change-Id: I404e225a5c7bbd8a51153b8b3c7e6896abc8252d
Jack He [Wed, 24 Jan 2018 19:47:13 +0000 (19:47 +0000)]
HFP: Add support for Multi-HFP (2/2) am:
ca7d6f5912
am:
35f2dae044
Change-Id: Ic13fa9eea73258ee5ec2797adc62dd5d2234762f
Jack He [Wed, 24 Jan 2018 19:42:43 +0000 (19:42 +0000)]
HFP: Add support for Multi-HFP (2/2)
am:
ca7d6f5912
Change-Id: Ia80e37d828827b70cab4465b8d9044dd463ee8a3
Jack He [Wed, 10 Jan 2018 10:34:05 +0000 (02:34 -0800)]
HFP: Add support for Multi-HFP (2/2)
* Allocate at most 6 control blocks for btif_hf and bta_ag,
this limit is defined by BTA_AG_MAX_NUM_CLIENTS
* Allow at most 6 RFCOMM connections to be managed by bta_ag
* Allow at most 6 SDP callbacks for each bta_ag
* Reject incoming SCO connection and do not start outgoing SCO
connection if not coming from the current active device
* Reject incoming AT+BCC request if the remote device is not an active
device
* Support only one device by default
* Fixed a bug in BTM_CreateSco where power mode was checked for old
device and new power mode is set for new device and caused BTM SCO
state machine to stuck in SCO_ST_PEND_UNPARK mode
* Added logs at failure conditions to be more verbose about connection
errors and removed logs from non-error conditions to reduce verbosity
in normal conditions
Bug:
68952570
Test: runtest -j40 bluetooth, native unit tests, HFP regression for 1
device, simple tests for multiple devices
Change-Id: I97d20f6a126d77a4ef3a0cd1706b48130b4a6aae
Jakub Pawlowski [Wed, 24 Jan 2018 16:00:09 +0000 (16:00 +0000)]
Minor improvements in LE Create Connection handling am:
659e34f343 am:
418eed965e
am:
f9b4369e26
Change-Id: I6961f871ececd8ff5320be62501e32994404d581
Jakub Pawlowski [Wed, 24 Jan 2018 15:56:36 +0000 (15:56 +0000)]
Minor improvements in LE Create Connection handling am:
659e34f343
am:
418eed965e
Change-Id: I93d7415bc612de7c0679a15add60c26a55f7ec2c
Jakub Pawlowski [Wed, 24 Jan 2018 15:55:08 +0000 (15:55 +0000)]
Minor improvements in LE Create Connection handling
am:
659e34f343
Change-Id: I8153117afffb8b1fca50a33b3da9d23779558cbe
android-build-team Robot [Wed, 24 Jan 2018 08:24:52 +0000 (08:24 +0000)]
Snap for
4562879 from
40769fd2a06abda08f32115b97837b4f9afc6eeb to pi-release
Change-Id: I66ac7bd85a0743ac52d16deed8d9820230e39474
Kevin Rocard [Wed, 24 Jan 2018 06:26:16 +0000 (06:26 +0000)]
Merge "Revert "Audio V4: Split system and vendor Audio.h""
Kevin Rocard [Wed, 24 Jan 2018 06:13:51 +0000 (06:13 +0000)]
Revert "Audio V4: Split system and vendor Audio.h"
This reverts commit
68cbb98c8dd5ea4e9892c1ca31ea917069d32c0e.
Reason for revert: Breaks the build of multiple devices
Change-Id: Iec3058053a8ce3560b5f1fc9563e653badbaaca8
Kevin Rocard [Wed, 24 Jan 2018 04:04:47 +0000 (04:04 +0000)]
Merge "Audio V4: Split system and vendor Audio.h"
Jakub Pawlowski [Tue, 23 Jan 2018 17:07:59 +0000 (09:07 -0800)]
Minor improvements in LE Create Connection handling
1. According to spec, controller should never send "Command Complete" event
after "LE Create Connection" or "LE Extened Create Connection" command.
Add error message in such case.
2. Parse Comand Status for LE Enhanced Create Connection.
3. Fix NPE in btm_ble_update_mode_operation, when called from
btm_ble_create_ll_conn_complete.
Test: Bond/unbond with few LE devices while connected.
Change-Id: Ic135d9a8d096634afe33997afb42d054237598c2
gitbuildkicker [Tue, 23 Jan 2018 22:20:32 +0000 (14:20 -0800)]
merge in pi-release history after reset to master
Stanley Tng [Tue, 23 Jan 2018 21:08:03 +0000 (21:08 +0000)]
Merge "Allow L2CAP first packet with partial header" am:
8535edaade am:
ef83681de9
am:
27478a0e24
Change-Id: I53046bef0daddd516a2a02813b85a0f44057d8bd
gitbuildkicker [Tue, 23 Jan 2018 20:14:39 +0000 (12:14 -0800)]
merge in pi-release history after reset to master
Stanley Tng [Tue, 23 Jan 2018 20:09:56 +0000 (20:09 +0000)]
Merge "Allow L2CAP first packet with partial header" am:
8535edaade
am:
ef83681de9
Change-Id: I8b72178c34750ffa2c16af7676377e723d9556ad
Stanley Tng [Tue, 23 Jan 2018 19:42:38 +0000 (19:42 +0000)]
Merge "Allow L2CAP first packet with partial header"
am:
8535edaade
Change-Id: I6f2bbbe5a77bd393455b2af00f473e6473d0072e
Treehugger Robot [Tue, 23 Jan 2018 19:00:57 +0000 (19:00 +0000)]
Merge "Allow L2CAP first packet with partial header"
Stanley Tng [Tue, 23 Jan 2018 16:48:38 +0000 (16:48 +0000)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number am:
a34e9b4823 am:
928276cb5f
am:
194c4e76ef
Change-Id: I1667852a4dbcc3cba2741d4f8fce2492dc86bed0
Stanley Tng [Tue, 23 Jan 2018 16:44:19 +0000 (16:44 +0000)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number am:
a34e9b4823
am:
928276cb5f
Change-Id: I1e796a1595b0a89203ce6fc766ee25180b537035
Stanley Tng [Tue, 23 Jan 2018 16:39:10 +0000 (16:39 +0000)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number
am:
a34e9b4823
Change-Id: Ia922c148fcaa38206cb060cbba5b897b5744fed6
Stanley Tng [Fri, 5 Jan 2018 17:25:11 +0000 (09:25 -0800)]
Remove L2CAP_MASK_LE_COC_CHANNEL flag in channel number
Cleanup the code by removing the use of L2CAP_MASK_LE_COC_CHANNEL flag
in the channel number. This flag will be passed in the proper "flags"
parameter.
Test: Ran the new ACTS Tests for LE CoC
Bug:
70683224
Change-Id: I6ed77b46e5434bca5f2501d853ae8181c7197b4c
Jakub Pawlowski [Tue, 23 Jan 2018 16:12:53 +0000 (16:12 +0000)]
Use do_in_bta_thread in BTA DM layer am:
154be11f74 am:
d33cd5ab03
am:
2b01802134
Change-Id: Iec539de8dfd554fb1c4c2d01f283e599f43a4405
Jakub Pawlowski [Tue, 23 Jan 2018 16:07:50 +0000 (16:07 +0000)]
Use do_in_bta_thread in BTA DM layer am:
154be11f74
am:
d33cd5ab03
Change-Id: Ic887a9aacd6e8dabd4ab83cb538e6ad5a77d3803
Jakub Pawlowski [Tue, 23 Jan 2018 16:02:50 +0000 (16:02 +0000)]
Use do_in_bta_thread in BTA DM layer
am:
154be11f74
Change-Id: I7c7b578985b5094be304f964f371601343a70a58
android-build-team Robot [Tue, 23 Jan 2018 08:21:08 +0000 (08:21 +0000)]
Snap for
4560043 from
7d02f1b0a922759e4683a0d6ab687793f2600529 to pi-release
Change-Id: Ieb5dedc5afab0ea3f1fcff5a8977e02e3ffb0c84
gitbuildkicker [Tue, 23 Jan 2018 06:28:37 +0000 (22:28 -0800)]
merge in pi-release history after reset to master
Jakub Pawlowski [Mon, 22 Jan 2018 18:22:43 +0000 (10:22 -0800)]
Use do_in_bta_thread in BTA DM layer
This patch is transforming all the trivial cases, where no variable
length data is included in the event struct. Further patches will
convert the non-trivial cases.
Bug: none
Test: scan, connect, set name, remove device
Change-Id: Ia216a8a7c3bb225aedac34375ce07b109398557c
gitbuildkicker [Tue, 23 Jan 2018 00:31:39 +0000 (16:31 -0800)]
merge in pi-release history after reset to master
Jakub Pawlowski [Tue, 23 Jan 2018 00:28:38 +0000 (00:28 +0000)]
Forward Hearing Aid UUID when discovered over LE am:
35bd37d395 am:
7167f129a5
am:
7095e42a12
Change-Id: Id32d87db40c31ebda4e80fca34bd75a082cae28b
Jakub Pawlowski [Tue, 23 Jan 2018 00:23:34 +0000 (00:23 +0000)]
Forward Hearing Aid UUID when discovered over LE am:
35bd37d395
am:
7167f129a5
Change-Id: Ie4ba93fa36d0bed27909a8046bc9e1be24f6a2ea
Jakub Pawlowski [Tue, 23 Jan 2018 00:19:27 +0000 (00:19 +0000)]
Forward Hearing Aid UUID when discovered over LE
am:
35bd37d395
Change-Id: I39945939bc5e899f0000c2a8d05eedd0e61b6249
Gurpreet Ghai [Mon, 22 Jan 2018 20:20:13 +0000 (20:20 +0000)]
BTE: Allocate LogMsg buffer on the stack am:
7a3819f092 am:
a6474abbea
am:
110a907c0a
Change-Id: I36bcd56e4742265bb518ebb536f281b97c6e6246
Gurpreet Ghai [Mon, 22 Jan 2018 20:05:42 +0000 (20:05 +0000)]
BTE: Allocate LogMsg buffer on the stack am:
7a3819f092
am:
a6474abbea
Change-Id: Ie6733b5643b0b6ceea1c976cce2288909308d1c1
Gurpreet Ghai [Mon, 22 Jan 2018 19:52:42 +0000 (19:52 +0000)]
BTE: Allocate LogMsg buffer on the stack
am:
7a3819f092
Change-Id: I54c0bf8dc64ad9c11a6d745aa64f16bbde3a9f6c
Jakub Pawlowski [Tue, 21 Nov 2017 20:21:05 +0000 (12:21 -0800)]
Forward Hearing Aid UUID when discovered over LE
This way upper layers (Settings app) can make decision whether to connect
to the profile.
Test: none
Bug:
69623109
Change-Id: I98e93ebbf7ceadd1756e4dfd0e8c4f876544b39d
Satish Kodishala [Mon, 22 Jan 2018 17:01:37 +0000 (17:01 +0000)]
Do SDP when HSP connection starts by remote am:
ade654f3dc am:
1bd52b3daf
am:
f7b5413b71
Change-Id: Ie754420ef46090db18e2c8dc6d5365bae3ac3b60
Satish Kodishala [Mon, 22 Jan 2018 16:59:45 +0000 (16:59 +0000)]
Do SDP when HSP connection starts by remote am:
ade654f3dc
am:
1bd52b3daf
Change-Id: Ia5e1d753ae4416a401781fd01f05585d1afb09bc
Gurpreet Ghai [Mon, 7 Aug 2017 06:05:22 +0000 (11:35 +0530)]
BTE: Allocate LogMsg buffer on the stack
Problem:
Due to static 1k buffer in LogMsg function is leading to a crash in
btapp as this function is called from multiple threads
Steps:
A2DP streaming or similar process that performs excessive logging
Failure: Crash occurs
Root Cause:
Static buffer being accessed and updated by different threads parallelly
Fix:
Used local buffer instead of static buffer from LogMsg function
Test: manual
Fixes:
69586278
Change-Id: I037d85c1ca0e134d1fa86308d0467f88d8ea159d
Satish Kodishala [Mon, 22 Jan 2018 16:57:03 +0000 (16:57 +0000)]
Do SDP when HSP connection starts by remote
am:
ade654f3dc
Change-Id: If3a217646b08e2f2f184d646aa9a786851481328
Satish Kodishala [Thu, 11 Aug 2016 04:51:48 +0000 (10:21 +0530)]
Do SDP when HSP connection starts by remote
Test: 1. Enable only HSP profile on AG.
2. Connect to AG from BT headset supporting HSP profile only with VGS
3. VOIP call (eg. skype, hangout)
4. Control the volume using AG volume keys.
Failure:
Volume changes are not taking affect.
Rootcause:
When remote is doing SDP first, HSP AG is skipping SDP.
As a result, AG is not aware if remote supports remote
volume control feature.
Fix:
Don't skip SDP when remote does SDP first. Do SDP always
so that AG could find out if remote supports remote volume
control feature.
Fixes:
35657384
Change-Id: I73707f774dc4ec53cbd510ded15f28f87659eec3