OSDN Git Service

android-x86/system-bt.git
6 years ago[automerger skipped] If command_timed_out() is triggered don't get blocked by a deadlock
Pavlin Radoslavov [Wed, 27 Jun 2018 19:49:52 +0000 (12:49 -0700)]
[automerger skipped] If command_timed_out() is triggered don't get blocked by a deadlock
am: 14cb1ba6d6  -s ours

Change-Id: I4e5083dc37f4d7f58bd52913d6765c86bd8fd100

6 years agoIf command_timed_out() is triggered don't get blocked by a deadlock am: 2838b32ce4
Pavlin Radoslavov [Tue, 26 Jun 2018 22:55:51 +0000 (15:55 -0700)]
If command_timed_out() is triggered don't get blocked by a deadlock am: 2838b32ce4
am: 5866d9e2a9

Change-Id: I1d1502a6c655887714c8c7f34505a621b571be04

6 years agoIf command_timed_out() is triggered don't get blocked by a deadlock
Pavlin Radoslavov [Tue, 26 Jun 2018 22:51:43 +0000 (15:51 -0700)]
If command_timed_out() is triggered don't get blocked by a deadlock
am: 2838b32ce4

Change-Id: I62b171d4f71ca81e36c06312f93b817482ecf615

6 years agoIf command_timed_out() is triggered don't get blocked by a deadlock
Pavlin Radoslavov [Thu, 21 Jun 2018 01:28:33 +0000 (18:28 -0700)]
If command_timed_out() is triggered don't get blocked by a deadlock

If command_timed_out() is triggered and we cannot acquire the
commands_pending_response_mutex to print the debug info, then proceed
with the rest of the operations until the process aborts.

Similarly, if startup_timer_expired() is triggered and we are blocked
by a deadlock, just abort() because there is no way to recover.

Bug: 110441099
Test: Code compilation
Change-Id: I367332bbbd9c1d887bd2bc829b9f617114fc96fc
Merged-In: I367332bbbd9c1d887bd2bc829b9f617114fc96fc
(cherry picked from commit 2838b32ce424a6f8c8025175aaf9b6fd8cab313f)

6 years agoIf command_timed_out() is triggered don't get blocked by a deadlock
Pavlin Radoslavov [Thu, 21 Jun 2018 01:28:33 +0000 (18:28 -0700)]
If command_timed_out() is triggered don't get blocked by a deadlock

If command_timed_out() is triggered and we cannot acquire the
commands_pending_response_mutex to print the debug info, then proceed
with the rest of the operations until the process aborts.

Similarly, if startup_timer_expired() is triggered and we are blocked
by a deadlock, just abort() because there is no way to recover.

Bug: 110441099
Test: Code compilation
Change-Id: I367332bbbd9c1d887bd2bc829b9f617114fc96fc

6 years agoMerge "resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage...
Jakub Pawlowski [Tue, 26 Jun 2018 12:14:50 +0000 (05:14 -0700)]
Merge "resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp-master" into stage-aosp-master
am: b693ce2ec8

Change-Id: I5e71287f9b60bced691704b5dae930805b1579da

6 years agoresolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp...
Florian Mayer [Tue, 26 Jun 2018 12:11:43 +0000 (05:11 -0700)]
resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp-master
am: a1911e70bd

Change-Id: Icd6e267b309e678e1136e76160decc259ac8d300

6 years agoMerge "resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage...
TreeHugger Robot [Tue, 26 Jun 2018 12:11:13 +0000 (12:11 +0000)]
Merge "resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp-master" into stage-aosp-master

6 years agoresolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp...
Florian Mayer [Tue, 26 Jun 2018 09:18:31 +0000 (10:18 +0100)]
resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp-master

Change-Id: I9ef67219c4a054aa9c2905ba96e6f5e2afb9a493

6 years agoresolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp...
Jakub Pawlowski [Tue, 26 Jun 2018 09:11:52 +0000 (02:11 -0700)]
resolve merge conflicts of 430e59d86077cfbbe4421e395ca116768ea02afa to stage-aosp-master

Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: Id88890e2e87d94d4bd2a55ac3812d1b11a78b26b

6 years agoMove crypto related functions into crypto_toolbox
Jakub Pawlowski [Thu, 21 Jun 2018 12:23:47 +0000 (14:23 +0200)]
Move crypto related functions into  crypto_toolbox

Also clean up the code:
* remove spurious logging, or replace with DVLOG
* use std::copy and std::reverse_copy instead of ARRAY_TO_STREAM and
  REVERSE_ARRAY_TO_STREAM

Test: CryptoToolboxTest already cover all those functions
Change-Id: I3221d0966d2dd6ca229adf441ceb75dd37a54d7c
Merged-In: I3221d0966d2dd6ca229adf441ceb75dd37a54d7c

6 years agoMerge "Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands" am...
Pavlin Radoslavov [Tue, 26 Jun 2018 03:12:21 +0000 (20:12 -0700)]
Merge "Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands" am: 96e84672e8
am: ee8c555843

Change-Id: I7ca42a76fe73300570fa8ef9f85e21aca65ce533

6 years agoMerge "Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands"
Pavlin Radoslavov [Tue, 26 Jun 2018 03:09:18 +0000 (20:09 -0700)]
Merge "Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands"
am: 96e84672e8

Change-Id: I12094731788806e14e0cc57af3b239415e69770e

6 years agoMerge "Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands"
Treehugger Robot [Tue, 26 Jun 2018 03:02:47 +0000 (03:02 +0000)]
Merge "Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands"

6 years agoMerge "Add missing btif_a2dp_audio_interface_end_session() call during disconnect...
Pavlin Radoslavov [Tue, 26 Jun 2018 03:00:52 +0000 (20:00 -0700)]
Merge "Add missing btif_a2dp_audio_interface_end_session() call during disconnect" am: 80241319d9
am: da259b10e4

Change-Id: Ib75f3cc89168a0b5d897ba0290dff67b27d7002b

6 years agoMerge "Add missing btif_a2dp_audio_interface_end_session() call during disconnect"
Pavlin Radoslavov [Tue, 26 Jun 2018 02:57:36 +0000 (19:57 -0700)]
Merge "Add missing btif_a2dp_audio_interface_end_session() call during disconnect"
am: 80241319d9

Change-Id: I0531174e25223961caaeaa62b45e1ef53142eace

6 years agoMerge "Add missing btif_a2dp_audio_interface_end_session() call during disconnect"
Treehugger Robot [Tue, 26 Jun 2018 02:50:44 +0000 (02:50 +0000)]
Merge "Add missing btif_a2dp_audio_interface_end_session() call during disconnect"

6 years agoMerge "a2dp_vendor_ldac: add missing break" am: 61966a4045
Tom Yan [Tue, 26 Jun 2018 02:19:05 +0000 (19:19 -0700)]
Merge "a2dp_vendor_ldac: add missing break" am: 61966a4045
am: 3bd946815a

Change-Id: Ia06ae5f927317b27f0a04ca5ef0465c75645b6ae

6 years agoMerge "a2dp_vendor_ldac: add missing break"
Tom Yan [Tue, 26 Jun 2018 02:16:06 +0000 (19:16 -0700)]
Merge "a2dp_vendor_ldac: add missing break"
am: 61966a4045

Change-Id: I91be0419a5de60d40ca9cc22fedf74573cb2db59

6 years agoMerge "a2dp_vendor_ldac: add missing break"
Treehugger Robot [Tue, 26 Jun 2018 02:07:46 +0000 (02:07 +0000)]
Merge "a2dp_vendor_ldac: add missing break"

6 years agoReset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands
Pavlin Radoslavov [Mon, 25 Jun 2018 22:22:13 +0000 (15:22 -0700)]
Reset a2dp_cmd_pending as appropriate for A2DP HW offload HAL commands

Previously, the a2dp_cmd_pending was set to the last pending command,
but was never reset to A2DP_CTRL_CMD_NONE after the command processing
was completed.

Bug: 110712574
Test: Manual: Pair with two headsets, start/suspend/stop/switch active
      device
Change-Id: I464e6e9d41a221df44eba21e538b499a9ac1dcfb

6 years agoAdd missing btif_a2dp_audio_interface_end_session() call during disconnect
Pavlin Radoslavov [Mon, 25 Jun 2018 23:34:17 +0000 (16:34 -0700)]
Add missing btif_a2dp_audio_interface_end_session() call during disconnect

Update the logic inside btif_a2dp_source_end_session_delayed() to make
sure that btif_a2dp_audio_interface_end_session() is called when device
is disconnected.

Also, update existing log messages to make it easier to identify similar
issues in the future.

Bug: 110176990
Test: Manual: Pair with two headsets, start/suspend/stop/switch active
      device
Change-Id: I248e5c3e2c4cf0ad820cef34ba859e9adc8dec8e

6 years agoa2dp_vendor_ldac: add missing break
Tom Yan [Wed, 20 Jun 2018 04:10:45 +0000 (12:10 +0800)]
a2dp_vendor_ldac: add missing break

Bug: 110800823
Test: Code compilation
Change-Id: I9b40f63d176031087cb2ab2f2b5400b4d326cf8f
Signed-off-by: Tom Yan <tom.ty89@gmail.com>
6 years ago[automerger skipped] Gracefully handle A2DP hardware offload Audio HAL service death
Pavlin Radoslavov [Sat, 23 Jun 2018 00:23:44 +0000 (17:23 -0700)]
[automerger skipped] Gracefully handle A2DP hardware offload Audio HAL service death
am: 22f8446614  -s ours

Change-Id: I482c055d67b43bbd9b554316f7ebf316c8799a2c

6 years agoLinux build fix am: 55faa9e962
Jakub Pawlowski [Fri, 22 Jun 2018 12:25:38 +0000 (05:25 -0700)]
Linux build fix am: 55faa9e962
am: 10881f2672

Change-Id: I779e50288c6fcc7d79e84b6cb0459a9e948e09ca

6 years agoLinux build fix
Jakub Pawlowski [Fri, 22 Jun 2018 12:22:50 +0000 (05:22 -0700)]
Linux build fix
am: 55faa9e962

Change-Id: Id8a1d0a02c60f86d7232394ad60af56b96a05b4e

6 years agoLinux build fix
Jakub Pawlowski [Thu, 21 Jun 2018 07:03:45 +0000 (09:03 +0200)]
Linux build fix

Add empty android_errorWriteLog implementation for Linux
Add missing license headers
Fix BUILD.gn files

Test: compile using ninja
Change-Id: I9be297d5847b4c0856786738eac2c30424593919

6 years agoMerge "HFP: Don't use mSBC for HF devices not supporting Codec Negotiation" am: f7c32...
weichinweng [Fri, 22 Jun 2018 05:35:31 +0000 (22:35 -0700)]
Merge "HFP: Don't use mSBC for HF devices not supporting Codec Negotiation" am: f7c320273a
am: d3519d262f

Change-Id: I1003b64667204cfa7d082e3ca5082d034c2fb053

6 years agoMerge "HFP: Don't use mSBC for HF devices not supporting Codec Negotiation"
weichinweng [Fri, 22 Jun 2018 05:32:35 +0000 (22:32 -0700)]
Merge "HFP: Don't use mSBC for HF devices not supporting Codec Negotiation"
am: f7c320273a

Change-Id: Ic17dcbc95f5fc000f7225eafc7cc7c803c871738

6 years agoMerge "HFP: Don't use mSBC for HF devices not supporting Codec Negotiation"
Treehugger Robot [Fri, 22 Jun 2018 05:26:17 +0000 (05:26 +0000)]
Merge "HFP: Don't use mSBC for HF devices not supporting Codec Negotiation"

6 years agoMove crypto toolbox functions into separate file am: 9bc641359a
Jakub Pawlowski [Fri, 22 Jun 2018 04:36:36 +0000 (21:36 -0700)]
Move crypto toolbox functions into separate file am: 9bc641359a
am: bce6fc86b1

Change-Id: I652e7514e39343dbceac42c70b0bb2a8aa31a356

6 years agoMove crypto toolbox functions into separate file
Jakub Pawlowski [Fri, 22 Jun 2018 04:32:37 +0000 (21:32 -0700)]
Move crypto toolbox functions into separate file
am: 9bc641359a

Change-Id: If008cd16c1ea637ae43b3a9c3548a503b636b7a2

6 years agoGracefully handle A2DP hardware offload Audio HAL service death
Pavlin Radoslavov [Wed, 20 Jun 2018 02:10:43 +0000 (19:10 -0700)]
Gracefully handle A2DP hardware offload Audio HAL service death

Register for Audio HAL service death, and restart the Audio HAL session
if necessary.

Bug: 77926419
Test: Manual: stream Bluetooth audio and kill -9 the audioserver
Change-Id: I45e83aea0fb95301e6ceadee74661dd55f8c0f66
Merged-In: I45e83aea0fb95301e6ceadee74661dd55f8c0f66
(cherry picked from commit 5c80c8653a61780f8047413d5ad9f939a8a397f3)

6 years agoAdd more crypto toolbox tests, plus minor fix in smp_keys.cc am: 4ccf14a29e
Jakub Pawlowski [Thu, 21 Jun 2018 22:08:35 +0000 (15:08 -0700)]
Add more crypto toolbox tests, plus minor fix in smp_keys.cc am: 4ccf14a29e
am: aec9a61676

Change-Id: Ieb70f6359c17da79c6dad7aaeb18f58f601c4abd

6 years agoAdd more crypto toolbox tests, plus minor fix in smp_keys.cc
Jakub Pawlowski [Thu, 21 Jun 2018 21:57:42 +0000 (14:57 -0700)]
Add more crypto toolbox tests, plus minor fix in smp_keys.cc
am: 4ccf14a29e

Change-Id: I2b3b6bdfce721892d9f79dd1e8a94e6b307eab9e

6 years agoMove crypto toolbox functions into separate file
Jakub Pawlowski [Tue, 19 Jun 2018 21:48:07 +0000 (14:48 -0700)]
Move crypto toolbox functions into separate file

Test: already covered by CryptoToolboxTest
Change-Id: I9ba12616d51744fe46648a00a73065cf66f54297

6 years agoAdd more crypto toolbox tests, plus minor fix in smp_keys.cc
Jakub Pawlowski [Mon, 18 Jun 2018 20:33:26 +0000 (13:33 -0700)]
Add more crypto toolbox tests, plus minor fix in smp_keys.cc

This code extracts two new functions, smp_calculate_ltk_to_link_key
and smp_calculate_link_key_to_ltk, in order to test them.
Also use modulo operator to compute modulo in smp_calculate_g2.
Plus remove unused function definitions in smp_int.h, that were probably
previously used for testing.

Test: added and updated CryptoToolboxTest
Change-Id: Ia84f72af666fc8e34f887b65b07208bc786bf2e0

6 years ago[automerger skipped] Correctly initialize A2DP Sink codecs if A2DP Source HW offload...
Pavlin Radoslavov [Thu, 21 Jun 2018 16:32:45 +0000 (09:32 -0700)]
[automerger skipped] Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled
am: 00c890f61f  -s ours

Change-Id: If87e60e2133d6238156813205656fb523ad56a81

6 years agoHFP: Don't use mSBC for HF devices not supporting Codec Negotiation
weichinweng [Thu, 21 Jun 2018 06:28:25 +0000 (14:28 +0800)]
HFP: Don't use mSBC for HF devices not supporting Codec Negotiation

* Some misbehaving HF devices (e.g. Sony XAV AX100 carkit, Sony MW600)
  indicate their support on WBS but not support on Codec Negotiation.
  In this condition, if Fluoride chooses mSBC will result in big noise or SCO
  no sound.
* This CL adds a workaround for checking if HF device indicate codec negotiation is
  not supported, Fluoride will assume CVSD codec by default.

Bug: 101592600
Test: make, connect SCO and check voice on carkit and headset.
Change-Id: If0d8779bcfd55b87852f56f0448fd1b585ee45ad

6 years agoRemove unused MIP events, calbacks and structs am: 9c80066669
Jakub Pawlowski [Wed, 20 Jun 2018 23:17:54 +0000 (16:17 -0700)]
Remove unused MIP events, calbacks and structs am: 9c80066669
am: d65082b7a4

Change-Id: I789bcf631d7792e2920246534e6f48149b69e033

6 years agoRemove unused MIP events, calbacks and structs
Jakub Pawlowski [Wed, 20 Jun 2018 23:14:37 +0000 (16:14 -0700)]
Remove unused MIP events, calbacks and structs
am: 9c80066669

Change-Id: I528c63e592ffbfff550b26490ef4a336c19cccba

6 years agoRemove unused MIP events, calbacks and structs
Jakub Pawlowski [Wed, 20 Jun 2018 21:09:21 +0000 (14:09 -0700)]
Remove unused MIP events, calbacks and structs

Test: compilation
Change-Id: I00e0fcfdea129f0f7eee16d69c5fc09451ad6746

6 years agoGracefully handle A2DP hardware offload Audio HAL service death am: 5c80c8653a
Pavlin Radoslavov [Wed, 20 Jun 2018 21:04:17 +0000 (14:04 -0700)]
Gracefully handle A2DP hardware offload Audio HAL service death am: 5c80c8653a
am: 4eadf141d0

Change-Id: I458f8c35bbe2f14721c63bcbb5618c909f8ee096

6 years agoGracefully handle A2DP hardware offload Audio HAL service death
Pavlin Radoslavov [Wed, 20 Jun 2018 20:54:11 +0000 (13:54 -0700)]
Gracefully handle A2DP hardware offload Audio HAL service death
am: 5c80c8653a

Change-Id: I43efdc6a4200e181b4425956ec2c9a2ab4ef3018

6 years agoGracefully handle A2DP hardware offload Audio HAL service death
Pavlin Radoslavov [Wed, 20 Jun 2018 02:10:43 +0000 (19:10 -0700)]
Gracefully handle A2DP hardware offload Audio HAL service death

Register for Audio HAL service death, and restart the Audio HAL session
if necessary.

Bug: 77926419
Test: Manual: stream Bluetooth audio and kill -9 the audioserver
Change-Id: I45e83aea0fb95301e6ceadee74661dd55f8c0f66

6 years agoReplace BT_OCTET16 with Octet16 am: ae57211e7c
Jakub Pawlowski [Tue, 19 Jun 2018 23:02:34 +0000 (16:02 -0700)]
Replace BT_OCTET16 with Octet16 am: ae57211e7c
am: b7ff09c690

Change-Id: I9a79d238757441734aaf98453898a7ed96da4852

6 years agoReplace BT_OCTET16 with Octet16
Jakub Pawlowski [Tue, 19 Jun 2018 22:53:31 +0000 (15:53 -0700)]
Replace BT_OCTET16 with Octet16
am: ae57211e7c

Change-Id: Ifd17a42294cb312c7436f2e7c36d3e4aa6625c04

6 years agoCorrectly initialize A2DP Sink codecs if A2DP Source HW offload is enabled
Pavlin Radoslavov [Thu, 14 Jun 2018 23:27:54 +0000 (16:27 -0700)]
Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled

This also fixes unit test failures if A2DP Source HW offload is enabled.

Bug: 110228602
Test: Failing unit tests now succeed
Change-Id: I36678738bfcfcce0f2e8a055f10c86cc6b3e682a
Merged-In: I36678738bfcfcce0f2e8a055f10c86cc6b3e682a
(cherry picked from commit af66441fecd1b56c26d5c25866d6fc7677ec0c2a)

6 years agoReplace BT_OCTET16 with Octet16
Jakub Pawlowski [Fri, 15 Jun 2018 00:40:34 +0000 (17:40 -0700)]
Replace BT_OCTET16 with Octet16

BT_OCTET16 was a uint8_t[16], that is a pointer.
This means that it was not copyable, and one had to be always aware of
what this type really means when passing it to function.

Octet16 is std::array<uint8_t, 16> and is copyable. It can also be
copied using "=" operator, instead of memcpy, or ARRAY_TO_STREAM.

Octet16 can also be returned from function by value. Thanks to it, some
smp functions can be simplified, by returning value instead of accepting
pointer to output.

Test: net_stack_smp_test
Change-Id: I0687a948e5807f76ec3d1b5d1d4d2ad2b50b87dd

6 years agoFix SMP_Encrypt for data shorter than 16 bytes am: db83273e52
Jakub Pawlowski [Mon, 18 Jun 2018 22:26:28 +0000 (15:26 -0700)]
Fix SMP_Encrypt for data shorter than 16 bytes am: db83273e52
am: 5576c09222

Change-Id: I757767c03e2d90342ad85bdb3f27f585a866eb7e

6 years agoFix SMP_Encrypt for data shorter than 16 bytes
Jakub Pawlowski [Mon, 18 Jun 2018 22:23:24 +0000 (15:23 -0700)]
Fix SMP_Encrypt for data shorter than 16 bytes
am: db83273e52

Change-Id: I75db1b7271a843578d4be45646769878665af45d

6 years agoFix SMP_Encrypt for data shorter than 16 bytes
Jakub Pawlowski [Mon, 18 Jun 2018 20:29:24 +0000 (13:29 -0700)]
Fix SMP_Encrypt for data shorter than 16 bytes

This bug was introduced in commit c3e7c878fe8495590f059547153bd77cdea322a6
osi_calloc was replaced with raw array, that is not wiped clean.

Change-Id: I57a4e7a26108ad4672d2dd2ff25028653c96ca1b

6 years agoMerge "SMP_Encrypt - convert p_out into raw array" am: 9fef176790
Jakub Pawlowski [Mon, 18 Jun 2018 19:49:49 +0000 (12:49 -0700)]
Merge "SMP_Encrypt - convert p_out into raw array" am: 9fef176790
am: e2da90e74f

Change-Id: I91b87e7c7d2a0ac15bf2692b4c24a3609f694296

6 years agoMerge "SMP_Encrypt - convert p_out into raw array"
Jakub Pawlowski [Mon, 18 Jun 2018 19:36:53 +0000 (12:36 -0700)]
Merge "SMP_Encrypt - convert p_out into raw array"
am: 9fef176790

Change-Id: Ie7d6b7a6dbb5cf770be1217b9e70aca8d4c45fbb

6 years agoMerge "SMP_Encrypt - convert p_out into raw array"
Treehugger Robot [Mon, 18 Jun 2018 19:24:25 +0000 (19:24 +0000)]
Merge "SMP_Encrypt - convert p_out into raw array"

6 years ago[automerger skipped] Clear local suspending flag when the BTA_AV_STOP_EVT event received
cheneyni [Sat, 16 Jun 2018 08:12:42 +0000 (01:12 -0700)]
[automerger skipped] Clear local suspending flag when the BTA_AV_STOP_EVT event received
am: 796062b73f  -s ours

Change-Id: I225c4e5753be6ef27b5e0446244da806d440d536

6 years agogatt: Avoid using erased iterator am: b6cf0e0c47
Greg Kaiser [Sat, 16 Jun 2018 06:16:08 +0000 (23:16 -0700)]
gatt: Avoid using erased iterator am: b6cf0e0c47
am: db41e73344

Change-Id: Ic336a814bd442560c7d5c53b6e7adf70c2858598

6 years agogatt: Avoid using erased iterator
Greg Kaiser [Sat, 16 Jun 2018 05:47:28 +0000 (22:47 -0700)]
gatt: Avoid using erased iterator
am: b6cf0e0c47

Change-Id: I2a6daafd9ecec3f056c965081b55d16d2ed62543

6 years agogatt: Avoid using erased iterator
Greg Kaiser [Fri, 15 Jun 2018 21:30:50 +0000 (14:30 -0700)]
gatt: Avoid using erased iterator

After we've called erase() on an iterator, we can't safely use
it anymore.  We avoid this, to assure consistent behavior from
this code.

Test: None
Change-Id: I4c9aecadc768d57f942669b7e68ee3a302e67e9c

6 years agoMerge "Add support for AVRCP addressed player changed." am: 60f9ad0fce
Joseph Pirozzo [Fri, 15 Jun 2018 21:01:46 +0000 (14:01 -0700)]
Merge "Add support for AVRCP addressed player changed." am: 60f9ad0fce
am: f3b101feb9

Change-Id: I552aa7da3b69de4a81b5b7a4eab2bc68b8a697c1

6 years agoMerge "Add support for AVRCP addressed player changed."
Joseph Pirozzo [Fri, 15 Jun 2018 20:11:39 +0000 (13:11 -0700)]
Merge "Add support for AVRCP addressed player changed."
am: 60f9ad0fce

Change-Id: I7275200caeb8274b05ac486bde3e845f720e2310

6 years agoSMP_Encrypt - convert p_out into raw array
Jakub Pawlowski [Thu, 14 Jun 2018 23:46:29 +0000 (16:46 -0700)]
SMP_Encrypt - convert p_out into raw array

SMP_Encrypt output is really 128bit value. No need for status or any
other additional fields.

Test: net_test_stack_smp.AesCmacTest covers that
Change-Id: Iabfaa85d6f4bd5715e0bdab9d3eaf22bb5c39239

6 years agoMerge "Add support for AVRCP addressed player changed."
Joseph Pirozzo [Fri, 15 Jun 2018 18:54:57 +0000 (18:54 +0000)]
Merge "Add support for AVRCP addressed player changed."

6 years agoClear local suspending flag when the BTA_AV_STOP_EVT event received
cheneyni [Mon, 11 Jun 2018 13:19:26 +0000 (21:19 +0800)]
Clear local suspending flag when the BTA_AV_STOP_EVT event received

The Stack would set the pending flag when received the Stop request but
did not clear it even state became Opened.  This would cuase Stack
replied Suspended immediately to Audio HAL but kept peer at Started
state and failed to handle Start request again.

This change clears the local suspending flag when BTA_AV_STOP_EVT
received and also reset all pending status when becomes Opened so it
will take effect only when Stack is changing state from Started.

Bug: 110022304
Test: Manual: (1) Play A2DP music and switch codec
              (2) Play A2DP music and change active device

Change-Id: I4b9aca33eb7eb6c40038e2082d23eb22e5830714
Merged-In: I4b9aca33eb7eb6c40038e2082d23eb22e5830714
(cherry picked from commit e643d30249256461fd1c0a132b48c65e2eac18ba)

6 years agoMerge "A2DP Offload: Log audio duration and codec metrics" am: 04f519cc02
Jack He [Fri, 15 Jun 2018 17:54:44 +0000 (10:54 -0700)]
Merge "A2DP Offload: Log audio duration and codec metrics" am: 04f519cc02
am: 55ed4487bd

Change-Id: I2aa23ec9a4926c319f9b68731b79d375781391b9

6 years agoMerge "A2DP Offload: Log audio duration and codec metrics"
Jack He [Fri, 15 Jun 2018 17:50:39 +0000 (10:50 -0700)]
Merge "A2DP Offload: Log audio duration and codec metrics"
am: 04f519cc02

Change-Id: I4189cc8720668a793db7c0dd56b35d7d51db92f6

6 years agoMerge "A2DP Offload: Log audio duration and codec metrics"
Treehugger Robot [Fri, 15 Jun 2018 17:40:32 +0000 (17:40 +0000)]
Merge "A2DP Offload: Log audio duration and codec metrics"

6 years agoClear local suspending flag when the BTA_AV_STOP_EVT event received am: e643d30249
cheneyni [Fri, 15 Jun 2018 08:48:04 +0000 (01:48 -0700)]
Clear local suspending flag when the BTA_AV_STOP_EVT event received am: e643d30249
am: 223ed5a695

Change-Id: If23b35c5587772f36c78dc2330fd36d21104c15a

6 years agoClear local suspending flag when the BTA_AV_STOP_EVT event received
cheneyni [Fri, 15 Jun 2018 08:44:08 +0000 (01:44 -0700)]
Clear local suspending flag when the BTA_AV_STOP_EVT event received
am: e643d30249

Change-Id: Ic373f590620291ec6e6afe4944768fd5a51b8baa

6 years agoClear local suspending flag when the BTA_AV_STOP_EVT event received
cheneyni [Mon, 11 Jun 2018 13:19:26 +0000 (21:19 +0800)]
Clear local suspending flag when the BTA_AV_STOP_EVT event received

The Stack would set the pending flag when received the Stop request but
did not clear it even state became Opened.  This would cuase Stack
replied Suspended immediately to Audio HAL but kept peer at Started
state and failed to handle Start request again.

This change clears the local suspending flag when BTA_AV_STOP_EVT
received and also reset all pending status when becomes Opened so it
will take effect only when Stack is changing state from Started.

Bug: 110022304
Test: Manual: (1) Play A2DP music and switch codec
              (2) Play A2DP music and change active device

Change-Id: I4b9aca33eb7eb6c40038e2082d23eb22e5830714

6 years agoMerge "Fix the reconnect issue in hfp client" am: e0628146cb
Jinguang Dong [Fri, 15 Jun 2018 06:34:26 +0000 (23:34 -0700)]
Merge "Fix the reconnect issue in hfp client" am: e0628146cb
am: f9d9064043

Change-Id: Ia8d2a0e7ac32836722a49f454c80e0314fb28e1f

6 years agoMerge "Fix the reconnect issue in hfp client"
Jinguang Dong [Fri, 15 Jun 2018 06:30:23 +0000 (23:30 -0700)]
Merge "Fix the reconnect issue in hfp client"
am: e0628146cb

Change-Id: Ib687fb0b11cef8e1bbd3abc30a76ed21c1574e64

6 years agoMerge "Fix the reconnect issue in hfp client"
Treehugger Robot [Fri, 15 Jun 2018 06:22:30 +0000 (06:22 +0000)]
Merge "Fix the reconnect issue in hfp client"

6 years agoMerge "Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled...
Pavlin Radoslavov [Fri, 15 Jun 2018 02:05:14 +0000 (19:05 -0700)]
Merge "Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled" am: a69b5ecfea
am: dbf9fb39b3

Change-Id: I156a200e5d40f2bf046076fb2b7c53fd5315d45d

6 years agoMerge "Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled"
Pavlin Radoslavov [Fri, 15 Jun 2018 02:00:51 +0000 (19:00 -0700)]
Merge "Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled"
am: a69b5ecfea

Change-Id: I46796070c29b454f35c9e24b8a5cc76b57d70eee

6 years agoA2DP Offload: Log audio duration and codec metrics
Jack He [Fri, 15 Jun 2018 01:04:12 +0000 (18:04 -0700)]
A2DP Offload: Log audio duration and codec metrics

* Add A2dpOffloadAudioStats class to store metrics for A2DP offload
* Add logging statements to log A2DP start/suspend/stop events when A2DP
  offload is enabled
* Separate software encoding logging from hardware encoding logging

Bug: 109953464
Test: make, run A2DP in offload mode and dump metrics
Change-Id: I1a19c64c6b1ee530e5927dd3d13e31b00729850b

6 years agoMerge "Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled"
Treehugger Robot [Fri, 15 Jun 2018 01:39:43 +0000 (01:39 +0000)]
Merge "Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled"

6 years agoHearing Aid: codec and connection interval switching am: 518410ab59
Stanley Tng [Fri, 15 Jun 2018 00:52:22 +0000 (17:52 -0700)]
Hearing Aid: codec and connection interval switching am: 518410ab59
am: 2104f6fec4

Change-Id: If0bf3d2db5e8f9b7dbb5aa6b9b2b826c5bf64989

6 years agoHearing Aid: codec and connection interval switching
Stanley Tng [Fri, 15 Jun 2018 00:48:47 +0000 (17:48 -0700)]
Hearing Aid: codec and connection interval switching
am: 518410ab59

Change-Id: I3a2fa96f4883032d9394ed13f007abe6473bd014

6 years agoHearing Aid: codec and connection interval switching
Stanley Tng [Sat, 9 Jun 2018 00:09:00 +0000 (17:09 -0700)]
Hearing Aid: codec and connection interval switching

Added support to switch the LE Connection Interval between 10 msec and
20 msec. Uses the "persist.bluetooth.hearingaid.interval" to configure.

Test: Manually use hearing aid devices and switches between 10 msec and
20 msec connection interval
Bug: 79579786

Change-Id: Iec15a0c9f76afe265368fd90662ffe60a29fb27b

6 years agoCorrectly initialize A2DP Sink codecs if A2DP Source HW offload is enabled
Pavlin Radoslavov [Thu, 14 Jun 2018 23:27:54 +0000 (16:27 -0700)]
Correctly initialize A2DP Sink codecs if A2DP Source HW offload is enabled

This also fixes unit test failures if A2DP Source HW offload is enabled.

Bug: 110228602
Test: Failing unit tests now succeed
Change-Id: I36678738bfcfcce0f2e8a055f10c86cc6b3e682a

6 years agoMerge "Multi-A2DP: Fix timing and codec measurement in metrics" am: 5006f15bf0
Jack He [Thu, 14 Jun 2018 23:27:41 +0000 (16:27 -0700)]
Merge "Multi-A2DP: Fix timing and codec measurement in metrics" am: 5006f15bf0
am: 0d42faaf81

Change-Id: I308692737c575178f6463e7fe3fe65636ea5dbe3

6 years agoSMP_Encrypt refactor am: c3e7c878fe
Jakub Pawlowski [Thu, 14 Jun 2018 23:27:15 +0000 (16:27 -0700)]
SMP_Encrypt refactor am: c3e7c878fe
am: aa3f9c7786

Change-Id: I0172651bb0cabaf0bc07ae45564795a87bd4e7a2

6 years agoMerge "Multi-A2DP: Fix timing and codec measurement in metrics"
Jack He [Thu, 14 Jun 2018 23:19:20 +0000 (16:19 -0700)]
Merge "Multi-A2DP: Fix timing and codec measurement in metrics"
am: 5006f15bf0

Change-Id: Ie32387f1ba3b393fc11dc6c0729bc7983e595bd4

6 years agoSMP_Encrypt refactor
Jakub Pawlowski [Thu, 14 Jun 2018 23:17:04 +0000 (16:17 -0700)]
SMP_Encrypt refactor
am: c3e7c878fe

Change-Id: I759c0d685f498c7bf4831c4b2a43e61934c7bca1

6 years agoMerge "Multi-A2DP: Fix timing and codec measurement in metrics"
Treehugger Robot [Thu, 14 Jun 2018 23:10:13 +0000 (23:10 +0000)]
Merge "Multi-A2DP: Fix timing and codec measurement in metrics"

6 years agoMulti-A2DP: Fix timing and codec measurement in metrics
Jack He [Sat, 9 Jun 2018 03:13:23 +0000 (20:13 -0700)]
Multi-A2DP: Fix timing and codec measurement in metrics

* Copy BtifMediaStats and SchedulingStats when updating metrics
  to avoid race conditions
* Do not log audio_duration_ms if session_end_us <= session_start_us
* Clear cached A2DP metrics when LogBluetoothSessionEnd() is called
* Log codec information along-side A2DP metrics
* Log whether A2DP offload is enabled along-side A2DP metrics

Multi-A2DP:
* Log LogBluetoothSessionStart at btif_a2dp_source_start_session_delayed
* Log LogBluetoothSessionEnd at btif_a2dp_source_end_session_delayed

Unit Test:
* Wrote A2DPSessionTwoUpdatesSeparatedbyEndTest that will fail if A2DP
  metrics are not cleared when LogBluetoothSessionEnd is called

Bug: 109953464
Test: make, net_test_osi::BluetoothMetricsLoggerTest,
      net_test_osi::BluetoothA2DPSessionMetricsTest
Change-Id: I6a311dce8035ce2e3f39773c260ea9eaef73e45b

6 years agoAdd tests for AES_CMAC am: 4d64a6e457
Jakub Pawlowski [Thu, 14 Jun 2018 20:41:05 +0000 (13:41 -0700)]
Add tests for AES_CMAC am: 4d64a6e457
am: 994b476d63

Change-Id: Ic0fe76fc0a14f240e30cabd6a0ad63d100749383

6 years agoAdd tests for AES_CMAC
Jakub Pawlowski [Thu, 14 Jun 2018 20:30:55 +0000 (13:30 -0700)]
Add tests for AES_CMAC
am: 4d64a6e457

Change-Id: I75c85096950fad7b7f2f9236690030858f64d874

6 years agoSMP_Encrypt refactor
Jakub Pawlowski [Thu, 14 Jun 2018 16:03:47 +0000 (09:03 -0700)]
SMP_Encrypt refactor

* key must be 16bit, so no need to pass it's length, and check it's
  value
* p_out being null is a bad call that should crash to be catched, not an
  error we should handle
* hash computation always succeed, don't return any errors

Test: existing unit tests cover it, i.e. AesCmacTest
Change-Id: Ifba8902f3f1a7be3c54dd7a33d9ff1e52ffd237b

6 years agoAdd tests for AES_CMAC
Jakub Pawlowski [Thu, 14 Jun 2018 07:20:13 +0000 (00:20 -0700)]
Add tests for AES_CMAC

Test: added AesCmacTest
Change-Id: I66615e581ee64debc2c25ae03e18decd2f8c8fa8

6 years agoGATTC_Discover: pass parameters directly instead of through pointer am: 36b5cfd8a8
Jakub Pawlowski [Thu, 14 Jun 2018 00:15:02 +0000 (17:15 -0700)]
GATTC_Discover: pass parameters directly instead of through pointer am: 36b5cfd8a8
am: 80a62293e8

Change-Id: Ide24eca8eec6139a5fc883ea75ec246431dff4d3

6 years agoGATTC_Discover: pass parameters directly instead of through pointer
Jakub Pawlowski [Wed, 13 Jun 2018 23:48:41 +0000 (16:48 -0700)]
GATTC_Discover: pass parameters directly instead of through pointer
am: 36b5cfd8a8

Change-Id: Icd3f7a6de58956864abb15528ae982794af534ce

6 years agoGATTC_Discover: pass parameters directly instead of through pointer
Jakub Pawlowski [Fri, 8 Jun 2018 16:32:57 +0000 (09:32 -0700)]
GATTC_Discover: pass parameters directly instead of through pointer

Bug: 67057055
Test: manual
Change-Id: I7be853241595b336e2d4b67bc57170ee01ce6e72

6 years agoGATT database refactor am: 3ee08accd4
Jakub Pawlowski [Wed, 13 Jun 2018 17:28:46 +0000 (10:28 -0700)]
GATT database refactor am: 3ee08accd4
am: 72240c4597

Change-Id: I6ab5006b1be40e93462ca3e96eae4e89ea9ce539

6 years agoGATT database refactor
Jakub Pawlowski [Wed, 13 Jun 2018 17:24:30 +0000 (10:24 -0700)]
GATT database refactor
am: 3ee08accd4

Change-Id: Ie674bc6597457b33a0acc159c727e25f3c7dcd7a

6 years agoGATT database refactor
Jakub Pawlowski [Wed, 18 Apr 2018 14:31:30 +0000 (07:31 -0700)]
GATT database refactor

Move logic and data responsible for GATT Discovery into separate class.
Create clean representation of GATT database, and attributes for
storage.
Minor service discovery improvements:
* don't send requests to explore services with start handle equal to end handle.
* don't try to discover characteristic if only one handle is left at end
  of service - it uses two handles, one for definition, one for value
* if secondary service is defined before service that includes it, it
  should now be properly discovered.

Test: Added DatabaseBuilderTest, manual tests with LE HID devices, Daydream
      Controller and Clips camera.
Bug: 67057055
Change-Id: I511f4ee7c56c8fa65f012de0b6d1291321840d11

6 years agoAdd storage API to get number of bonded devices am: 6fd3d4dfff
Jacky Cheung [Wed, 13 Jun 2018 00:29:47 +0000 (17:29 -0700)]
Add storage API to get number of bonded devices am: 6fd3d4dfff
am: 0e7cb07048

Change-Id: Ia2bc588ad81f18ed7ee4f74c36832df7ef7c9269

6 years agoAdd storage API to get number of bonded devices
Jacky Cheung [Wed, 13 Jun 2018 00:11:27 +0000 (17:11 -0700)]
Add storage API to get number of bonded devices
am: 6fd3d4dfff

Change-Id: I854927fea8b83c6e28398487140d2d1b1fc948dd

6 years agoAdd storage API to get number of bonded devices
Jacky Cheung [Thu, 29 Jun 2017 22:27:35 +0000 (15:27 -0700)]
Add storage API to get number of bonded devices

Test: manual
Change-Id: Iaded8031bf706d84cff68f78dff8feb887a159a4