OSDN Git Service

android-x86/system-bt.git
6 years agoReduce A2DP/AVDTP related dumpsys output
Pavlin Radoslavov [Wed, 23 May 2018 20:09:58 +0000 (13:09 -0700)]
Reduce A2DP/AVDTP related dumpsys output
am: 8757bc7ab0

Change-Id: I2ef1439c45aa1d7a0504cc3f5529a9e596e3e6c3

6 years agoExplicitly stop the stream when the A2DP session ends
Pavlin Radoslavov [Wed, 23 May 2018 18:10:02 +0000 (11:10 -0700)]
Explicitly stop the stream when the A2DP session ends
am: 6d493bdc7b

Change-Id: I63ccc644c7f34b62f2d95000e74b9f0a8ea6c465

6 years agoReduce A2DP/AVDTP related dumpsys output
Pavlin Radoslavov [Wed, 23 May 2018 14:40:09 +0000 (07:40 -0700)]
Reduce A2DP/AVDTP related dumpsys output

* Don't print control blocks that are not in use
* Print some sections only if the runtime trace level is DEBUG(=5) or above
* Renamed section "A2DP Codecs and Peers State:" to
  "A2DP Peers State:"

Bug: 80179152
Test: Manual
Change-Id: I9fcd7387ed469094132d5be989d4976ce103cfc8

6 years agoExplicitly stop the stream when the A2DP session ends
Pavlin Radoslavov [Wed, 23 May 2018 00:56:22 +0000 (17:56 -0700)]
Explicitly stop the stream when the A2DP session ends

Note: this needs to be done only for the A2DP HW offload scenario.
For the software data path, this will be done by the Audio HAL.

Bug: 80117050
Test: Manual
Change-Id: I4397d219d82d779706e946f0c7f833c1e93e91f4

6 years agoMerge "Update connection parameters just once before GATT discovery"
Jakub Pawlowski [Tue, 22 May 2018 23:19:32 +0000 (16:19 -0700)]
Merge "Update connection parameters just once before GATT discovery"
am: 55d4938b30

Change-Id: I85a8108d5171399a2dd94e7a880dc95b02d423a4

6 years agoMerge "Update connection parameters just once before GATT discovery"
Treehugger Robot [Tue, 22 May 2018 23:01:26 +0000 (23:01 +0000)]
Merge "Update connection parameters just once before GATT discovery"

6 years agoMerge "Support AVRCP Controller on JNI thread"
Joseph Pirozzo [Tue, 22 May 2018 22:30:25 +0000 (15:30 -0700)]
Merge "Support AVRCP Controller on JNI thread"
am: f323814822

Change-Id: I42d11c0145e32ec3f60829735040f5c30728b5b4

6 years agoMerge "Support AVRCP Controller on JNI thread"
Joseph Pirozzo [Tue, 22 May 2018 22:20:02 +0000 (22:20 +0000)]
Merge "Support AVRCP Controller on JNI thread"

6 years agoUpdate connection parameters just once before GATT discovery
Jakub Pawlowski [Tue, 22 May 2018 21:15:31 +0000 (14:15 -0700)]
Update connection parameters just once before GATT discovery

Call to L2CA_EnableUpdateBleConnParams is already made just before
call to bta_gattc_set_discover_st

Test: compilation
Change-Id: I30939065b5486e20c2f6f456dde96266e9395690

6 years agoMerge "HFP: Set audio handle for active device during incoming call"
Jack He [Tue, 22 May 2018 18:31:23 +0000 (11:31 -0700)]
Merge "HFP: Set audio handle for active device during incoming call"
am: 9bef78a5b6

Change-Id: I5ee74df6c21914f1b03e045d60a1fa40e3cc1096

6 years agoMerge "HFP: Set audio handle for active device during incoming call"
Treehugger Robot [Tue, 22 May 2018 18:17:38 +0000 (18:17 +0000)]
Merge "HFP: Set audio handle for active device during incoming call"

6 years agoMerge "Use the effective peer MTU when preparing the codec configuration"
Pavlin Radoslavov [Tue, 22 May 2018 17:40:06 +0000 (10:40 -0700)]
Merge "Use the effective peer MTU when preparing the codec configuration"
am: 35b08f5708

Change-Id: Id2a86ff485aa61c60bd61ea55c296164983fe159

6 years agoMerge "Use the effective peer MTU when preparing the codec configuration"
Treehugger Robot [Tue, 22 May 2018 17:32:18 +0000 (17:32 +0000)]
Merge "Use the effective peer MTU when preparing the codec configuration"

6 years agoMerge "Don't mix internal AVDTP state when connecting to two devices"
Pavlin Radoslavov [Tue, 22 May 2018 17:30:46 +0000 (10:30 -0700)]
Merge "Don't mix internal AVDTP state when connecting to two devices"
am: d0eff6ef6c

Change-Id: I2d538de9b73bdcb12800cc30eb38c848f384dc83

6 years agoMerge "Don't mix internal AVDTP state when connecting to two devices"
Treehugger Robot [Tue, 22 May 2018 17:25:31 +0000 (17:25 +0000)]
Merge "Don't mix internal AVDTP state when connecting to two devices"

6 years agoMerge "gatt_api: Avoid possible NULL dereference"
Greg Kaiser [Tue, 22 May 2018 16:38:13 +0000 (09:38 -0700)]
Merge "gatt_api: Avoid possible NULL dereference"
am: bea526992d

Change-Id: Ic37eb3f50d9458b162e12a38a9d9164119f71c69

6 years agoMerge "gatt_api: Avoid possible NULL dereference"
Treehugger Robot [Tue, 22 May 2018 16:28:29 +0000 (16:28 +0000)]
Merge "gatt_api: Avoid possible NULL dereference"

6 years agoUse the effective peer MTU when preparing the codec configuration
Pavlin Radoslavov [Tue, 22 May 2018 09:03:20 +0000 (02:03 -0700)]
Use the effective peer MTU when preparing the codec configuration

Added new method A2dpCodecConfig::getEffectiveMtu() and use it
to obtain the effective MTU per peer per codec.
The effective peer MTU could be smaller than the one reported
by the peer (e.g., for interoperability reasons).

Bug: 77913350
Test: Manual
Change-Id: Idd5230681ac5856fd18dd33ac48723c6ea609e16

6 years agoGATT: Fix usage of 16 and 32 bit UUID's in Discover services by UUID
Hemant Gupta [Tue, 22 May 2018 15:52:15 +0000 (08:52 -0700)]
GATT: Fix usage of 16 and 32 bit UUID's in Discover services by UUID
am: 37fdb267db

Change-Id: I7f2ac1a2f2af399cb61d878f95c99c3bf5684590

6 years agogatt_api: Avoid possible NULL dereference
Greg Kaiser [Tue, 22 May 2018 13:59:48 +0000 (06:59 -0700)]
gatt_api: Avoid possible NULL dereference

We move a logging statement which dereferences a NULL pointer
until after the NULL check, and expand the error message for
the NULL check to include the function name.

Test: TreeHugger
Change-Id: Ib5134b0d6b9ec5da95ee62da9412b977925000ee

6 years agoDon't mix internal AVDTP state when connecting to two devices
Pavlin Radoslavov [Fri, 18 May 2018 03:38:44 +0000 (20:38 -0700)]
Don't mix internal AVDTP state when connecting to two devices

There is a race condition when connecting to two devices, and
the connection to one of the devices is not powered on.

Because of the race condition, the wrong tBTA_AV_LCB entry inside
bta_av_sig_chg() might be allocated for the connection to
the device that is powered on. As a result of that, when
the connection attempt to the powered off device times out,
we will use the wrong bta_handle to close the existing AVDTP connection to
the device that is connected.

Also:
 - Add a new function BTA_AvObtainPeerChannelIndex() to select the
   appropriate AvdtpCcb entry if there an outgoing connection request
   while an incoming connection is received.
 - Added/updated log messages to help debugging similar issues in the future
 - Removed unnecessary SetActivePeer() call inside the BtifAv state
   machine for A2DP Source to avoid additional internal/transient glitches

Test: Manual
Bug: 79697137
Change-Id: Ie55e3dcf6c6a15637ce3631f2828548a2423d881

6 years agoGATT: Fix usage of 16 and 32 bit UUID's in Discover services by UUID
Hemant Gupta [Tue, 22 May 2018 03:55:50 +0000 (09:25 +0530)]
GATT: Fix usage of 16 and 32 bit UUID's in Discover services by UUID

Fix improper usage of 16 and 32 bit UUID's in Disocever services by UUID
Fixes PTS test cases GATT/CL/GAD/BV-08-C and GATT/CL/GAR/BV-03-C.

Test: PTS test cases GATT/CL/GAD/BV-08-C and GATT/CL/GAR/BV-03-C passes

Bug: 80095184
Change-Id: Ia0a26bd20ee68c5c7db0bc00036634f6719f25e9

6 years agoSimplify bta_gattc_sdp_callback
Jakub Pawlowski [Tue, 22 May 2018 00:24:09 +0000 (17:24 -0700)]
Simplify bta_gattc_sdp_callback
am: cabb39c432

Change-Id: I22016fd73cb6b01bb56aa82c712c8c1dbdcdc09f

6 years agoHFP: Set audio handle for active device during incoming call
Jack He [Tue, 22 May 2018 00:09:29 +0000 (17:09 -0700)]
HFP: Set audio handle for active device during incoming call

* Set audio handle for active device during incoming call
* Change debug level logging to warning level when SCO is not allowed to
  open or when RING command is not allowed to be sent

Bug: 77949569
Test: connect with HFP devices and receive incoming call
Change-Id: Ibc2caf740f94817ae725786e35e8592390167ce2

6 years agoSimplify bta_gattc_sdp_callback
Jakub Pawlowski [Fri, 18 May 2018 22:57:01 +0000 (15:57 -0700)]
Simplify bta_gattc_sdp_callback

* join multiple if statements to improve readability
* malloc and free memory just once for tBTA_GATTC_CB_DATA

Test: compilation
Change-Id: I907645ed04ed4b628a3b24785b1ccd16b69d83bb

6 years agoMerge "HFP: Return SDP status to HFP layer"
Jack He [Mon, 21 May 2018 21:54:56 +0000 (14:54 -0700)]
Merge "HFP: Return SDP status to HFP layer"
am: 0522a227b3

Change-Id: I50e4a44b66ef727bd8243fc2182a2ddb36bbfbb1

6 years agoUnify logging in gatt_api.cc
Jakub Pawlowski [Mon, 21 May 2018 21:45:31 +0000 (14:45 -0700)]
Unify logging in gatt_api.cc
am: 431cf613c4

Change-Id: Ia4fa67a5c03c9c8b478550ff89534005d13a9165

6 years agoMerge "HFP: Return SDP status to HFP layer"
Treehugger Robot [Mon, 21 May 2018 21:20:07 +0000 (21:20 +0000)]
Merge "HFP: Return SDP status to HFP layer"

6 years agoUnify logging in gatt_api.cc
Jakub Pawlowski [Mon, 21 May 2018 16:38:48 +0000 (09:38 -0700)]
Unify logging in gatt_api.cc

- always log conn_id as hex value
- use "=" instead of ":" as delimiter between name and value
- get rid of StringPrintf

Test: compilation
Change-Id: Ia35b79c3732b19661e4655d5cf0923b7e701985f

6 years agoHFP: Return SDP status to HFP layer
Jack He [Sun, 20 May 2018 03:05:02 +0000 (20:05 -0700)]
HFP: Return SDP status to HFP layer

* Fix an error introduced in change Ic0b4498dd623d0ea31b4513d6b7861cae390bc72
  so that SDP status is sent up to the HFP BTA layer
* With SDP status correctly passed up, HFP BTA layer can correctly
  determine when to continue SDP search for HSP
* When open connection to HFP or HSP devices, use a control block's
  registered services instead of passing in opening services every time
  from BTIF layer
* Do not use a control block that are in CONNECTING or DISCONNECTING
  state
* Add a crash in btif_hf.cc:connect_int() to gurantee that no control
  block is in connecting or disconnecting state when connect_int is
  called as it should be guranteed by the btif queue configuration

Bug: 74234576
Test: connect to headset, make calls and hangup
Change-Id: I5e2bce8c2f0f51bd3fd3e85e82827c5fb5e92887

6 years agoAVRCP: Route CType NOT_IMPLEMENTED as a response
Myles Watson [Fri, 18 May 2018 21:12:06 +0000 (14:12 -0700)]
AVRCP: Route CType NOT_IMPLEMENTED as a response
am: f74cecf93e

Change-Id: I1e9c0c55cc7f510f04c6a6add316248c6ae6ca52

6 years agoAVRCP: Route CType NOT_IMPLEMENTED as a response
Myles Watson [Fri, 18 May 2018 18:31:33 +0000 (11:31 -0700)]
AVRCP: Route CType NOT_IMPLEMENTED as a response

Bug: 79698590
Test: net_test_avrcp, Connect to the Anker MP140
Change-Id: Ie88dcea949ecb33bc3d76d86b07ab0396a21500d

6 years agoAdd General Reject for invalid PDU ID
tedwang [Thu, 17 May 2018 18:38:35 +0000 (11:38 -0700)]
Add General Reject for invalid PDU ID
am: 7570175750

Change-Id: I47d646e48c002a241806f49d058f1674e8b1e2a6

6 years agoAdd General Reject for invalid PDU ID
tedwang [Tue, 15 May 2018 14:21:39 +0000 (22:21 +0800)]
Add General Reject for invalid PDU ID

Add Avrcp Browse General Reject packet
Respond general reject when undefined AVRCP Browsing PDU ID sent from
remote.

Bug: 79376704
Test: run host native test net_test_btpackets
Change-Id: I8a44d8e3f0cc5fac89e23217726c76ede4aff916
(cherry picked from commit 3fbf8b4fff8b52b781fa611e0b62c97bca28d76f)

6 years agoDon't update the MTU across multiple A2DP connections that are open
Pavlin Radoslavov [Wed, 16 May 2018 20:48:39 +0000 (13:48 -0700)]
Don't update the MTU across multiple A2DP connections that are open
am: 1200c75df8

Change-Id: Ia64122410907b4ab25b6c1efd29b9459d9a6b45f

6 years agoDon't update the MTU across multiple A2DP connections that are open
Pavlin Radoslavov [Wed, 16 May 2018 02:21:03 +0000 (19:21 -0700)]
Don't update the MTU across multiple A2DP connections that are open

Remove function bta_av_chk_mtu() that updates the MTU to the smallest
value across all open A2DP connections, because that function is not needed.
Such MTU update is problematic for Multi-A2DP, because some codecs cannot
be initialized/used if the MTU is too small. E.g., for LDAC the
MTU value used for the codec initialization must be at least 679.

Bug: 79675742
Test: Manual - (1)Connect Bose QC35; (2)Connect Sony SRS-XB2; (3)Play music
Change-Id: I8048a1bf6df6d4d6291bf3570a95b5182af15b6a

6 years agoMerge "Respond reject with INVALID_PARAMETER when register for invalid event ID"
tedwang [Wed, 16 May 2018 00:24:45 +0000 (17:24 -0700)]
Merge "Respond reject with INVALID_PARAMETER when register for invalid event ID"
am: 4298549380

Change-Id: I4e02d05557fc9d3cb9d052c633f0e496f849334c

6 years agoMerge "Respond reject with INVALID_PARAMETER when register for invalid event ID"
Treehugger Robot [Wed, 16 May 2018 00:12:44 +0000 (00:12 +0000)]
Merge "Respond reject with INVALID_PARAMETER when register for invalid event ID"

6 years agoMerge "Print extra error code if LDAC encoder fails to initialize"
Pavlin Radoslavov [Wed, 16 May 2018 00:05:35 +0000 (17:05 -0700)]
Merge "Print extra error code if LDAC encoder fails to initialize"
am: 3a537a3e07

Change-Id: I6dd95962d924044315b90a52ada37a8fc3c5b21a

6 years agoMerge "Print extra error code if LDAC encoder fails to initialize"
Treehugger Robot [Tue, 15 May 2018 23:21:27 +0000 (23:21 +0000)]
Merge "Print extra error code if LDAC encoder fails to initialize"

6 years agoRespond reject with INVALID_PARAMETER when register for invalid event ID
tedwang [Tue, 15 May 2018 07:25:11 +0000 (15:25 +0800)]
Respond reject with INVALID_PARAMETER when register for invalid event ID

It should respond reject with INVALID_PARAMETER instead of
INVALID_COMMAND while remote registering for an invalid event ID

Bug: 79377562
Test: PTS AVRCP/TG/NFY/BI-01-C
Change-Id: Ic006cb2f6584216f9457af5576dd2d39adaa3cf5
(cherry picked from commit d51c1dc6777eeb4d414c67e38999af436aaf71a8)

6 years agoAVRCP: Respond UID Changed for invalid Get Item Attributes command
Hansong Zhang [Tue, 15 May 2018 22:29:52 +0000 (15:29 -0700)]
AVRCP: Respond UID Changed for invalid Get Item Attributes command
am: 335d6e62b0

Change-Id: I90881349400f9d62723119fda172255bae1801b9

6 years agoAdd respond Reject with Invalid parameter for Unknown Capability ID
tedwang [Tue, 15 May 2018 22:29:28 +0000 (15:29 -0700)]
Add respond Reject with Invalid parameter for Unknown Capability ID
am: bf514e3954

Change-Id: I03cf9138cf3d7049cef4375a450d05dba36d5215

6 years agoAVRCP: Respond UID Changed for invalid Get Item Attributes command
Hansong Zhang [Mon, 14 May 2018 18:29:20 +0000 (11:29 -0700)]
AVRCP: Respond UID Changed for invalid Get Item Attributes command

When we receive GetItenAttributes command with an invalid UidCounter
other than 0x0000, we should reply UID Changed (0x05)

Bug: 79270308
Test: PTS AVRCP/TG/MCN/CB/BI-05-C; unit test
Change-Id: I819991d083944de5a08b0cd4fd0fb33c63f0142a

6 years agoMerge "AVRCP: Verify SetBrowsedPlayer player ID"
Hansong Zhang [Tue, 15 May 2018 20:29:28 +0000 (13:29 -0700)]
Merge "AVRCP: Verify SetBrowsedPlayer player ID"
am: 3103d311f4

Change-Id: I1bb359ff06ed6414ccc0c6440a2b9000caba871b

6 years agoAdd respond Reject with Invalid parameter for Unknown Capability ID
tedwang [Wed, 9 May 2018 06:28:04 +0000 (14:28 +0800)]
Add respond Reject with Invalid parameter for Unknown Capability ID

Add handle Get Capabilities with Unknown Capability ID and unit test
for this.

Bug: 79269978
Test: Run host native test net_test_avrcp
Change-Id: I2cb606bcb6462190354bb471577d9383e43649c1
(cherry picked from commit 5e872794641b89b63176befdb04865d5acf14aa3)

6 years agoMerge "AVRCP: Verify SetBrowsedPlayer player ID"
Treehugger Robot [Tue, 15 May 2018 20:13:30 +0000 (20:13 +0000)]
Merge "AVRCP: Verify SetBrowsedPlayer player ID"

6 years agoAVRCP: Verify SetBrowsedPlayer player ID
Hansong Zhang [Mon, 14 May 2018 23:48:58 +0000 (16:48 -0700)]
AVRCP: Verify SetBrowsedPlayer player ID

IUT should reject the invalid SetBrowsedPlayer command sent from PTS.

Bug: 79377126
Test: PTS AVRCP/TG/MPS/BI-02-C
Change-Id: I2afde442e3b3563f4a1a37e2914c9b16fe07e8fc

6 years agoPrint extra error code if LDAC encoder fails to initialize
Pavlin Radoslavov [Tue, 15 May 2018 10:19:41 +0000 (03:19 -0700)]
Print extra error code if LDAC encoder fails to initialize

Also, add a missing CHECK() assert that the LDAC handle is valid.

Bug: 79675742
Test: Code compilation
Change-Id: I4bd51ed978eadc2aecc27d199e6f01bb31c9a631

6 years agoSupport AVRCP Controller on JNI thread
Joseph Pirozzo [Tue, 8 May 2018 03:44:23 +0000 (20:44 -0700)]
Support AVRCP Controller on JNI thread

Recent changes to threading of the BTA layer require that all JNI
callbacks are performed on the JNI thread.  This change updates the APIs
to ensure that the data passed is thread safe.

Bug: 79145011
Test: Browse and Play music via AVRCP Controller.
Change-Id: I191658ea90c96bcf372e772119db6c31c9010230
(cherry picked from commit 4be70639dd863b8e8949f4db5aa2a332c1510412)

6 years agoMerge "Removed alarm callback execution statistics"
Jakub Pawlowski [Tue, 15 May 2018 02:12:37 +0000 (19:12 -0700)]
Merge "Removed alarm callback execution statistics"
am: 2190a20ef6

Change-Id: I12606fc5282b3c1c76d0942240f87f7a2eeec96f

6 years agoMerge "Removed alarm callback execution statistics"
Jakub Pawlowski [Tue, 15 May 2018 02:00:07 +0000 (02:00 +0000)]
Merge "Removed alarm callback execution statistics"

6 years agoMerge "Mask "LE Enhanced Connection Complete" when BLE_PRIVACY_SPT=FALSE"
Jakub Pawlowski [Mon, 14 May 2018 23:41:17 +0000 (16:41 -0700)]
Merge "Mask "LE Enhanced Connection Complete" when BLE_PRIVACY_SPT=FALSE"
am: ff38a2925a

Change-Id: I59cc169f1bfd172a1c2acb358f3b60ad389db562

6 years agoMerge "Mask "LE Enhanced Connection Complete" when BLE_PRIVACY_SPT=FALSE"
Treehugger Robot [Mon, 14 May 2018 23:28:45 +0000 (23:28 +0000)]
Merge "Mask "LE Enhanced Connection Complete" when BLE_PRIVACY_SPT=FALSE"

6 years agoMask "LE Enhanced Connection Complete" when BLE_PRIVACY_SPT=FALSE
Jakub Pawlowski [Thu, 19 Apr 2018 09:32:40 +0000 (02:32 -0700)]
Mask "LE Enhanced Connection Complete" when BLE_PRIVACY_SPT=FALSE

The code which handles this event is protected by an #ifdef. This was
causing connections to be established, but never detected by host.

Bug: 78264903
Test: establish connection to LE device with privacy disabled
Change-Id: Iea35016108bcbda64427250cc06258c422c1fdce

6 years agoRemoved alarm callback execution statistics
Pavlin Radoslavov [Mon, 8 Jan 2018 19:37:05 +0000 (11:37 -0800)]
Removed alarm callback execution statistics

Updating the alarm state after the callback returns can be problematic
in case the callback itself deleted the alarm.

Bug: 67110137
Test: Manual
Change-Id: Id4de06eebedb792cadd63d09efb68672e9bddc69

6 years agoMerge "Use identity addr in BLE scan filter"
Jakub Pawlowski [Mon, 14 May 2018 21:03:42 +0000 (14:03 -0700)]
Merge "Use identity addr in BLE scan filter"
am: e8a0bfd2ba

Change-Id: Iad5b0b9d3da84e77941f369837d0cd8e71f32e4a

6 years agoMerge "Use identity addr in BLE scan filter"
Jakub Pawlowski [Mon, 14 May 2018 20:47:52 +0000 (20:47 +0000)]
Merge "Use identity addr in BLE scan filter"

6 years agoMerge "Use weak pointers for device.cc callbacks to prevent use after delete"
Ajay Panicker [Mon, 14 May 2018 18:37:17 +0000 (11:37 -0700)]
Merge "Use weak pointers for device.cc callbacks to prevent use after delete"
am: 1819a3f240

Change-Id: I0115c55090ab3a725a6c99cc9c9b0e235cc14ca2

6 years agoMerge "Use weak pointers for device.cc callbacks to prevent use after delete"
Ajay Panicker [Mon, 14 May 2018 18:26:16 +0000 (18:26 +0000)]
Merge "Use weak pointers for device.cc callbacks to prevent use after delete"

6 years agoUse identity addr in BLE scan filter
Claire Treyz [Fri, 11 May 2018 15:13:28 +0000 (08:13 -0700)]
Use identity addr in BLE scan filter

For BT controllers with the ability to filter scans and resolve RPAs on
controller, when trying to filter for a Public ID type address the
filter must use the static identity address of the peer device instead
of the random pseudo address.

Bug: 78888800
Test: manually tested filtered scanning for BLE peer with RPA with a
device with both offloaded RPA resolution & controller filtering
supported. Tested on a device with no controller filtering, which has
no changes, as expected.

Change-Id: I1d92e219bdbc9ba2399eae637a1f4623d695a3f8

6 years agoMerge "HFP: Workaround for car kits that do not send AT+BAC command"
Jack He [Fri, 11 May 2018 22:07:00 +0000 (15:07 -0700)]
Merge "HFP: Workaround for car kits that do not send AT+BAC command"
am: 7b958f6ea7

Change-Id: Ibb8634a3c9b01911825bb7a07a29fb02e95bf5ed

6 years agoMerge "HFP: Workaround for car kits that do not send AT+BAC command"
Treehugger Robot [Fri, 11 May 2018 21:53:02 +0000 (21:53 +0000)]
Merge "HFP: Workaround for car kits that do not send AT+BAC command"

6 years agoMerge "Explicitly restart audio processing when switching active device"
Pavlin Radoslavov [Fri, 11 May 2018 21:14:42 +0000 (14:14 -0700)]
Merge "Explicitly restart audio processing when switching active device"
am: 2ffc9901cb

Change-Id: I41623252ea3f20c8afae1cf34612a3fb0ac32e2b

6 years agoMerge "Explicitly restart audio processing when switching active device"
Treehugger Robot [Fri, 11 May 2018 21:06:43 +0000 (21:06 +0000)]
Merge "Explicitly restart audio processing when switching active device"

6 years agoExplicitly restart audio processing when switching active device
Pavlin Radoslavov [Thu, 10 May 2018 16:52:58 +0000 (09:52 -0700)]
Explicitly restart audio processing when switching active device

* Add internal APIs to restart A2DP session and use them
  when switching the A2DP active device:
  btif_a2dp_source_restart_session() and btif_a2dp_sink_restart_session() .
* Removed internal A2DP Source APIs that shouldn't be APIs
* Call immediately btif_a2dp_on_stopped() when processing
  BTIF_AV_STOP_STREAM_REQ_EVT event to stop sooner the audio
  datapath processing and report back to the Audio HAL call.
  This eliminates the need for waiting for the BTA_AV_STOP_EVT
  upcall event from the remote device.
* Added extra log information when processing events in the BtifAv
  state machine.

Bug: 78360113
Test: Manual: streaming A2DP, change active device, change codec setup.
Change-Id: Icb356587af9cfaee7aea9f3f9bc95a0fe000fc52

6 years agoHFP: Workaround for car kits that do not send AT+BAC command
Jack He [Tue, 1 May 2018 06:59:40 +0000 (23:59 -0700)]
HFP: Workaround for car kits that do not send AT+BAC command

* Some misbehaving HF devices (e.g. some Hyundai car kits) indicate
  their support on Wide Band Speech and Codec Negotiation, but do not
  send the required AT+BAC command during Service Level Connection
  setup. However, such car kits still expect Fluoride to do codec
  negotiation during SCO setup.
* This CL adds a workaround so that when HF indicates support for WBS
  and codec negotiation, Fluoride will attempt codec negotiation even
  though AT+BAC is never received.
* Store the SDP feature locally. If WBS is supported and no AT+BAC is
  received, use the SDP features to set the suported codec.

Bug: 77883405
Test: make, connect SCO to and from Hyundai car kits
Change-Id: I2be6007022183cac5b9006f37089a587b4a67372

6 years agoMerge "Add helper classes to auto indent newlines for ostreams"
Ajay Panicker [Thu, 10 May 2018 22:51:31 +0000 (15:51 -0700)]
Merge "Add helper classes to auto indent newlines for ostreams"
am: e3c041c4a4

Change-Id: Ifbcafaa32c70a3400b609772e0ec55bf1136abef

6 years agoUse weak pointers for device.cc callbacks to prevent use after delete
Ajay Panicker [Thu, 10 May 2018 19:39:32 +0000 (12:39 -0700)]
Use weak pointers for device.cc callbacks to prevent use after delete

Bug: 79400706
Test: Turn bluetooth off then on while connected to a device and playing
music

Change-Id: I2132bb01796a724fba6a36f4eca4f4795b919864
(cherry picked from commit 497e2833c983377ae501c15d5c66327c9c5dbafa)

6 years agoMerge "Add helper classes to auto indent newlines for ostreams"
Treehugger Robot [Thu, 10 May 2018 22:35:02 +0000 (22:35 +0000)]
Merge "Add helper classes to auto indent newlines for ostreams"

6 years agoMerge "Hearing Aid: Add dumpsys log for audio packet"
Hansong Zhang [Thu, 10 May 2018 22:01:45 +0000 (15:01 -0700)]
Merge "Hearing Aid: Add dumpsys log for audio packet"
am: 5ac698c04e

Change-Id: Id4a1078b2197eb60b321dcffbe76095ad0aee4b7

6 years agoMerge "Hearing Aid: Add dumpsys log for audio packet"
Treehugger Robot [Thu, 10 May 2018 21:23:46 +0000 (21:23 +0000)]
Merge "Hearing Aid: Add dumpsys log for audio packet"

6 years agoHearingAid RemoveDevice - don't crash when profile not enabled
Jakub Pawlowski [Thu, 10 May 2018 20:20:25 +0000 (13:20 -0700)]
HearingAid RemoveDevice - don't crash when profile not enabled
am: f7c7cd2120

Change-Id: If3b9cbe1c96ac890c40726c034e71a4314138036

6 years agoHearingAid RemoveDevice - don't crash when profile not enabled
Jakub Pawlowski [Thu, 10 May 2018 13:42:43 +0000 (06:42 -0700)]
HearingAid RemoveDevice - don't crash when profile not enabled

Bug: 79468820
Test: Unbond non-hearing aid device when profile not enabled
Change-Id: I2a87f8725447045e7bc5b2a33facf1ce14b47c54

6 years agoHearing Aid: Add dumpsys log for audio packet
Hansong Zhang [Wed, 9 May 2018 21:39:56 +0000 (14:39 -0700)]
Hearing Aid: Add dumpsys log for audio packet

Add log for audio drops from audio HAL and buffer overflow
Add log for device capabilities and HiSyncId

Sample output:

Hearing Aid Manager:
  <device1> connected
    binaural right 0x...
    Packet counts (enqueued/flushed)                        : 73557 / 773
    Frame counts (enqueued/flushed)                         : 73557 / 773
  <device2> connected
    binaural left 0x...
    Packet counts (enqueued/flushed)                        : 74172 / 886
    Frame counts (enqueued/flushed)                         : 74172 / 886
  Hearing Aid Audio HAL:
    Counts (underflow)                                      : 0
    Bytes (underflow)                                       : 0
    Last update time ago in ms (underflow)                  : 0

Test: manual
Bug: 69623109
Change-Id: I5021b9214828b1846506638000f29af7343a3354

6 years agoMerge "A2DP: Add logging when A2DP fails to open"
Jack He [Thu, 10 May 2018 01:08:49 +0000 (18:08 -0700)]
Merge "A2DP: Add logging when A2DP fails to open"
am: 9f5ab2434e

Change-Id: I825570e840f65192e4746eef762e1f8c36f6c135

6 years agoMerge "A2DP: Add logging when A2DP fails to open"
Treehugger Robot [Thu, 10 May 2018 00:58:48 +0000 (00:58 +0000)]
Merge "A2DP: Add logging when A2DP fails to open"

6 years agoMerge "Fix LE cancel open when physical connection is established but not ready"
Vinit Deshpande [Thu, 10 May 2018 00:18:59 +0000 (17:18 -0700)]
Merge "Fix LE cancel open when physical connection is established but not ready"
am: cd40bfb8d7

Change-Id: I3e27ee66923fbc5eb6bd0357c6913ea82b904857

6 years agoMerge "Fix LE cancel open when physical connection is established but not ready"
Vinit Deshpande [Wed, 9 May 2018 23:58:48 +0000 (23:58 +0000)]
Merge "Fix LE cancel open when physical connection is established but not ready"

6 years agoA2DP: Add logging when A2DP fails to open
Jack He [Wed, 9 May 2018 22:44:09 +0000 (15:44 -0700)]
A2DP: Add logging when A2DP fails to open

* Make sure we output a log line whenever A2DP start request returns a
  failure state, namingly:
  - A2DP_CTRL_ACK_FAILURE
  - A2DP_CTRL_ACK_INCALL_FAILURE
  - A2DP_CTRL_ACK_DISCONNECT_IN_PROGRESS

Bug: 74988740
Test: make, logging only change
Change-Id: I63280d6280bf9c3d3ee6c578c1be332f8a9a3be0

6 years agoFix LE cancel open when physical connection is established but not ready
WENTAO WANG [Mon, 20 Nov 2017 21:10:07 +0000 (13:10 -0800)]
Fix LE cancel open when physical connection is established but not ready

Issue:
Cancel open does not work when the physical connection is established
but negotiation is not finished.

Fix:
Close the physical connection and release resources when fitting in this
situation.

Bug: 64230040
Test: test_cancel_open_ble_process
Change-Id: Ia23b5f3aab427b333d9d484b97e4cd4ff49f5319

6 years agoMerge "Fix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode"
Stanley Tng [Wed, 9 May 2018 20:29:13 +0000 (13:29 -0700)]
Merge "Fix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode"
am: 11e1274a05

Change-Id: I7e48817c7b29522b2912d48ef1282282e7e833a9

6 years agoMerge "Fix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode"
Treehugger Robot [Wed, 9 May 2018 20:23:34 +0000 (20:23 +0000)]
Merge "Fix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode"

6 years agoAdd helper classes to auto indent newlines for ostreams
Ajay Panicker [Thu, 3 May 2018 19:58:53 +0000 (12:58 -0700)]
Add helper classes to auto indent newlines for ostreams

Bug: 79167906
Test: adb shell dumpsys bluetooth_manager
Change-Id: I54484181abc438e90ade771fca6943c2b303e4db

6 years agoFix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode
Stanley Tng [Wed, 9 May 2018 17:39:37 +0000 (10:39 -0700)]
Fix PTS: TC_GATT_SR_UNS_BI_01_C sends unsupported opcode

In this PTS test, add code to send back an unsupported error response
when an unsupported OpCode is received.

Bug: 79347869
Test: Rerun and pass PTS test
Change-Id: Ibf95dbc18dabbe201850da675c7a1b2739624de9

6 years agoMerge "Handle unbonding in Hearing Aid profile"
Jakub Pawlowski [Wed, 9 May 2018 08:12:24 +0000 (01:12 -0700)]
Merge "Handle unbonding in Hearing Aid profile"
am: ab22148a79

Change-Id: Icaee7201a4e47b471c60dcbc54eb2984d0cfa19f

6 years agoMerge "Handle unbonding in Hearing Aid profile"
Jakub Pawlowski [Wed, 9 May 2018 08:06:15 +0000 (08:06 +0000)]
Merge "Handle unbonding in Hearing Aid profile"

6 years agoMerge "Remove unused `tags` property from Android.bp files"
Dan Willemsen [Wed, 9 May 2018 06:06:07 +0000 (23:06 -0700)]
Merge "Remove unused `tags` property from Android.bp files"
am: 2b737b856d

Change-Id: Ie67b2d049583b8c9b25d4b0e8d1c26a25f700309

6 years agoMerge "Remove unused `tags` property from Android.bp files"
Dan Willemsen [Wed, 9 May 2018 05:59:03 +0000 (05:59 +0000)]
Merge "Remove unused `tags` property from Android.bp files"

6 years agoFetch the presentation position only if the audio state is STARTED
Pavlin Radoslavov [Wed, 9 May 2018 03:27:34 +0000 (20:27 -0700)]
Fetch the presentation position only if the audio state is STARTED
am: 61d1e86c5b

Change-Id: I693595f6bf4c5a95c08d5859887f9f5ef41242bd

6 years agoMerge "HFP: Remove parameter to start/stopScoUsingVirtualVoiceCall"
android-build-prod (mdb) [Wed, 9 May 2018 01:37:58 +0000 (18:37 -0700)]
Merge "HFP: Remove parameter to start/stopScoUsingVirtualVoiceCall"
am: 6e938867c3

Change-Id: I04318b2d604645b7aa566a4d3422df14ff0f50dc

6 years agoFetch the presentation position only if the audio state is STARTED
Pavlin Radoslavov [Wed, 9 May 2018 01:00:24 +0000 (18:00 -0700)]
Fetch the presentation position only if the audio state is STARTED

The audio HAL will fetch the audio presentation position (for the
purpose of delay reporting if the Headset supports it) only if the
audio state is STARTED.
Otherwise, it will use the default value (e.g., the one used
when the Headset does not support delay reporting).

This avoids unnecessary transient re-opening of the HAL control path
between the Audio framework and Bluetooth native stack (e.g., during
shutdown).

Bug: 78360113
Test: Manual - A2DP streaming with Headsets that support delay reporting
Change-Id: I56f7e9373ba27606913c74fa818da40305df85d4

6 years agoMerge "HFP: Remove parameter to start/stopScoUsingVirtualVoiceCall"
android-build-prod (mdb) [Wed, 9 May 2018 00:25:12 +0000 (00:25 +0000)]
Merge "HFP: Remove parameter to start/stopScoUsingVirtualVoiceCall"

6 years agoRemove unused `tags` property from Android.bp files
Dan Willemsen [Wed, 9 May 2018 00:08:54 +0000 (17:08 -0700)]
Remove unused `tags` property from Android.bp files

The tags property is (and has always been) unused by Soong. The property has
been defined as a list of strings, and the `androidmk` converted any
LOCAL_MODULE_TAGS entries over to it, but we've never done anything with it.

In preparation for removing the definition from Soong, I'm removing it from all
Android.bp files in the tree.

Since this has never done anything, this is a no-op, but if you really did want
the Android.mk behavior, the proper way to define a module to be installed in
userdebug / eng builds is to use PRODUCT_PACKAGES_DEBUG or PRODUCT_PACKAGES_ENG
in the appropriate product makefile.

Change-Id: I48cba711acbc030a98aea674016a0d53f8b5e4aa
Exempt-From-Owner-Approval: global no-op build change
Test: remove `tags` from Soong, see errors go away.

6 years agoHandle unbonding in Hearing Aid profile
Jakub Pawlowski [Tue, 8 May 2018 14:44:43 +0000 (07:44 -0700)]
Handle unbonding in Hearing Aid profile

Bug: 69623109
Change-Id: I3b1f778e414511a3748cebd2b0e233d638cd4d43
Fixes: 79207134
Test: unbond from Hearing Aid when connected or disconnected from it

6 years agoMerge "Return early if vendor-specific command fails"
android-build-prod (mdb) [Tue, 8 May 2018 17:46:03 +0000 (10:46 -0700)]
Merge "Return early if vendor-specific command fails"
am: c2e46139c9

Change-Id: I277503a4a8c5b86536a77c97c6dec3417b56fe9a

6 years agoMerge "Return early if vendor-specific command fails"
android-build-prod (mdb) [Tue, 8 May 2018 17:37:04 +0000 (17:37 +0000)]
Merge "Return early if vendor-specific command fails"

6 years agoMerge "Send correct key state and ignore keys from inactive device (1/2)"
Ajay Panicker [Tue, 8 May 2018 16:45:33 +0000 (09:45 -0700)]
Merge "Send correct key state and ignore keys from inactive device (1/2)"
am: a7b6d3a8e1

Change-Id: Ie47e3adbafaa6c7a15bd5fc241324a16f07b2aaf

6 years agoMerge "Send correct key state and ignore keys from inactive device (1/2)"
Ajay Panicker [Tue, 8 May 2018 16:37:15 +0000 (16:37 +0000)]
Merge "Send correct key state and ignore keys from inactive device (1/2)"

6 years agoReturn early if vendor-specific command fails
Myles Watson [Thu, 3 May 2018 18:15:50 +0000 (11:15 -0700)]
Return early if vendor-specific command fails

Add CHECK() statements to crash if the callback is passed the incorrect
opcode or if there are no parameters.

Bug: 76192234
Bug: 77495521
Test: Start Bluetooth with a BT 3.0 chip (or a simulated one)
Change-Id: Iddd9a8503b2cfd52b16fb1c59f40e108b478e7b6