OSDN Git Service

android-x86/system-bt.git
6 years agoMerge "Fix stack not acking status to audio when A2DP start failed"
Ugo Yu [Tue, 10 Jul 2018 10:10:43 +0000 (03:10 -0700)]
Merge "Fix stack not acking status to audio when A2DP start failed"
am: c02707122e

Change-Id: I650b690029c133db6dcde8a29238e7cc360cdcbf

6 years agoMerge "Fix stack not acking status to audio when A2DP start failed"
Treehugger Robot [Tue, 10 Jul 2018 10:03:07 +0000 (10:03 +0000)]
Merge "Fix stack not acking status to audio when A2DP start failed"

6 years agoRegister for Service Changed notification after encryption
Jakub Pawlowski [Tue, 10 Jul 2018 09:26:30 +0000 (02:26 -0700)]
Register for Service Changed notification after encryption
am: dc46396273

Change-Id: I63fa3d67eb96f3e50396bff5d844a9e4b4336cc3

6 years agoGet rid of warning when connecting LE device
Jakub Pawlowski [Tue, 10 Jul 2018 08:55:30 +0000 (01:55 -0700)]
Get rid of warning when connecting LE device
am: 5e77625fbc

Change-Id: I293dc741e31950adeebf2f65c49f7449f74db17e

6 years agoRegister for Service Changed notification after encryption
Jakub Pawlowski [Wed, 4 Jul 2018 14:11:52 +0000 (07:11 -0700)]
Register for Service Changed notification after encryption

This fixes issue introduced in commit 645ee14ce2327fff61f54d208763eca1c143063e
Registration for Service Changed notifications was
disabled, because there was no good way back then to have
"opportunistic" app. Since opportunistic apps were introduced, and the
code in GATT_ConfigServiceChangeCCC is already marking connection as
opportunistic, reenable notification registration.

Test: manual verification, that Service Changed descriptor is set
Change-Id: Iefaec3914829fa4a4a60dc3c3790c3daa9f4f4d8

6 years agoGet rid of warning when connecting LE device
Jakub Pawlowski [Wed, 4 Jul 2018 16:26:05 +0000 (09:26 -0700)]
Get rid of warning when connecting LE device

We are sending LE fixed channel notification to classic callback. Stop
doing that. This triggers following warning in log output on every
LE connection:
W bt_smp  : smp_br_connect_callback is called on unexpected transport 2

Test: manual with phone, verify warning is gone when connecting over LE
Change-Id: I47597fa03744fb1bff03d287f790ea32fa033cc7

6 years agoFix stack not acking status to audio when A2DP start failed
Ugo Yu [Mon, 9 Jul 2018 05:49:44 +0000 (13:49 +0800)]
Fix stack not acking status to audio when A2DP start failed

Add a missing ack in A2DP start failed case when A2DP offload is
enabled.

Bug: 111207927
Test: Manual

Change-Id: I96a7ad322ea7ce6da5084a48fdd3dec980ce57b8

6 years agoDon't trigger AVDTP Suspend in response to AVDTP Suspend+Start from remote
Pavlin Radoslavov [Mon, 2 Jul 2018 21:18:08 +0000 (14:18 -0700)]
Don't trigger AVDTP Suspend in response to AVDTP Suspend+Start from remote
am: 7e425cef6d

Change-Id: Ibdb89a81251633762771e55c00b2f1f492b14094

6 years agoDon't trigger AVDTP Suspend in response to AVDTP Suspend+Start from remote
Pavlin Radoslavov [Fri, 29 Jun 2018 03:10:36 +0000 (20:10 -0700)]
Don't trigger AVDTP Suspend in response to AVDTP Suspend+Start from remote

If the remote device sent us AVDTP Suspend, and then AVDTP Start, don't
trigger AVDTP Suspend from the local device in response to the AVDTP Start.

Also:
 * Add a call btif_av_stream_start_offload() inside btif_a2dp_on_started()
   if we were started remotely.
 * Fix the order of calling btif_a2dp_on_started() and triggering
   an internal BTIF_AV_SUSPEND_STREAM_REQ_EVT event. Otherwise,
   BTA Suspend might be called before btif_av_stream_start_offload()

Bug: 110015851
Bug: 110186160
Test: Manual
Change-Id: I908d19f8caf5130b96a64153ff39bd4b52879713

6 years agoMerge "Fix double close in btif.cc's dump."
Josh Gao [Fri, 29 Jun 2018 19:02:11 +0000 (12:02 -0700)]
Merge "Fix double close in btif.cc's dump."
am: 84c04a03d1

Change-Id: I62a4c95c968ae3476052ae555efa0ad078cf32cf

6 years agoMerge "Fix double close in btif.cc's dump."
Treehugger Robot [Fri, 29 Jun 2018 18:55:56 +0000 (18:55 +0000)]
Merge "Fix double close in btif.cc's dump."

6 years agoAVRCP: Reject SetAddressedPlayer command only if remote set invalid player ID
Benson Li [Thu, 28 Jun 2018 19:49:16 +0000 (12:49 -0700)]
AVRCP: Reject SetAddressedPlayer command only if remote set invalid player ID
am: 97c8fb61ae

Change-Id: I71515bfc27707b0659846965148c66b9d535745b

6 years agoAVRCP: Reject SetAddressedPlayer command only if remote set invalid player ID
Benson Li [Mon, 25 Jun 2018 06:11:20 +0000 (14:11 +0800)]
AVRCP: Reject SetAddressedPlayer command only if remote set invalid player ID

Implement HandleSetAddressedPlayer() to check if remote set valid
player ID and properly respond to remote.

Bug: 110632860
Test: PTS Test AVRCP/TG/MPS/BI-01-C AVRCP/TG/MPS/BV-02-C
Change-Id: Ice13e7ea97cdac369c4d021171a24bf9d96c9da8

6 years agoMerge "Move sepolicy files to system/sepolicy"
Myles Watson [Thu, 28 Jun 2018 02:21:48 +0000 (19:21 -0700)]
Merge "Move sepolicy files to system/sepolicy"
am: 70328c44e4

Change-Id: Ie853b1c2c21848fa6da57c3db8b0dd59229725a5

6 years agoMerge "Move sepolicy files to system/sepolicy"
Treehugger Robot [Thu, 28 Jun 2018 00:31:05 +0000 (00:31 +0000)]
Merge "Move sepolicy files to system/sepolicy"

6 years agoMove sepolicy files to system/sepolicy
Myles Watson [Tue, 26 Jun 2018 00:09:27 +0000 (17:09 -0700)]
Move sepolicy files to system/sepolicy

Test: Toggle Bluetooth, ls -alZ /vendor/bin/hw/*blue*
Change-Id: Ibf72f8bacc2f4975d06f4892e3b33ef6fb08aab7
Merged-In: Ibf72f8bacc2f4975d06f4892e3b33ef6fb08aab7

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 agoFix double close in btif.cc's dump.
Josh Gao [Tue, 26 Jun 2018 21:01:06 +0000 (14:01 -0700)]
Fix double close in btif.cc's dump.

dump closes a file descriptor that is still owned by a
ParcelFileDescriptor which leads eventually to a double close.

Test: treehugger
Change-Id: Id351b5429cb17b48e37313850a363d739d78c4a1

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...
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"
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 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"
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 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"
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
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 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 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
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
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
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 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
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"
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 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."
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 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
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"
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: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
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"
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
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
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
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
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

6 years agoFix the reconnect issue in hfp client
Jinguang Dong [Tue, 12 Jun 2018 11:56:24 +0000 (19:56 +0800)]
Fix the reconnect issue in hfp client

The HFP client would not reconnect any more on collision scenario
as upper layer calls the connect API per 30s. which related with
CL of 5eccd90936d606e0070872b247fd3462e9c9c19b

Bug: 74518379

Test: Manual test for multiple incoming/outgoing HF connections
      between Android Wear and Handset

Signed-off-by: Kai Huang <huangkai1@huawei.com>
Change-Id: I445f3633165d8ec12f91bc5fe5a8217505318cff

6 years agoMerge "Hearing Aid - codec switching"
Jakub Pawlowski [Mon, 11 Jun 2018 21:19:04 +0000 (14:19 -0700)]
Merge "Hearing Aid - codec switching"
am: 40bd4c78d8

Change-Id: I48a13888b78ca76813c4ef1d68779456fe3ef278

6 years agoMerge "Hearing Aid - codec switching"
Treehugger Robot [Mon, 11 Jun 2018 20:06:20 +0000 (20:06 +0000)]
Merge "Hearing Aid - codec switching"

6 years agoHearing Aid - codec switching
Jakub Pawlowski [Tue, 10 Apr 2018 07:16:53 +0000 (00:16 -0700)]
Hearing Aid - codec switching

StartSendingAudio internally sets the codec to the HearingAidAudioSource.
OnDeviceAvailable callback triggers audio framework to  grab codec
configuration from HearingAidAudioSource. Those calls must be made in proper
order, otherwise audio framework will grab bad codec configuration.

This patch also remove default codec configuration, and crash if codec
configuration is not done correctly.

Test: use hearing aid supporting 24kHz codec
Change-Id: I9419d58fa8728fc8e0f0c2d2ed8d8d741309a9a3

6 years agoMerge "Add documentation for enabling PTS mode"
Hansong Zhang [Mon, 11 Jun 2018 09:23:08 +0000 (02:23 -0700)]
Merge "Add documentation for enabling PTS mode"
am: ee8143b563

Change-Id: I47c1103f56fd0544ad3848d2c6fc38091045d7f5

6 years agoMerge "Use ParcelFileDescriptor implementation in libbinder"
Ryo Hashimoto [Mon, 11 Jun 2018 08:21:49 +0000 (01:21 -0700)]
Merge "Use ParcelFileDescriptor implementation in libbinder"
am: 07dc1fb8ad

Change-Id: I9462f62bc97248674ba1cd7bb50adaddb447ff4c

6 years agoMerge "Add documentation for enabling PTS mode"
Treehugger Robot [Mon, 11 Jun 2018 07:42:18 +0000 (07:42 +0000)]
Merge "Add documentation for enabling PTS mode"

6 years agoMerge "Use ParcelFileDescriptor implementation in libbinder"
Treehugger Robot [Mon, 11 Jun 2018 07:27:41 +0000 (07:27 +0000)]
Merge "Use ParcelFileDescriptor implementation in libbinder"

6 years agoMerge pi-dev-plus-aosp-without-vendor into stage-aosp-master
Xin Li [Fri, 8 Jun 2018 18:09:17 +0000 (11:09 -0700)]
Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master

Bug: 79597307
Change-Id: Iaccda26437bbee0e9fdbb8ce9af9df8d30946fc2

6 years ago[automerger skipped] Merge "Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was...
Pavlin Radoslavov [Fri, 8 Jun 2018 06:05:32 +0000 (23:05 -0700)]
[automerger skipped] Merge "Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was no streaming" am: e0d333ce68
am: 2e71a11d60  -s ours

Change-Id: I1f16be65c429afffa645e730a354150957e062f7

6 years agoMerge "Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was no streaming"
Pavlin Radoslavov [Fri, 8 Jun 2018 06:00:16 +0000 (23:00 -0700)]
Merge "Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was no streaming"
am: e0d333ce68

Change-Id: I15dfba2421d7f47f5cb2a0b100d6f3bd72f741ef

6 years agoMerge "Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was no streaming"
Treehugger Robot [Fri, 8 Jun 2018 05:39:40 +0000 (05:39 +0000)]
Merge "Send ACK for A2DP_CTRL_CMD_SUSPEND even if audio was no streaming"

6 years agoRun the AVRCP Service interface functions on the BTA thread am: e2301ee0bf
Ajay Panicker [Fri, 8 Jun 2018 05:04:51 +0000 (22:04 -0700)]
Run the AVRCP Service interface functions on the BTA thread am: e2301ee0bf
am: 23cb1b69ba

Change-Id: Ie4e2639c46756caef6012b032059b91ddbbc6254

6 years ago[automerger skipped] AVRCP: Narrow the scope of the lock in Init and Cleanup am:...
Ajay Panicker [Fri, 8 Jun 2018 05:04:40 +0000 (22:04 -0700)]
[automerger skipped] AVRCP: Narrow the scope of the lock in Init and Cleanup am: 505a45bb88
am: 04670fe8b1  -s ours

Change-Id: I1253f967d09b24638384caed9b8af7b3bed70336

6 years ago[automerger skipped] AVRCP: Cancel all pending messages and prevent future messages...
Ajay Panicker [Fri, 8 Jun 2018 05:04:30 +0000 (22:04 -0700)]
[automerger skipped] AVRCP: Cancel all pending messages and prevent future messages after cleanup am: b5e41e6b81
am: aacf6bea51  -s ours

Change-Id: Ia1b936c68e1dcf6b247f8a5df3866ab762bf9ff2

6 years agoRun the AVRCP Service interface functions on the BTA thread
Ajay Panicker [Thu, 7 Jun 2018 23:39:40 +0000 (16:39 -0700)]
Run the AVRCP Service interface functions on the BTA thread
am: e2301ee0bf

Change-Id: Ic20603680325d1ac8a04e0c19d0391bd074b047e

6 years agoAVRCP: Narrow the scope of the lock in Init and Cleanup
Ajay Panicker [Thu, 7 Jun 2018 23:39:33 +0000 (16:39 -0700)]
AVRCP: Narrow the scope of the lock in Init and Cleanup
am: 505a45bb88

Change-Id: Ie80fddbbc5b8a67d9bef26b9e957f971d7a41c76

6 years agoAVRCP: Cancel all pending messages and prevent future messages after cleanup
Ajay Panicker [Thu, 7 Jun 2018 23:39:25 +0000 (16:39 -0700)]
AVRCP: Cancel all pending messages and prevent future messages after cleanup
am: b5e41e6b81

Change-Id: I73f572c346e78d47796db12c405d523683693b89

6 years agoRun the AVRCP Service interface functions on the BTA thread
Ajay Panicker [Thu, 31 May 2018 00:50:39 +0000 (17:50 -0700)]
Run the AVRCP Service interface functions on the BTA thread

Bug: 80416347
Test: Turn off Bluetooth while connected to a device we initiated the
connection to.

Change-Id: I8f10409c495213ef3117aedf66919de7c0b3d164
(cherry picked from commit 95e1a9e65f2d61523753f19d8855144672413506)