OSDN Git Service
Stanley Tng [Thu, 5 Apr 2018 16:54:13 +0000 (09:54 -0700)]
Handle bad packet length in gatts_process_read_req
Added error check and handling code in gatts_process_read_req to
make sure that the packet length is correct.
Please note that there is another earlier CL that is reverted and this
is the updated one.
Bug:
73172115
Test: Run the test program, poc, that was attached in the bug report
Change-Id: Ia9b4e502fa8f8384bf9767e68f73b48a0915141b
Stanley Tng [Thu, 5 Apr 2018 16:40:45 +0000 (09:40 -0700)]
Revert "Handle bad packet length in gatts_process_read_req"
This reverts commit
b63f087fc79c3d1a66f73c3a34e8a73ebd65e82d.
There will be a newer fix uploaded later.
Bug:
73172115
Test: None
Stanley Tng [Mon, 2 Apr 2018 16:08:22 +0000 (09:08 -0700)]
Handle bad packet length in gatts_process_read_req
Added error check and handling code in gatts_process_read_req to
make sure that the packet length is correct.
Bug:
73172115
Test: Run the test program, poc, that was attached in the bug report
Change-Id: I375853987010c87432e73b75d659eabee852ec9c
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
Merged-In: Ifcb8302589f24f5d7ab89c645c50d6905197fb7f
(cherry picked from commit
c27d80a09e762b19eec09810822a5b6f39720e2b)
Myles Watson [Wed, 21 Mar 2018 23:45:32 +0000 (16:45 -0700)]
PAN: Always allocate in bta_pan_data_buf_ind_cback
Change I63b857d031c55d3a0754e4101e330843eb422b2a caused a double
free. Move the free call to pan_data_buf_ind_cb().
Free the buffer before every return in pan_data_buf_ind_cb.
Bug:
74950468
Test: manual tethering test with DUT sharing its connection
Change-Id: If4526f3042699581e2cdde79a362eef0f83768eb
Merged-In: If4526f3042699581e2cdde79a362eef0f83768eb
TreeHugger Robot [Fri, 30 Mar 2018 23:58:44 +0000 (23:58 +0000)]
Merge "RFCOMM: Add more logging on failure cases" into pi-dev
TreeHugger Robot [Fri, 30 Mar 2018 22:48:05 +0000 (22:48 +0000)]
Merge "AVRCP play status change updates" into pi-dev
TreeHugger Robot [Fri, 30 Mar 2018 22:37:51 +0000 (22:37 +0000)]
Merge "AVRCP register for addressed player changed" into pi-dev
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
(cherry picked from commit
4e01c6d5f2d03fb5c98567b573a9dd32d28a4106)
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
(cherry picked from commit
201790818da5b2d5df9120e53be19bbe136b2b1a)
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
(cherry picked from commit
32b23b1d8696b02dbc4b2f8bc93109f62a2bb98d)
TreeHugger Robot [Fri, 30 Mar 2018 17:54:37 +0000 (17:54 +0000)]
Merge "Drop LE CoC fragments when frame size is too big" into pi-dev
Stanley Tng [Thu, 29 Mar 2018 00:12:28 +0000 (17:12 -0700)]
Drop LE CoC fragments when frame size is too big
Drop the LE CoC data fragments when the received fragment size is too
big.
Test: Runs LE CoC SL4A test, BleCocTest.
Bug:
75298652
Change-Id: I529944341e9e67a39e7ec7e740d5ada3db8cc23a
TreeHugger Robot [Thu, 29 Mar 2018 21:11:05 +0000 (21:11 +0000)]
Merge "Serialize the commands during Pairing process" into pi-dev
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
(cherry picked from commit
73c975a7bcdc2f104a35e12f8a98ef6188d77a0d)
Merged-In: 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
(cherry picked from commit
a03a7724d6600723e6bb09fbb56dd37ceb7e8f90)
Merged-In: Ic9a2c8d8cf5dd4c5be02a83975caa92e335ca2b9
TreeHugger Robot [Thu, 29 Mar 2018 17:58:36 +0000 (17:58 +0000)]
Merge "Unpair both transports of dual mode device, when LE address provided" into pi-dev
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 [Wed, 28 Mar 2018 23:54:16 +0000 (23:54 +0000)]
Merge "Revert "HID: Fix the behavior of virtual_cable_unplug"" into pi-dev
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
(cherry picked from commit
f3a00978b5cd838cfb81e8cef04924458b21d05c)
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
(cherry picked from commit
25694ec900e61d5235ee65461d46495b5ae4cdcf)
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
(cherry picked from commit
1a8947a6c0473ea62b229ffba6091b61e19fa904)
TreeHugger Robot [Wed, 28 Mar 2018 02:43:42 +0000 (02:43 +0000)]
Merge "HFP: Save discovered HFP version to config file" into pi-dev
TreeHugger Robot [Wed, 28 Mar 2018 02:16:08 +0000 (02:16 +0000)]
Merge "Fix crash in Log" into pi-dev
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
(cherry picked from commit
79b4e0710b23f9bd96c0fc71d68e6649188b1bde)
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
(cherry picked from commit
eaacbe8f0b82cf05326adf293f07c5cb094e5461)
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
(cherry picked from commit
1c21a92aaada215f432a5e0b5210213a17a2850e)
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
(cherry picked from commit
f8dd02a26b01cdccf5424ff340dc954dd10ee671)
TreeHugger Robot [Mon, 26 Mar 2018 23:54:41 +0000 (23:54 +0000)]
Merge "Add a property to enable the New AVRCP Profile (1/2)" into pi-dev
Ajay Panicker [Mon, 26 Mar 2018 23:10:31 +0000 (23:10 +0000)]
Merge "Implement the JNI layer for the AVRCP Service (2/3)" into pi-dev
Jakub Pawlowski [Mon, 26 Mar 2018 21:23:05 +0000 (21:23 +0000)]
Merge "Fix potential NULL dereference in set_volume" into pi-dev
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
(cherry picked from
60911bea640978984fffb925248e630ea9590a61)
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
(cherry picked from commit
ce1a2b3f8d44a017c13a55b5e53abb51886297ad)
Merged-In: I4aa285c6bf009716cc80a80b813ba0acd3d8f9d8
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
(cherry picked from commit
66401790c29f13b30c15f035933366f36637df21)
Merged-In: I0d9464ea19d3bd382d07134bff057a5515501b95
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
(cherry picked from commit
8e6b9a9760efa5aba116355b4216610e75a54a49)
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
(cherry picked from commit
cf811d66915a6d2c76a7ada2b7f64f0c4014e671)
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
(cherry picked from commit
17d692578102d73bcf30b00442cdd456e92a7912)
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
(cherry picked from commit
61dfe5ccf014aa17cbe800b1195afdb7e474a376)
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
(cherry picked from commit
47efa5b569e8dfa6c4397f0a9598d8137f71a05f)
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
(cherry picked from commit
e445b5b8b9225a882136a1c941cf77055540a554)
TreeHugger Robot [Fri, 23 Mar 2018 07:19:00 +0000 (07:19 +0000)]
Merge "Add btm_free() to clean up btm properly" into pi-dev
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
Merged-In: I74b8c340ee258b09b9e1acbcb1cc75906ddc03fc
(cherry picked from commit
9d73f984efd16d894bd0bcc2bb3a3871778ab898)
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
Merged-In: I6652168f3c48e5b431e00aa8f554929afbdcdbcf
(cherry picked from commit
42c88d1a55ac98b46c757f18c8cb518fd442e649)
TreeHugger Robot [Fri, 23 Mar 2018 01:46:27 +0000 (01:46 +0000)]
Merge "Added Start/End Session steps to A2DP session setup" into pi-dev
TreeHugger Robot [Fri, 23 Mar 2018 00:09:26 +0000 (00:09 +0000)]
Merge "Add the AVRCP Target Service to btif" into pi-dev
TreeHugger Robot [Thu, 22 Mar 2018 22:40:19 +0000 (22:40 +0000)]
Merge "Set the default AVRCP Version to 1.5" into pi-dev
Ajay Panicker [Mon, 12 Mar 2018 23:41:21 +0000 (16:41 -0700)]
Add the AVRCP Target Service to btif
This class provides a management interface for the AVRCP Target Service.
Bug:
68854188
Test: Compiles
Change-Id: Id639ca6530ea986b5d67203f448ae7a0eecc6f8a
(cherry picked from commit
84a282706dd36559012af5f00641133725c57776)
Merged-In: If86210bf3e600dfd641291917c137a0d0764d057
TreeHugger Robot [Thu, 22 Mar 2018 22:26:24 +0000 (22:26 +0000)]
Merge "Add the AVRCP Connection Handler" into pi-dev
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.
Bug:
76161326
Merged-In: I3445a725d66e73e8bcffc7bfabe594f49a6fc863
Change-Id: I3445a725d66e73e8bcffc7bfabe594f49a6fc863
(cherry picked from commit
8a9013350fdf5c5724af6cc93b41b1cc1432ee83)
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
Merged-In: I43702e1ddc108628de93161905465647471f554c
(cherry picked from commit
03adb3f7ba37d637329d3c13aa4a3bb1ec28f143)
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
(cherry picked from commit
c90de7ada786f8e53b8d0b256ac3ac5ba81768c8)
Ajay Panicker [Wed, 28 Feb 2018 04:51:47 +0000 (20:51 -0800)]
Add the AVRCP Connection Handler
This class handles connecting and disconnecting AVRCP Devices as well as
SDP lookups and feature selection.
Bug:
68854188
Test: run_host_unit_tests.py && run_unit_tests.sh net_test_avrcp
Change-Id: I950587123d2875c4333b415c379c7c1fb0c29ca5
(cherry picked from commit
8e521034ded85c26152a18dd591192df3b80d958)
Merged-In: I43720566bc7b96a4796a1f571757f2a8c198be17
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
(cherry picked from commit
b0a9f9f23f7405bc088695e1d91763aced70b9fd)
Ajay Panicker [Tue, 6 Mar 2018 19:16:23 +0000 (11:16 -0800)]
AVRCP: Fix size for Register Notification Response packets
Bug:
68854188
Test: ./run_host_unit_tests.py && ./run_unit_test.sh net_test_btpackets
Change-Id: I62d864e2c27d809944f160dc45906b90cbb84f3d
(cherry picked from commit
142763fa10b721c0d51d7585fc01bf127f5b9e32)
TreeHugger Robot [Thu, 22 Mar 2018 06:26:37 +0000 (06:26 +0000)]
Merge "Write volume to Hearing Aid during connection setup" into pi-dev
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
(cherry picked from commit
a68d747b4e0c0b47c755a86fd9dd94b390205333)
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
(cherry picked from commit
2107aedcf20ba461f3e3289a2d33559413809b1d)
TreeHugger Robot [Mon, 19 Mar 2018 20:45:16 +0000 (20:45 +0000)]
Merge "Don't skip SDP discovery prior to AVDTP connection" into pi-dev
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
(cherry picked from commit
243661fe202b00b56a34dbdd2d80d9eff4951485)
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
(cherry picked from commit
b27aa7ebbf373fe2ddc4d75a19d02c7b3ea5359e)
TreeHugger Robot [Fri, 16 Mar 2018 22:23:16 +0000 (22:23 +0000)]
Merge "Utilize setting for AVRCP Target" into pi-dev
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
(cherry picked from commit
a39e5bfe6eec9571105ec8ce90c705f4281de7fd)
Jakub Pawlowski [Thu, 15 Mar 2018 20:09:33 +0000 (13:09 -0700)]
Remove unnecessary CHECK in BleAdvertisingManager::Get()
It is causing race conditions. Weak pointer is already taking care of
making sure the instance is valid, even if it was not yet initialized.
Bug:
74863151
Test: compilation
Change-Id: Iddb69f8a38d80044d1bdd7699fad020f710914be
(cherry picked from commit
68ef745a3af2fcdee03db4441016e5b5e0039c74)
Jakub Pawlowski [Mon, 5 Mar 2018 22:22:34 +0000 (14:22 -0800)]
Hearing Aid Audio Source 24000 sample rate support
Bug:
69623109
Test: compile, connect to hearing aid
Change-Id: I8751be8b92d2a902407726b6ec7fc1c8ecbcaebb
(cherry picked from commit
c454fe706457048777bb4eb36089e3989964fe5a)
Jakub Pawlowski [Fri, 24 Nov 2017 23:20:37 +0000 (15:20 -0800)]
Hearing Aid Manager implementation
Test: connect to Hearing Aid, play some music, make phone call
Bug:
69623109
Change-Id: I924ce288f1aa28c0d59edffa7a00f90271a808ab
(cherry picked from commit
2c2c78944081b7bedd9fdd06f0dc7e8b4b86bf5e)
Nitin Shivpure [Tue, 13 Mar 2018 06:31:48 +0000 (12:01 +0530)]
SMP: Update device type as BLE while deriving LTK from LK
Usecase:
1) Install the same system version and CtsVerifier.apk on 2 DUT's
2) Pair both DUT's using BT Settings Menu.
3) On DUT execute Bluetooth Test -> Bluetooth LE Secure Server Test ->
Bluetooth LE Sever Test.
4) On remote device execute Bluetooth Test-> Bluetooth LE Secure Client
Test -> Bluetooth LE Client Test
Expected Result:
All test cases can be passed.
Observed Result:
All test cases cannot be passed.
Root Cause:
DUT supports secure connection & LE privacy and during BR/EDR pairing LTK is
derived from LK, but device type is not updated and is still BR/EDR instead of LE.
Later when Gatt server starts advertisement with random address so while creating
LE connection from gatt client to gatt server, gatt client is not able to resolve
random address due to incorrect device type, It re-initiate LE paring with
gatt server.
Fix:
Updating device type as BLE while deriving LTK from LK.
Test: CTS test case can pass with above steps.
Fixes:
74728232
Change-Id: I1f2c5b54d17a58615f7c2ceb954e54619b165489
Jakub Pawlowski [Wed, 14 Mar 2018 18:41:08 +0000 (11:41 -0700)]
Eliminate error on quallcom debug logs from controller
Bug:
74858307
Change-Id: If975a5d76d42e6142534e87fd63b30f9ce8894d8
(cherry-picked from
9ed8697aaf24891b27951a7cb260ca3aceea2db8)
TreeHugger Robot [Wed, 14 Mar 2018 17:50:34 +0000 (17:50 +0000)]
Merge "Suppress AVDTP delay reporting logs per data packet" into pi-dev
TreeHugger Robot [Wed, 14 Mar 2018 16:58:54 +0000 (16:58 +0000)]
Merge "BLE: Don't access freed buffer in log message" into pi-dev
Pavlin Radoslavov [Wed, 14 Mar 2018 07:54:08 +0000 (00:54 -0700)]
Suppress AVDTP delay reporting logs per data packet
If AVDTP delay reporting is enabled, then several log messages
will be printed by default practically for each audio data packet.
Change the log level for those messages to DEBUG.
Also:
* Add missing event decoding for A2DP_CTRL_GET_PRESENTATION_POSITION
* Remove "default" switch statement inside audio_a2dp_hw_dump_ctrl_event()
to catch missing "case" statements if a new tA2DP_CTRL_CMD event is
added in the future.
Bug:
32755225
Test: Manual - A2DP streaming, check the logcat output
Change-Id: I3d1b1c2f6532c72af0e1e7aa5566572e13ed1684
(cherry picked from commit
3d60c4b14ba1e89719b09da3f2c4208c553a6f3c)
Nitin Shivpure [Tue, 6 Feb 2018 12:48:37 +0000 (18:18 +0530)]
BLE: Don't access freed buffer in log message
When GATT fail to write data on L2CAP, buffer is freed by L2CAP.
Accessing the buffer leads to fatal failure while printing the message info.
Test: BLE discover services and BT off test cases
Fixes:
73018520
Change-Id: I661398fd1321f6e68026b3720db4965fd6584d70
(cherry picked from commit
109b4980daca07798f6290b0d2bff20e7590b8c0)
Stanley Tng [Tue, 6 Mar 2018 18:56:12 +0000 (10:56 -0800)]
Fix crash in l2c_rcv_acl_data during LE CoC SL4A Test
When the incoming ACL messages is not setup yet, we should not further
processed it after we queue it. Otherwise, we will get be accessing the
null data structure for the connection.
Bug:
74240858
Test: Run SL4A test: act.py -c $MY_SL4A_CONFIG -tc BleCocTest:test_coc_secured_connection_throughput
Change-Id: I12e6d5dd30f05a74807afe6b4af1b9599c59886a
(cherry picked from commit
38d25bb3e41ac90ceab8052a3829f46d2925ee6a)
Petri Gynther [Tue, 13 Mar 2018 02:00:33 +0000 (02:00 +0000)]
Merge "A2DP Offload support" into pi-dev
TreeHugger Robot [Mon, 12 Mar 2018 21:08:59 +0000 (21:08 +0000)]
Merge "Enable AVDTP Delay reports by default." into pi-dev
Sunny Kapdi [Tue, 13 Feb 2018 05:52:50 +0000 (21:52 -0800)]
A2DP Offload support
The encoding of the A2DP data packets if offloaded
to platform specific HAL. The communication with the
HAL is enabled by IBluetoothAudioOffload and
IBluetoothAudioHost interfaces. Bluetooth stack is
still responsible for A2DP control path.
Bug:
63932139
Bug:
72242910
Test: Manual; TestTracker/148125
Change-Id: Ie6e9c233ca431d0ab8cf15d10c30836e41bbdcb7
(cherry picked from commit
c013d10798f674fd4a73f03b9178952928294b1e)
TreeHugger Robot [Sat, 10 Mar 2018 01:48:22 +0000 (01:48 +0000)]
Merge "Get rid of BTM_IS_PUBLIC_BDA" into pi-dev
Jakub Pawlowski [Fri, 9 Mar 2018 04:11:41 +0000 (20:11 -0800)]
Get rid of BTM_IS_PUBLIC_BDA
One can't really guess address type based on last bits.
Instead, for new devices always assume public address.
Test: scan, toggle bluetooth, try connecting to device with public
address
Bug:
74413120
Change-Id: Id558260798e717c214a5a817cea0c204c5f4858e
(cherry-picked from
8c2e78b44727789d641492beeef873b230c7e568)
Ajay Panicker [Wed, 7 Mar 2018 23:22:29 +0000 (15:22 -0800)]
Enable AVDTP Delay reports by default.
Bug:
32755225
Test: See that delay reports are enabled when connecting to device
Change-Id: I03bd216eb1725ee3e2e5da4e0baae61007ba2dcf
(cherry picked from commit
621fc6c06ed3804285901668ee678acd65e0a5fb)
Jakub Pawlowski [Wed, 7 Mar 2018 00:31:41 +0000 (16:31 -0800)]
Add missing audio_hearing_aid_hw in Android.bp
Bug:
69623109
Test: compile, verify audio.hearing_aid.default is built
Change-Id: Ia246a6b7b026d1e6d698e9a7832ead0e584b621d
(cherry-picked from
c1d4b29d58e4944002baeeff4cf19233592df638)
TreeHugger Robot [Wed, 7 Mar 2018 17:47:27 +0000 (17:47 +0000)]
Merge "Use proper sockets for A2DP and Hearing Aid HAL" into pi-dev
Pavlin Radoslavov [Tue, 6 Mar 2018 22:44:27 +0000 (14:44 -0800)]
Precompute the RTP Header marker bit only for A2DP Source encoder
The RTP Header marker bit is used only by the A2DP Source encoder,
and should be computed only when the local device is A2DP Source.
Test: Manual - disconnect, reconnect A2DP headset, play Audio
Bug:
74250013
Change-Id: I6510eeb9a34397e6623e5bc36675fc833b96ad7d
(cherry picked from commit
97390c0ea9eff71c3959989142c3eaeb243837a0)
Jack He [Sat, 3 Mar 2018 08:03:25 +0000 (00:03 -0800)]
Metrics: Move bluetooth.proto to one place
* Move bluetooth.proto to proto/ and compile it for both Java LITE
runtime and C++ LITE runtime so that it can be shared between Java
and native code
* Remove redundant comments in bluetooth.proto
Bug:
33693818
Test: make, toggle Bluetooth, clearcut server-client E2E test
adb shell dumpsys bluetooth_manager --proto-bin
ACTS tests: BtMetricsTest, BtFunhausMetricsTest
Change-Id: I7cd5e1b4fb8fcc197272ef8161ff384e53022424
(cherry picked from commit
8948b090088330d4ad12cd550986465228d20965)
Jakub Pawlowski [Fri, 2 Mar 2018 10:22:33 +0000 (02:22 -0800)]
Use proper sockets for A2DP and Hearing Aid HAL
Test: bond both Hearing Aid and Headset, try to stream to devices separately
Bug:
69623109
Change-Id: I81c9baa65d2ef114d4e964db29beb85def2629ae
(cherry picked from commit
16a63404814c4b1bcf2de6e1a624b5bd8b6b1cf6)
TreeHugger Robot [Sun, 4 Mar 2018 04:32:13 +0000 (04:32 +0000)]
Merge "SMP: Validate remote elliptic curve points"
Ajay Panicker [Sat, 3 Mar 2018 03:28:16 +0000 (03:28 +0000)]
Merge "Add the AVRCP Device class for the AVRCP Refactor" am:
d96facb53f am:
0ac07842dd
am:
81c4e9c7ad
Change-Id: I0355b01e47ae00eab39635327da3027307cb4908
Ajay Panicker [Sat, 3 Mar 2018 03:18:50 +0000 (03:18 +0000)]
Merge "Add the AVRCP Device class for the AVRCP Refactor" am:
d96facb53f
am:
0ac07842dd
Change-Id: Id2ed7bcdd84698ec07673dc911903077fe4ed479
Ajay Panicker [Sat, 3 Mar 2018 03:15:21 +0000 (03:15 +0000)]
Merge "Add the AVRCP Device class for the AVRCP Refactor"
am:
d96facb53f
Change-Id: I30e6a4eb6b1fa305bfc02df71022ca0d8f9565b2
Treehugger Robot [Sat, 3 Mar 2018 02:32:56 +0000 (02:32 +0000)]
Merge "Add the AVRCP Device class for the AVRCP Refactor"
Hansong Zhang [Sat, 3 Mar 2018 00:53:59 +0000 (00:53 +0000)]
HearingAidAudioSource implementation am:
be754da679 am:
e9dcaa3d80
am:
eb3aeaaa5a
Change-Id: Ic35d9539de5cbf8e9fecacc08610afeaef46ad73
Jakub Pawlowski [Sat, 3 Mar 2018 00:46:21 +0000 (00:46 +0000)]
Merge "Keep UIPC in local variable, rather than global struct." am:
80086efc10 am:
57b9b3da98
am:
c8d395a371
Change-Id: Id99ea80a12ecf223865bd6081ec28c2a3d4ad6af
Hansong Zhang [Sat, 3 Mar 2018 00:38:48 +0000 (00:38 +0000)]
HearingAidAudioSource implementation am:
be754da679
am:
e9dcaa3d80
Change-Id: I305f5dd1175fcb68f1f76f9932ac4791615a48fe
Jakub Pawlowski [Sat, 3 Mar 2018 00:33:56 +0000 (00:33 +0000)]
Merge "Keep UIPC in local variable, rather than global struct." am:
80086efc10
am:
57b9b3da98
Change-Id: I3f276195258d503072a4b3d7876e95fa349e782e
Hansong Zhang [Sat, 3 Mar 2018 00:24:10 +0000 (00:24 +0000)]
HearingAidAudioSource implementation
am:
be754da679
Change-Id: Ib20c46f34578b77f6541963714080aa115fb9775
Jakub Pawlowski [Sat, 3 Mar 2018 00:09:02 +0000 (00:09 +0000)]
Merge "Keep UIPC in local variable, rather than global struct."
am:
80086efc10
Change-Id: I61c460adbdf6fc653599894f1a11469647d7467d
Hansong Zhang [Fri, 19 Jan 2018 20:23:57 +0000 (12:23 -0800)]
HearingAidAudioSource implementation
Test: none
Bug:
69623109
Change-Id: Iaadd337ed5a8152db54b7515d55e0358f413f937
Andre Eisenbach [Thu, 1 Mar 2018 21:27:01 +0000 (13:27 -0800)]
SMP: Validate remote elliptic curve points
Fixes:
72377774
Test: net_test_stack_smp
Change-Id: Iefcf97364493467075fadefd77d12716f71cd4f6
Treehugger Robot [Fri, 2 Mar 2018 19:05:58 +0000 (19:05 +0000)]
Merge "Keep UIPC in local variable, rather than global struct."
Jakub Pawlowski [Fri, 2 Mar 2018 17:26:27 +0000 (17:26 +0000)]
Add new sample rate BTAV_A2DP_CODEC_SAMPLE_RATE_24000 am:
bd39c6ee08 am:
26ff71d81c
am:
1d615f337a
Change-Id: I0b7fbf4917c0ff32c7bbbf0f00d80b355d6fb7bf
Jakub Pawlowski [Fri, 2 Mar 2018 17:20:23 +0000 (17:20 +0000)]
Add new sample rate BTAV_A2DP_CODEC_SAMPLE_RATE_24000 am:
bd39c6ee08
am:
26ff71d81c
Change-Id: I74ebdd66a1ea995acdab7ac877f44d3fb324a5ff
Jakub Pawlowski [Fri, 2 Mar 2018 17:14:20 +0000 (17:14 +0000)]
Add new sample rate BTAV_A2DP_CODEC_SAMPLE_RATE_24000
am:
bd39c6ee08
Change-Id: I0637185dd3175f307f50cca156d99d4543d8d97b