OSDN Git Service
Chenyang Zhang [Mon, 26 Mar 2018 03:21:59 +0000 (11:21 +0800)]
HSP: Keep sending RING message
Two PTS Test failed:
- HSP/AG/IAC/BV-01-I
- HSP/AG/ACR/BV-02-I
Reason:
AG didn't send the "RING" unsolicited result code to HS(PTS),
then HS can't send the "AT+CKPD=200" command to received the call.
After a while, the "FATAL ERROR (MTC): Call establishment timed out"
triggered by PTS.
Solution:
Keep sending RING message for HSP.
Bug:
77507028
Change-Id: If1288a5f7b1b7da8ecba34ed90a85a0af8a91e9a
Logan Chien [Mon, 23 Apr 2018 06:46:28 +0000 (14:46 +0800)]
Rename <cutils/log.h> to <log/log.h>
Bug:
78370064
Test: lunch aosp_walleye-userdebug && cd system/bt && mma
Change-Id: I43448e88c236b72d86206bd652075f35eccca6f6
Petri Gynther [Wed, 18 Apr 2018 01:29:09 +0000 (18:29 -0700)]
A2DP offload: switch to new properties
Bug:
63932139
Bug:
76201991
Test: Manual A2DP testing (A2DP offload enabled and disabled)
Change-Id: Idcc2af40bde09758e060861ac518c06b7551212a
Treehugger Robot [Thu, 19 Apr 2018 23:23:21 +0000 (23:23 +0000)]
Merge "Don't start the authentication when peer device already started it"
Pavlin Radoslavov [Wed, 18 Apr 2018 17:57:22 +0000 (10:57 -0700)]
Reset the A2DP coding parameters when switching codecs
Bug:
77281039
Test: Manual - connect Headset and switch codecs while playing audio
Change-Id: Icb89b0d78195fd654d66bc1334b121cf62c55be1
Jakub Pawlowski [Thu, 12 Apr 2018 12:42:31 +0000 (05:42 -0700)]
GATT: fix 32 bit UUID handling
When writing UUID into stream with gatt_build_uuid_to_stream, we always
use 16bit or 128bit representation. In GATT code returning service UUID,
we were returning 32bit representation lenght, even though 128bit
representation was being returned in the stream. This resulted in
invalid GATT database content being returned, and the service not being
visible.
Bug:
66912853
Test: create GATT database with 32bit UUID, discover from remote device
Change-Id: I791a518ab080bd99db0a8be18d97e865c838fc7e
Treehugger Robot [Wed, 18 Apr 2018 01:42:29 +0000 (01:42 +0000)]
Merge "Add ability to disable wide band speech"
Treehugger Robot [Wed, 18 Apr 2018 01:24:28 +0000 (01:24 +0000)]
Merge "Fix check for device lookup in map"
Treehugger Robot [Wed, 18 Apr 2018 00:44:03 +0000 (00:44 +0000)]
Merge "Fix a memory leak when disabling AVDTP"
Treehugger Robot [Wed, 18 Apr 2018 00:42:45 +0000 (00:42 +0000)]
Merge changes from topics "bt-avdtp-get-basic-capabilities", "bt-a2dp-acceptor-codec-config"
* changes:
Include only the Basic Capability for AVDTP GetCapabilities response
Handle properly AVDTP SetConfig from the A2DP Sink device
Zach Johnson [Fri, 6 Oct 2017 00:47:13 +0000 (17:47 -0700)]
Add ability to disable wide band speech
Some HF android-based devices need to disable
wide band speech due to interop issues.
Test: Pair and test phone calls
Bug:
65053641
Change-Id: Ie8c4a50c40149562d6b52336fba1a61f1abf5198
Pavlin Radoslavov [Sat, 14 Apr 2018 02:57:25 +0000 (19:57 -0700)]
Fix a memory leak when disabling AVDTP
Added new function bta_av_free_scb() to explicitly
free tBTA_AV_SCB struct.
Bug:
78034873
Test: Code compilation
Change-Id: Ic738c64f61fd273bc2988fa98cb7cedebf1c4b76
Ajay Panicker [Tue, 17 Apr 2018 21:15:30 +0000 (14:15 -0700)]
Fix check for device lookup in map
Bug:
78134184
Test: Run host native test net_test_avrcp
Change-Id: I57dd0040aa0e97f623cff97a28dc98e196414559
Jakub Pawlowski [Tue, 17 Apr 2018 17:43:37 +0000 (10:43 -0700)]
New GATT cache storage format
We will need characteristic definition handle, and handle of end of
included service in the future. Store it properly.
Bug:
67056747
Test: GattCacheTest.nv_attr_to_binary_test
Change-Id: I170e1a39d3c055efddd91639f756d74eb4ecc304
Pavlin Radoslavov [Sat, 14 Apr 2018 05:07:30 +0000 (22:07 -0700)]
Include only the Basic Capability for AVDTP GetCapabilities response
AVDTP GetCapabilities request should return only the Basic
Capabilities, as defined in the AVDTP 1.3 spec.
Otherwise, returning a capability such as Delay Reporting would
result in some remote devices droping the AVDTP connection
Also:
* Print SEP protocol service capabilities per Stream Control
Block when dumping the state to a bugreport
* Add extra log messages
Bug:
77668253
Test: Manual: connect with Momentum M2 Headset and examine the
AVDTP GetCapabilities response.
Change-Id: I34f2e8ff586115a38c3436b2b6300514f65346a9
Pavlin Radoslavov [Tue, 10 Apr 2018 01:01:41 +0000 (18:01 -0700)]
Handle properly AVDTP SetConfig from the A2DP Sink device
If the remote device is proactive and sends AVDTP SetConfig after
re-connection before the local device gets the chance to do it, the
internal codec setup state might be inconsistent.
* Fix the internal logic when the local device is Acceptor inside
file bta_av_co.cc, and simplify some of the code.
* Fix the handling of p_scb->sep_info_idx inside bta_av_save_caps()
when receiving capabilities from the remote device.
* Add new A2dpCodecConfig::setPeerCodecCapabilities() method that is
implemented by each codec.
Bug:
77525584
Test: Manual - initiate connection by Momentum 2.0 Wireless Headset.
Connect/disconnect/reconnect multiple headsets.
Change-Id: I456df7c8a2fa0758c0908a4628c4dfae3259dbdb
Jakub Pawlowski [Mon, 16 Apr 2018 14:55:06 +0000 (07:55 -0700)]
GATT: make last service end group handle equal to 0xFFFF
ESR06 (errata 4065) added sentence:
"The End Group Handle of the last service in a device can be 0xFFFF."
It talks about last service, not last primary service. Right now,
secondary service added after last primary service will result in in
last primary service being corrupted - descriptor added to last
characteristic, and some characteristics added.
Bug:
78107486
Change-Id: I6a146fce2c946cdff176ff79f147830e29d3b807
Satish kumar sugasi [Tue, 3 Apr 2018 19:09:41 +0000 (12:09 -0700)]
A2DP Offload: Handle init/deinit as part of start/end session
Bug:
77289942
Test: Manual
Change-Id: I5b7ca6e485788d69f574bb74d2ef423507b183ff
Ajay Panicker [Fri, 13 Apr 2018 18:49:34 +0000 (11:49 -0700)]
AVRCP: Inform upper layer if absolute volume isn't supported
Before, the upper layers would be informed when a device connected that
supported absolute volume. Now even devices that don't support absolute
volume get reported.
Bug:
33962015
Test: Run host native test net-test-avrcp
Change-Id: If083ccbb9ba9a170c5bca359e632585d826c6fa5
Sunny Kapdi [Fri, 23 Mar 2018 06:54:40 +0000 (23:54 -0700)]
A2DP Offload: Fix the default LDAC bitrate
Use LDAC ABR as default option in A2DP Offload mode.
Bug:
77879487
Test: Manual
Change-Id: Iec76691f8a83cd47aa7bf38efc6554139a59bb89
Joseph Pirozzo [Thu, 12 Apr 2018 15:22:19 +0000 (15:22 +0000)]
Merge "AVRCP controller browsing deep copy and get folder range"
Stanley Tng [Thu, 12 Apr 2018 14:36:12 +0000 (14:36 +0000)]
Merge "Pass new LE CoC min_ce/max_ce parameters to native stack"
ilbeom.kim [Wed, 11 Apr 2018 23:26:10 +0000 (08:26 +0900)]
Don't start the authentication when peer device already started it
If host gets link_key_request event from the controller, it means peer
device started the authentication.
In this case, host should not start the authentication because it will
be caused the authentication collision by controller side.
This sequence can be referred at BT 4.2 core specification document,
p.1388, Figure 4.2.
Bug:
74241491
Test: Manual
- Connect Android wear to Android phone
- Turn off BT on Android wear
- Turn on BT on Android wear
- Observe the logcat whether connection time is within 30 seconds
Android Wear Stability Test
Change-Id: I138d45316ea75dd96444c36bde36ce15a64b669a
Stanley Tng [Mon, 19 Mar 2018 19:48:04 +0000 (12:48 -0700)]
Pass new LE CoC min_ce/max_ce parameters to native stack
Add new test connection event (ce) parameters, min_ce and max_ce, to
the SL4A tests for LE Connection-oriented Channel (CoC) feature.
Test: Run cmd: act.py -c $MY_SL4A_CONFIG -tc BleCoc2ConnTest
Bug:
77528723
Change-Id: Ifea040f0eb105f89539e6b74f5c2edc76147a065
Joseph Pirozzo [Wed, 11 Apr 2018 19:40:20 +0000 (12:40 -0700)]
AVRCP controller browsing deep copy and get folder range
AVRCP browsing was unstable on the sink side due to bytes
being used instead of integers for get_folder_items_cmd
and a lack of deep copy in the data buffers. This patch
allows both browse and vendor commands to work correctly.
Bug:
72496280
Test: stream music and browse at the same time.
Change-Id: Id4d34101c918947450923b68e087e6851ce99130
Jack He [Mon, 2 Apr 2018 20:04:58 +0000 (13:04 -0700)]
Metrics: Add metrics item for profile usage
Item A: Add messages to log profile connections
* Add ProfileUsageStats message in bluetooth.proto
* Add BluetoothProfileId enum to represent each profile
* Add num_times_connected item to log how many times a profile is
connected
Item B: Add messages to log headset profile connections for HSP and HFP
* Add HeadsetProfileConnectionStats message in bluetooth.proto
* Add HeadsetProfileType enum to represent each headset profile type
* Add num_times_connected item to log how many times each headset
profile is connected
* Add unit tests in metrics_tests
* Remove "clear" flag in various metrics dumping methods to make sure
that we clean up metrics every time we dump
Bug:
77476285
Test: make, net_test_osi, BtFunhausMetricsTest,
adb shell dumpsys bluetooth_manager --proto-bin
Change-Id: Ib18948c50ddb98ab7472f7b51a9bb98d153071c7
Merged-In: Ib18948c50ddb98ab7472f7b51a9bb98d153071c7
Treehugger Robot [Wed, 11 Apr 2018 03:56:38 +0000 (03:56 +0000)]
Merge "Call AVRC_close when an AVRCP connection is closed"
Treehugger Robot [Wed, 11 Apr 2018 03:14:27 +0000 (03:14 +0000)]
Merge "DM: Add error logs for failed discovery attempt"
Treehugger Robot [Wed, 11 Apr 2018 02:54:40 +0000 (02:54 +0000)]
Merge "Improve A2DP codec run-time debug-abilitity"
Jack He [Wed, 11 Apr 2018 00:44:35 +0000 (17:44 -0700)]
DM: Add error logs for failed discovery attempt
Bug:
72817086
Test: make, no functional change
Change-Id: I0df4efa62de00956eea1b5b5d244f4821bcaf6fc
Ajay Panicker [Wed, 11 Apr 2018 02:24:51 +0000 (19:24 -0700)]
Call AVRC_close when an AVRCP connection is closed
AVRC_Close needs to be called whenever a connection is closed otherwise
the AVCT control block is never cleaned up.
Bug:
77633048
Test: Run host native test net_test_avrcp and connect/disconnect from a
device multiple times.
Change-Id: Ia6a1b2606a87803316aad41ae27db858bf922548
Pavlin Radoslavov [Sat, 7 Apr 2018 00:05:47 +0000 (17:05 -0700)]
Improve A2DP codec run-time debug-abilitity
Rename A2DP_DumpCodecInfo() to A2DP_CodecInfoString() and change
the usage. Previously, A2DP_DumpCodecInfo() would print the
the codec information only if LOG_VERBOSE() was enabled in compile time.
The new A2DP_CodecInfoString() now returns human-readable std::string
with the codec information.
That string can be used in debug log messages that can be enabled
in run-time.
Bug:
77525584
Test: Manual - Examine log messages when A2DP streaming with and
without debug log messages enabled.
Change-Id: Idd440d6c9e908520132feeeb5388d3e6aefa26db
Ajay Panicker [Tue, 10 Apr 2018 23:35:37 +0000 (16:35 -0700)]
Set default AVRCP version to 1.4
Bug:
77874113
Test: Check snoop logs to see that the broadcasted AVRCP version is 1.4
Change-Id: If36bccc58d04dffe46286ee8d18785b680b9de8a
Zach Johnson [Fri, 30 Mar 2018 20:33:54 +0000 (13:33 -0700)]
Allow platforms to override client connection sniff timeout
It is already possible to set server connection sniff timeouts.
Bug:
70309445
Test: inspect timeouts via logs
Change-Id: Ibc19dd4f77aa28388169b2ce70d12200020e6a4d
Jack He [Thu, 5 Apr 2018 22:39:27 +0000 (15:39 -0700)]
HFP: Report AT+BIA command to upper layer
* Report AT+BIA command, AG indicator activation command, to upper layer
so that upper layer can decide on whether or not to subscribe to these
indicators
Bug:
77655992
Test: make
Change-Id: Ic330d6784c5edf20683cbfedda3fa54525878ce8
Treehugger Robot [Fri, 6 Apr 2018 21:54:06 +0000 (21:54 +0000)]
Merge "Add hidden API to get current user of HID Device (2/3)"
Ajay Panicker [Thu, 5 Apr 2018 16:14:51 +0000 (09:14 -0700)]
Check if socket is closed before getting presentation position
Bug:
76456293
Test: Listen to music on a device that supports delay reporting
Change-Id: I4ca1c31819594750a7beb1d11ca5b8d64a7f836c
Treehugger Robot [Thu, 5 Apr 2018 23:36:10 +0000 (23:36 +0000)]
Merge "Disable absolute volume if the remote device rejects registration"
Treehugger Robot [Thu, 5 Apr 2018 19:20:23 +0000 (19:20 +0000)]
Merge "vendor_libs: Allow btlinux service to run from vendor or system/vendor"
Dmitry Shmidt [Thu, 5 Apr 2018 17:35:37 +0000 (10:35 -0700)]
vendor_libs: Allow btlinux service to run from vendor or system/vendor
Bug:
75290651
Test: Manual
Change-Id: I30bda23667ac911bf21da5705d248833f919f8bf
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Ajay Panicker [Wed, 4 Apr 2018 05:28:06 +0000 (22:28 -0700)]
Disable absolute volume if the remote device rejects registration
Instead of trying to re-register for a rejected volume changed
notification, disable absolute volume. This prevents spinning if a
remote device continuously rejects all attempts to register. A volume
level of -2 will be used to represent that the volume notification was
rejected.
Bug:
77238060
Test: Run host native test net_test_avrcp
Change-Id: I228524fb30348ca691d0792f0c7bcc4653d1fcef
Treehugger Robot [Thu, 5 Apr 2018 01:39:23 +0000 (01:39 +0000)]
Merge "HID Device: remove "Cabled" flag when device is not used"
Hansong Zhang [Wed, 4 Apr 2018 01:17:43 +0000 (18:17 -0700)]
HID Device: remove "Cabled" flag when device is not used
Remove the "HidDeviceCabled" flag from the config when the remote device
is not currently being usec
Bug:
77549256
Test: manual
Change-Id: I2c88e972457608699c3f0344357828324a419b90
Treehugger Robot [Wed, 4 Apr 2018 21:42:17 +0000 (21:42 +0000)]
Merge "Hearing Aid: change get/set active device (1/3)"
Ajay Panicker [Tue, 3 Apr 2018 01:21:04 +0000 (18:21 -0700)]
Persist VFS ID's between directory changes.
Some carkits don't honor the fact that VFS ID's only are consistent to
the folder they are currently browsing. Now a UID will remain valid
until the connection ends.
Bug:
68812037
Test: Run net_test_avrcp
Change-Id: I67898277327b54eaeca2121b9ff173b22bd4ba71
Hansong Zhang [Mon, 8 Jan 2018 23:05:21 +0000 (15:05 -0800)]
Add hidden API to get current user of HID Device (2/3)
Bug:
69136526
Test: test with apps using HID Device profile
Change-Id: I6c6df052fac508499c42fc7ab493010e327d6003
Ajay Panicker [Mon, 2 Apr 2018 22:36:35 +0000 (15:36 -0700)]
Refresh the now playing ID map when the now playing list changes
The Now Playing List ID's could be invalid if the now playing list
changes but there is not track change, like when adding a song to the
queue on the device.
Bug:
68812037
Test: Run host native test net_test_avrcp
Change-Id: I3c2c11aa87b64241f378819c38ae5cc21ffdb5ac
Ajay Panicker [Sat, 31 Mar 2018 21:38:53 +0000 (14:38 -0700)]
Add MTU Handling for AVRCP Packets
Bug:
77241554
Test: Run host native tests net_test_avrcp and net_test_btpacket
Change-Id: If32aa506dc8f99220ef35efeb4d77a1023767afe
Jack He [Wed, 28 Mar 2018 20:02:37 +0000 (13:02 -0700)]
RFCOMM: Add more logging on failure cases
* Log every instance of RFCOMM unexpected disconnection
* Log every time when RFCOMM channel (DLCI) is changed
* Refactor some RFCOMM code to be more readable and easier for logging
* Remove excessive logging in power manager
* Assign HSP default version more appropriate location
* Replace some usage of NULL with nullptr
Bug:
77224743
Test: make, no functional changes
Change-Id: I5e62dd6d338f7e92a8b8d39c1fe155b71396034c
Treehugger Robot [Fri, 30 Mar 2018 20:58:11 +0000 (20:58 +0000)]
Merge "Reduce the number of PCM data reads for aptX and aptX HD"
Treehugger Robot [Fri, 30 Mar 2018 19:55:46 +0000 (19:55 +0000)]
Merge changes from topic "AVRCP Controller Browsing"
* changes:
AVRCP play status change updates
AVRCP register for addressed player changed
Pavlin Radoslavov [Fri, 30 Mar 2018 19:14:14 +0000 (12:14 -0700)]
Reduce the number of PCM data reads for aptX and aptX HD
For every periodic aptX / aptX HD data packet, use a single read
operation for all PCM data that needs to be encoded, instead of
using multiple reads of smaller blocks of data.
Bug:
70899260
Test: Manual: stream to aptX/aptX HD headset, change the sample rate
Change-Id: Ifcb8302589f24f5d7ab89c645c50d6905197fb7f
Hansong Zhang [Wed, 28 Mar 2018 23:43:21 +0000 (16:43 -0700)]
Hearing Aid: change get/set active device (1/3)
* setActiveDevice() returns false in error case, e.g. when the device is
not connected
* add getActiveDevices() instead of isActiveDevice(), which returns a list
that must have two elements: left and right, or empty list on error
Test: manual
Bug:
69623109
Change-Id: I6f872dd88422e9d7e5187603d3ad33628726e1ca
Jakub Pawlowski [Tue, 27 Mar 2018 23:02:02 +0000 (16:02 -0700)]
Use RawAddress.ToString() instead of manual conversion
Test: compilation
Change-Id: I66040a4f3d339ac0473052d916b9a0b4e3045e8e
Jakub Pawlowski [Wed, 28 Mar 2018 22:00:13 +0000 (15:00 -0700)]
Unpair both transports of dual mode device, when LE address provided
In bta_dm_remove_device, if the device is not connected, and we don't
know the transport for given address, we make two calls to
BTM_ReadConnectedTransportAddress, to determine the device address on
the other transport.
If the address provided is LE, first call will fill the other_address
variable with the Classic address, and the second call will fill it back
with LE addres. This mean we never try to remove Classic entry, instead
we remove LE entry twice.
Bug:
67907612
Test: establish LE connnection between two phones, trigger Bonding.
After bonding complete, try to remove bond using LE address. Verify
config file is cleaned of both LE and classic entry.
Change-Id: Ia5dd53f96b95478a07009cecc5b4a3c79f15c59b
Treehugger Robot [Thu, 29 Mar 2018 16:16:00 +0000 (16:16 +0000)]
Merge changes I88d0862f,Ic9a2c8d8
* changes:
Use proper media ID when changing path
Add missing AVRCP Set Addressed Player Response
Ajay Panicker [Thu, 29 Mar 2018 00:04:39 +0000 (17:04 -0700)]
Use proper media ID when changing path
Use the current media ID on the path stack to retrieve folder contents.
Bug:
77237565
Test: run host native test net-test-avrcp
Change-Id: I88d0862f76d18a071a8530cd31954447b4e180fc
Ajay Panicker [Wed, 28 Mar 2018 23:02:36 +0000 (16:02 -0700)]
Add missing AVRCP Set Addressed Player Response
Bug:
77237301
Test: run host native tests net-test-btpackets and net-test-avrcp
Change-Id: Ic9a2c8d8cf5dd4c5be02a83975caa92e335ca2b9
Joseph Pirozzo [Wed, 28 Mar 2018 22:27:31 +0000 (15:27 -0700)]
AVRCP play status change updates
Process play status updates when seeking forward and backward.
Bug:
67568875
Test: seek forward and backward on paired phone and observe updates.
Change-Id: Id280f0e877cfea0a0da7603ab6d7bcfaf667d482
Treehugger Robot [Wed, 28 Mar 2018 21:50:01 +0000 (21:50 +0000)]
Merge "Revert "HID: Fix the behavior of virtual_cable_unplug""
Hansong Zhang [Wed, 28 Mar 2018 19:52:36 +0000 (19:52 +0000)]
Revert "HID: Fix the behavior of virtual_cable_unplug"
This reverts commit
65ce047e3feeba934015870254535882edf61743.
Reason for revert: Connected HID keyboard won't unpair
Bug:
76907578
Test: SL4A
Change-Id: I7d289183ac05b5f926c145799418461377228569
Pavlin Radoslavov [Wed, 28 Mar 2018 19:30:14 +0000 (12:30 -0700)]
Changed the default configured sample rate for aptX/aptX-HD to 48.0kHz
Previously, the default configured sample rate for aptX and aptX-HD
was 44.1kHz. However, during AVDTP codec setup, the initial codec
setup to 44.1kHz was followed immediately with automatic codec
reconfiguration to 48.0kHz (if supported by the remote device)
so the highest possible sample rate will be used.
Changing the default sample rate to 48.0kHz eliminates the
transient initial codec setup of 44.1kHz, because it is unnecessary
and error-prone.
Bug:
69276823
Test: Manual: connect to aptX / aptX-HD headsets and examine the AVDTP codec
configuration in the btsnoop logs.
Change-Id: I9e22365e0f07690c87503ea52fd9bb4d1ad4d5ff
Joseph Pirozzo [Wed, 28 Mar 2018 16:20:48 +0000 (09:20 -0700)]
AVRCP register for addressed player changed
Register to be notified when the addressed media player changes so we
can update the AVRCP controller.
Bug:
72495854
Test: Change media player on phone, verify media source is updated.
Change-Id: I932a25b9861734ecc6e1fdcf40f02cdde1fd049a
Joseph Pirozzo [Tue, 27 Mar 2018 20:41:11 +0000 (13:41 -0700)]
Fix crash in Log
Correct parameter order.
Bug:
77009945
Test: observe log message
Change-Id: I69d4bc04936c322707111c825864007b7f257cc4
Treehugger Robot [Wed, 28 Mar 2018 00:14:08 +0000 (00:14 +0000)]
Merge "Open acceptor channel for RC on cleanup"
Treehugger Robot [Wed, 28 Mar 2018 00:02:00 +0000 (00:02 +0000)]
Merge "Serialize the commands during Pairing process"
AnubhavGupta [Tue, 11 Jul 2017 07:32:56 +0000 (13:02 +0530)]
Open acceptor channel for RC on cleanup
Usecase:
1. Install Fitbit app
2. Pair and connect with RD1
3. Start streaming
4. Pair and connect Fitbit watch
Failure:
No Stable Avctp connection with Fitbit Watch after pairing
Rootcause:
If there will be no listening acceptor
then some Remotes unable to connect AVRC
connection upon remote restart.
Fix:
Open acceptor channel for RC on cleanup
as if there will be no listening acceptor
then some Remotes unable to connect AVRC
connection upon remote restart.
Test: 1. Install Fitbit app
2. Pair and connect with RD1
3. Start streaming
4. Pair and connect Fitbit watch
Fixes:
63605621
Change-Id: Ia6cefc29ca64b00f2f5fe2f9816d71604c511415
Treehugger Robot [Tue, 27 Mar 2018 22:22:34 +0000 (22:22 +0000)]
Merge "Suppress unnecessary A2DP codec reconfiguration"
Treehugger Robot [Tue, 27 Mar 2018 22:22:19 +0000 (22:22 +0000)]
Merge "A2DP Sink: add a mechanism for selecting the codec"
Srinu Jella [Wed, 18 Dec 2013 06:27:33 +0000 (11:57 +0530)]
Serialize the commands during Pairing process
Steps:
1. Pair and connect with HID mouse.
2. Once the settings UI shows paired and connected
3. Try to unpair the device, but UI still shows connected.
Failure: Unable to unpair HID mouse due to LMP
response timeout occurred for remote version and remote
feature request.
Root Cause: Remote version, Remote features, Authentication
requested commands go simultaneously to the remote device
which can't handle the multiple commands at a time.
Fix: Serialize the Remote version, Remote features, Authentication
requested commands.
Test: Tested manually with apple magic mouse.
Bug:
35125883
Change-Id: I4448c291a60ee637dc5927806547e67f26571d86
Pavlin Radoslavov [Tue, 27 Mar 2018 07:17:29 +0000 (00:17 -0700)]
Suppress unnecessary A2DP codec reconfiguration
If OTA A2DP codec configuration is accepted from the remote
device, then don't trigger codec reconfiguration.
Bug:
74521894
Test: Manual: accept connection and codec config from A2DP Sink
Change-Id: Ic2f6ff08d130adf85cad68a54ab9fbc0a711534c
Pavlin Radoslavov [Tue, 27 Mar 2018 06:30:46 +0000 (23:30 -0700)]
A2DP Sink: add a mechanism for selecting the codec
Use the existing mechanism for selecting the A2DP Source codec to
select the A2DP Sink codec when the local device is A2DP Sink.
* Added new method BtaAvCo::SelectSinkCodec() similar to
SelectSourceCodec() and use the new method to select the actual
codec based on the AVDTP Codec capability discovery.
* Renamed method BtaAvCo::UpdateSelectableCodec() to
UpdateSelectableSourceCodec() and added similar
UpdateSelectableSinkCodec()
* Renamed method BtaAvCo::AttemptCodecSelection() to
AttemptSourceCodecSelection() and added similar
AttemptSinkCodecSelection
* Renamed AudioSinkHasContentProtection() to AudioSepHasContentProtection()
because it can be used for either A2DP Source or Sink
* Removed method BtaAvCo::FindPeerSourceSepForCurrentCodec() because it
is not needed anymore.
* Added new method A2dpCodecs::findSinkCodecConfig() similar to
findSourceCodecConfig()
* Added new function A2DP_SinkCodecIndex() similar to
A2DP_SourceCodecIndex()
* Added new method A2dpCodecs::setSinkCodecConfig()
* Reorganize the SBC and AAC Source/Sink codec config classes:
- Virtual method A2dpCodecConfig::setCodecConfig() is now implemented
for Sink codecs as well: SBC Sink, AAC Sink
- Renamed A2dpCodecConfigSbc to A2dpCodecConfigSbcSource
- Renamed A2dpCodecConfigAac to A2dpCodecConfigAacSource
- Added base class A2dpCodecConfigSbcBase. That class implements
method setCodecConfig() for both A2dpCodecConfigSbcSource and
A2dpCodecConfigSbcSink
- Added base class A2dpCodecConfigAacBase. That class implements
method setCodecConfig() for both A2dpCodecConfigAacSource and
A2dpCodecConfigAacSink
- Updated the A2dpCodecConfigAacBase::setCodecConfig() so it computes
correctly the AAC Variable Bit Rate Support flag in the result codec
config: The Variable Bit Rate Support is disabled if either side
disables it.
* Removed A2DP_BuildSrc2SinkConfig() because it is not needed anymore.
The correspinding A2DP_BuildSrc2SinkConfigSbc() and
A2DP_BuildSrc2SinkConfigAac() are removed as well.
* Renamed a2dp_sbc_caps inside a2dp_sbc.cc to a2dp_sbc_source_caps
* Renamed a2dp_aac_caps inside a2dp_aac.cc to a2dp_aac_source_caps
* Added corresponding unit tests
Bug:
74521894
Test: Manual: initiate connection from A2DP Sink.
Unit tests in system/bt: test/run_unit_tests.sh net_test_stack
Change-Id: I3fc541a068993c123e8d61c209896bb758fd3764
Jack He [Sat, 21 Oct 2017 08:35:57 +0000 (01:35 -0700)]
HFP: Save discovered HFP version to config file
* Store discovered HFP version to btif config file so that a
reconnection session knows the HFP version before SDP
* Check stored HFP version when RFCOMM channel is open before any AT
command is processed
* Set peer HFP version to 0 on control block allocation
Bug:
67938255
Test: Connect with HFP 1.7 headsets
Change-Id: I43e7aa04dee17ea7ba9e7d3992ec0860c11d23bc
Jakub Pawlowski [Mon, 26 Mar 2018 16:08:07 +0000 (09:08 -0700)]
Fix potential NULL dereference in set_volume
Bug:
76217773
Change-Id: I50188e9c69dbcd42286097cb6fbc1aa715877c80
Jakub Pawlowski [Sat, 24 Mar 2018 00:48:26 +0000 (17:48 -0700)]
Use proper HCI_ERR_* constants in advertisement termination handling
There is no functional change, just making the code pretty, and updating
names to match 5.0 specification.
Test: sl4a AdvertisingSetTest:test_reenabling
Bug:
74198564
Change-Id: I1811e19bd18470adda55f7af7cfee23bcc4d1871
Jakub Pawlowski [Fri, 23 Mar 2018 17:29:14 +0000 (10:29 -0700)]
Guard ACPF with proper checks
Fail on calls to ACPF when it's not supported in controller.
Right now we sent such commands when starting/stopping the regular scan.
Bug:
69116550
Test: Enable bluetooth on platform without ACPF, start/stop scan
Change-Id: I334114d36a8af8c8f58d230f75ab3a00f009c4c5
Nitin Shivpure [Thu, 22 Mar 2018 10:46:32 +0000 (16:16 +0530)]
HOGP: Update status to OK, if link is already encrypted
Usecase:
1) Connect to HOGP device. (Because of some condition encryption fails with Connection
Timeout, remote device turned off when connection was initiated)
2) Try to connect again to HoGP device
Expected Result:
Connection should be successful
Observed Result:
UI stuck in connecting state and connection never succeeds.
Root cause:
When encryption fails in previous iteration, encryption happens before HoGP Server starts
security procedure, leading to Encryption Complete event being received with wrong status.
Fix:
Update the status to success when sending encryption complete event if link is already
encrypted
Test: Issue is not seen after above steps
Fixes:
76133015
Change-Id: Ib404cf157289170ea300eae40f51393606c35105
Jakub Pawlowski [Fri, 23 Mar 2018 19:34:37 +0000 (12:34 -0700)]
bta_gattc_sdp_callback move null check above first usage
Bug:
75311714
Test: Test scenario described in bug
Change-Id: Ib2da24134205277ae03cf28394db74758de17e5d
Jakub Pawlowski [Thu, 22 Mar 2018 00:13:36 +0000 (17:13 -0700)]
LE Advertising Report parsing enhancements
Reject invalid data length for advertisement data.
Also, don't attempt to resolve anonymous advertising addresses.
Test: LE scanning tests
Bug:
73193883
Change-Id: I1cb330bc30fdcaebc86527cd2656c9dd7932b318
Pavlin Radoslavov [Fri, 23 Mar 2018 09:01:03 +0000 (02:01 -0700)]
Remove deinit_pending flag that is not needed/used
Test: Code compilation
Bug:
74952724
Change-Id: I022e16940c73181f991d528b9c96e2d26151369f
Fukai Wang [Wed, 26 Jul 2017 01:35:21 +0000 (09:35 +0800)]
Add btm_free() to clean up btm properly
Test: Run AdapterRepeatedEnableDisable in system/bt/test with
kTestRepeatCount set to 1000.
Merged-In: I3445a725d66e73e8bcffc7bfabe594f49a6fc863
Change-Id: I3445a725d66e73e8bcffc7bfabe594f49a6fc863
Jakub Pawlowski [Thu, 22 Mar 2018 01:46:14 +0000 (18:46 -0700)]
Gracefully recover on bad attempt to cancel LE connection
According to logs some devices are stuck when in BLE_CONN_CANCEL state.
That is they sent "LE Create Connection Cancel" request, and are
awaiting "LE Connection Complete" event with invalid handle forever.
But they wait and wait, and the event never arrive. That's because
"LE Create Connection Cancel" was sent, when connection attempt is not
pending. In such case, we should act upon command complete status, and
decide to leave BLE_CONN_CANCEL state.
To properly fix this issue, one would have to implement a proper queue
for managing LE connection attempt state, preferably for scratch. This
fix just give option of graceful recovery.
Test: sl4a GattConnectTest
Bug:
75290221
Change-Id: I7e7a377c789ac0a587390320fbf504267cca8727
Pavlin Radoslavov [Thu, 22 Mar 2018 09:55:58 +0000 (02:55 -0700)]
Add Start/End Session for A2DP offload audio interface
* Added explicit btif_a2dp_audio_interface_start_session() and
btif_a2dp_audio_interface_end_session() and call them as appropriate.
* Removed unnecessary btif_a2dp_audio_interface_deinit() calls.
Bug:
74952724
Test: Manual: audio streaming without A2DP offload
Change-Id: I74b8c340ee258b09b9e1acbcb1cc75906ddc03fc
Pavlin Radoslavov [Thu, 22 Mar 2018 09:09:18 +0000 (02:09 -0700)]
Added Start/End Session steps when A2DP codec is changed
If the A2DP codec is changed for the active device, then
the current session is restarted by calling End/Start Session.
Also:
* Updated btav_a2dp_codec_config_t string representation to
include the codec priority.
* Fixed A2dpCodecConfig::setCodecPriority() and setDefaultCodecPriority()
so the codec priority for the current codec_config_ is updated.
* Fixed A2dpCodecs::setCodecUserConfig() so the restart_input flag
is set as appropriate.
* Use btav_a2dp_codec_config_t::ToString() as appropritate to print
the codec config instead of explicitly printing each field.
Bug:
74988739
Test: Manual: Connect two headsets, change codecs, switch active device.
Change-Id: I6652168f3c48e5b431e00aa8f554929afbdcdbcf
Treehugger Robot [Thu, 22 Mar 2018 00:17:01 +0000 (00:17 +0000)]
Merge "Write volume to Hearing Aid during connection setup"
Treehugger Robot [Wed, 21 Mar 2018 23:53:52 +0000 (23:53 +0000)]
Merge "Hearing Aid: Add API for active device"
Jakub Pawlowski [Tue, 20 Mar 2018 23:00:58 +0000 (16:00 -0700)]
Write volume to Hearing Aid during connection setup
Bug:
69623109
Test: connect both hearing aid, change volume, reconnect, verify volume
level
Change-Id: Ia728ee25993f1bd7ecaae2aa0c1cb78926583a9b
Pavlin Radoslavov [Tue, 20 Mar 2018 23:50:57 +0000 (16:50 -0700)]
Added Start/End Session steps to A2DP session setup
Start/End session is called when setting/changing the Active (remote)
device.
Also:
* For A2DP Source, btif_a2dp_source_setup_codec() is called only for
Start session. All other calls to btif_a2dp_source_setup_codec are
removed.
* Updated the btif_a2dp_source_setup_codec() implementation to
call btif_a2dp_source_audio_tx_flush_req() and flush the incoming audio
data. This removes 2 seconds hold-up delay when switching the active
device and streaming audio.
* Removed unnecessary lock inside btif/src/btif_a2dp_sink.cc
Bug:
74952724
Test: Manual - Connect two headsets, switch active device,
connect/disconnect.
Change-Id: I43702e1ddc108628de93161905465647471f554c
Treehugger Robot [Wed, 21 Mar 2018 00:39:04 +0000 (00:39 +0000)]
Merge "Add a property to enable the New AVRCP Profile (1/2)"
Hansong Zhang [Fri, 16 Mar 2018 02:52:46 +0000 (19:52 -0700)]
Hearing Aid: Add API for active device
Add setActiveDevice() and isActiveDevice() as it will be used in
Settings
Bug:
69623109
Test: compilation and instrumentation
Change-Id: Ifc92bab2306ed78cb6d203c5e1b0a5887730d24f
Ajay Panicker [Tue, 20 Mar 2018 21:27:51 +0000 (14:27 -0700)]
Set the default AVRCP Version to 1.5
Bug:
76027180
Test: Compile and connect to remote device and see in SDP that the
version reported is 1.5
Change-Id: I9ec88ca2127c3be055d7f64ccb8b3848cfed3fdf
Ajay Panicker [Sat, 17 Mar 2018 00:13:50 +0000 (17:13 -0700)]
Add a property to enable the New AVRCP Profile (1/2)
You can now use the new AVRCP Profile by setting
persist.bluetooth.enablenewavrcp to true.
Also fix a misundestanding with connection_handler.cc. AVRCP Control
callbacks return a null address when disconnecting.
Bug:
68854188
Test: Check to see that the profile is used when property is true and is
not used when property is false.
Change-Id: I4aa285c6bf009716cc80a80b813ba0acd3d8f9d8
Treehugger Robot [Mon, 19 Mar 2018 16:14:47 +0000 (16:14 +0000)]
Merge "Don't skip SDP discovery prior to AVDTP connection"
Pavlin Radoslavov [Fri, 16 Mar 2018 18:56:37 +0000 (11:56 -0700)]
Add missing codec initialization for A2DP Sink
Also:
* Added missing assert to check when local codecs are not initialized
* Removed unnecessary local copy: BtifAvSource::codec_priorities_
Bug:
74079615
Test: Manual: Enable A2DP Sink profile and initiate the connection from
Remote A2DP Source
Change-Id: I40ea1aa2164612bbe108ac06be7f6cae8be30a72
Pavlin Radoslavov [Sat, 17 Mar 2018 00:01:36 +0000 (17:01 -0700)]
Don't skip SDP discovery prior to AVDTP connection
This fixes an issue where the default AVDT_VERSION could be incorrectly
assigned to a remote device.
Bug:
74002223
Test: Manual: connect to Kinivo BTC450; power off/on the device to reconnect
Change-Id: I53817e942638d6e962aa5b8b87b7b31998270857
Ajay Panicker [Fri, 16 Mar 2018 18:36:26 +0000 (11:36 -0700)]
Fix sdk_mac builds for AVRCP Headers
Disable sdk_mac for avrcp_headers since libchrome isn't compiled for sdk
mac.
Test: Compile
Change-Id: Ia5b67450e1beb82a78958eca25e6579496bf1ef6
Joseph Pirozzo [Fri, 16 Mar 2018 18:56:51 +0000 (18:56 +0000)]
Merge "Utilize setting for AVRCP Target"
Treehugger Robot [Fri, 16 Mar 2018 08:30:19 +0000 (08:30 +0000)]
Merge "Implement the JNI layer for the AVRCP Service (2/3)"
Joseph Pirozzo [Wed, 14 Mar 2018 23:41:49 +0000 (16:41 -0700)]
Utilize setting for AVRCP Target
There is a setting that controls which AVRCP Target
version is enabled, use the same setting for both
source and sink devices.
Bug:
62397951
Test: Observe SDP record on sink device.
Change-Id: I65b307d011048ec88b3af8c542ce70601294cca8
Ajay Panicker [Thu, 15 Mar 2018 06:45:54 +0000 (23:45 -0700)]
Implement the JNI layer for the AVRCP Service (2/3)
Allows the AVRCP Service Interface to be retrieved via bt_interface_t.
Bug:
68854188
Test: Compile
Change-Id: I0d9464ea19d3bd382d07134bff057a5515501b95