OSDN Git Service

android-x86/system-bt.git
5 years agoMerge "Add stng@google.com to the OWNERS list"
Treehugger Robot [Tue, 18 Dec 2018 21:11:28 +0000 (21:11 +0000)]
Merge "Add stng@google.com to the OWNERS list"

5 years agoMerge "Add a host test for net_test_avrcp"
Treehugger Robot [Tue, 18 Dec 2018 19:05:15 +0000 (19:05 +0000)]
Merge "Add a host test for net_test_avrcp"

5 years agoMerge "Make sure Hearing Aids' Connection Intervals is unchanged"
Treehugger Robot [Tue, 18 Dec 2018 17:04:26 +0000 (17:04 +0000)]
Merge "Make sure Hearing Aids' Connection Intervals is unchanged"

5 years agoAdd stng@google.com to the OWNERS list
Stanley Tng [Tue, 28 Aug 2018 23:06:55 +0000 (16:06 -0700)]
Add stng@google.com to the OWNERS list

Test: N/A
Change-Id: Ic164086fc97fa72aa68ad751b35f339fa71233bb

5 years agoMake sure Hearing Aids' Connection Intervals is unchanged
Stanley Tng [Fri, 14 Dec 2018 01:31:31 +0000 (17:31 -0800)]
Make sure Hearing Aids' Connection Intervals is unchanged

Make sure that the connection interval of the LE Connection remains the
desired one and reset it if this interval gets changed.

Test: Manual with Hearing Aids device and repeated
connection/disconnection
Bug: 117886712
Change-Id: Id11d1d2e7901bfbbc9c452b94aba968afbc52ee0

5 years agoAdd a host test for net_test_avrcp
Dan Shi [Sat, 15 Dec 2018 01:17:40 +0000 (17:17 -0800)]
Add a host test for net_test_avrcp

Bug: 111921389
Test: atest
Change-Id: I26e4036bb76271ac6181429c904efe0f8b438256

5 years agoMerge "List test_config_template to android platform only."
Dan Shi [Sat, 15 Dec 2018 01:03:29 +0000 (01:03 +0000)]
Merge "List test_config_template to android platform only."

5 years agoList test_config_template to android platform only.
Dan Shi [Fri, 14 Dec 2018 17:56:36 +0000 (09:56 -0800)]
List test_config_template to android platform only.

This allows host side test config to be auto-generated from the right
template.

Bug: 120993548
Test: m -j net_test_avrcp && atest net_test_avrcp --host
Change-Id: I003713ea3c1c4c1c0686551828d817227ec19019

5 years agoUse White List for direct connection establishment to multiple devices
Jakub Pawlowski [Wed, 14 Nov 2018 15:15:04 +0000 (16:15 +0100)]
Use White List for direct connection establishment to multiple devices

Currently, we implement GAP Direct Connect procedure exactly as the spec
says: we attempt connection to just one device.

This means that an app doing Direct Connection can take over the ability
to establish connections, and if it repeats the request, can cause other
devices to not connect.

From now on, we will use White List for both Background and Direct
connections. When there is at least one direct connection, we will
increase the scan parameters used for connection.

Bug: 112827989
Test: added unittests, also sl4a GattConnectTest
Change-Id: Ic0b2f631e3c84d5e8e0f4683b0148f031bfd5639

5 years agoRemove unused battery level support
Jakub Pawlowski [Thu, 13 Dec 2018 23:27:11 +0000 (00:27 +0100)]
Remove unused battery level support

Change-Id: I88239a835562a5e3c32b830e4c2c31fed1f107b3

5 years agoMerge "Remove redundant GATT_StartIf"
Jakub Pawlowski [Fri, 14 Dec 2018 08:40:04 +0000 (08:40 +0000)]
Merge "Remove redundant GATT_StartIf"

5 years agoRemove redundant GATT_StartIf
Jakub Pawlowski [Thu, 13 Dec 2018 16:53:15 +0000 (17:53 +0100)]
Remove redundant GATT_StartIf

GATT_StartIf is just sending connect callback about all currently
connected devices, even ones that this app is not interested in.

For btif/java apps, we will trigger connection attempt to just one
device right after registration, which would trigger connect callback
anyway.

For all bta layer apps, they do guard inside connect callback to make
sure code is triggered for already known device, but the devices are
considered as known only after they already connected, and some event
triggered app to create control block.

Thus, GATT_StartIf is surplus feature that should be removed.

Test: run all sl4a GATT tests
Change-Id: I8c45b92dbbf80894c32bb870eb392e766063c934

5 years agoMerge "Pass package name as a part of startDiscovery"
Treehugger Robot [Thu, 13 Dec 2018 12:42:58 +0000 (12:42 +0000)]
Merge "Pass package name as a part of startDiscovery"

5 years agoMerge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"
Treehugger Robot [Thu, 13 Dec 2018 05:45:20 +0000 (05:45 +0000)]
Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master"

5 years agoPass package name as a part of startDiscovery
Zach Johnson [Thu, 13 Dec 2018 01:13:29 +0000 (17:13 -0800)]
Pass package name as a part of startDiscovery

Test: manual
Bug: 118347252
Change-Id: I52adf73009a9766ad9aabf41657187343a2d0f41

5 years agoFix performance-for-range-copy warnings
Chih-Hung Hsieh [Wed, 12 Dec 2018 22:30:52 +0000 (14:30 -0800)]
Fix performance-for-range-copy warnings

Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I7d5537c24c39d5c42ac17c8a67646e4b9321d6bb

5 years agoTurn stack/gatt/conneciton_manager.cc into text file
Jakub Pawlowski [Tue, 11 Dec 2018 20:53:58 +0000 (21:53 +0100)]
Turn stack/gatt/conneciton_manager.cc into text file

Change-Id: I031bfaa1745de55aeb0a0dbde3a7a67be0f9c982

5 years agoMerge changes I7f8b5cfd,I68d65028
Treehugger Robot [Wed, 12 Dec 2018 05:05:27 +0000 (05:05 +0000)]
Merge changes I7f8b5cfd,I68d65028

* changes:
  test_vendor: Add PacketBuilder classes
  test_vendor: Add PacketView for copyless parsing

5 years agoDO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Xin Li [Tue, 11 Dec 2018 22:45:08 +0000 (14:45 -0800)]
DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master

Bug: 120502534
Change-Id: Icdcf2220fd28f92b182da73bee207151e80db295

5 years agoMerge "OWNERS -eisenbach, +zachoverflow"
Zach Johnson [Tue, 11 Dec 2018 04:21:52 +0000 (04:21 +0000)]
Merge "OWNERS -eisenbach, +zachoverflow"

5 years agotest_vendor: Add PacketBuilder classes
Myles Watson [Wed, 14 Nov 2018 00:56:38 +0000 (16:56 -0800)]
test_vendor: Add PacketBuilder classes

Templated PacketBuilder class for inserting fixed width
types with the correct endianness.

Test: rootcanal-packets_test_host --gtest_filter=*PacketBuilderEndian*
Change-Id: I7f8b5cfd225ebae35f310b44fc0782b940a23007

5 years agotest_vendor: Add PacketView for copyless parsing
Myles Watson [Wed, 7 Nov 2018 20:10:46 +0000 (12:10 -0800)]
test_vendor: Add PacketView for copyless parsing

A View is holds bounds and a shared pointer.
A PacketView is a forward list of View, templated for endianness.
A BaseIterator iterates over PacketViews.
An Iterator is a BaseIterator with extract, which is templated for endianness.

Test: rootcanal-packets_test_host
Change-Id: I68d6502861be61f411c0f5f2da33ead3d2392694

5 years agoOWNERS -eisenbach, +zachoverflow
Andre Eisenbach [Tue, 4 Sep 2018 17:17:20 +0000 (10:17 -0700)]
OWNERS -eisenbach, +zachoverflow

5 years agoFix GATT not working due to address mismatch
Jakub Pawlowski [Thu, 6 Dec 2018 18:32:37 +0000 (19:32 +0100)]
Fix GATT not working due to address mismatch

If the initial connection is established when using RPA, device can
later decide to use it's Identity Address for reconnections, if it
doesn't care about privacy.
When we receive such Identity Address, we must translate it into pseudo
address before passing it further down the stack.

Test: Connect to device using RPA, try to reconnect when it advertise
      it's Public address
Change-Id: Icb8eed25e1aad7003f1a3e0fed684168a8344544

5 years agoConfig: Reduce LOG(WARNING) to VLOG(1) when config key is not found
Jack He [Fri, 7 Dec 2018 21:58:12 +0000 (13:58 -0800)]
Config: Reduce LOG(WARNING) to VLOG(1) when config key is not found

Fixes: 120495903
Test: make
Change-Id: I724b8883ea400ed3c79fe31b75f1e2aa65b45b4d

5 years agoMerge "Preserve x18 while calling aptX encoder libraries."
Peter Collingbourne [Fri, 7 Dec 2018 00:47:06 +0000 (00:47 +0000)]
Merge "Preserve x18 while calling aptX encoder libraries."

5 years agoPreserve x18 while calling aptX encoder libraries.
Peter Collingbourne [Mon, 19 Nov 2018 20:58:18 +0000 (12:58 -0800)]
Preserve x18 while calling aptX encoder libraries.

Shadow call stack (SCS) is a security mitigation that uses a
separate stack (the SCS) for return addresses. In versions of
Android newer than P, the compiler normally cooperates with the
system to ensure that the SCS address is always stored in register
x18. This requires that everything in a process that uses SCS is
built with -ffixed-x18. However, two libraries (libaptX_encoder.so
and libaptXHD_encoder.so) are supplied in binary format and were
not compiled with -ffixed-x18. We are working with the vendor to get
these libraries rebuilt with -ffixed-x18, but until then, we need to
prevent this library from clobbering x18 so that we can turn on SCS
in the Bluetooth process.

Bug: 112907825
Bug: 120621517
Change-Id: Id27829ed5696903c42b4aeb75c3b3880c97a3a36

5 years agoMerge "Hearing Aid: Add clear conn_id and close ctrl UIPC when BT turn off"
Treehugger Robot [Thu, 6 Dec 2018 02:43:24 +0000 (02:43 +0000)]
Merge "Hearing Aid: Add clear conn_id and close ctrl UIPC when BT turn off"

5 years agoMerge "Enable bounds sanitization in Bluetooth."
Ivan Lozano [Wed, 5 Dec 2018 23:38:16 +0000 (23:38 +0000)]
Merge "Enable bounds sanitization in Bluetooth."

5 years agoMerge "Group BR-EDR related SDP variables under transport"
Treehugger Robot [Wed, 5 Dec 2018 22:04:09 +0000 (22:04 +0000)]
Merge "Group BR-EDR related SDP variables under transport"

5 years agoMetrics: Fix a typo in log
Jack He [Tue, 4 Dec 2018 22:30:28 +0000 (14:30 -0800)]
Metrics: Fix a typo in log

Test: make
Change-Id: I92a49c62ebf13d8da7f13b39c426d0eb14a83db6

5 years agoMerge PQ1A.181205.006 from Pi-QPR1-Release into ToT for Pi-Platform release.\n\nBUG...
Bill Rassieur [Tue, 4 Dec 2018 17:00:02 +0000 (17:00 +0000)]
Merge PQ1A.181205.006 from Pi-QPR1-Release into ToT for Pi-Platform release.\n\nBUG: 120448245

Change-Id: I39b32c98eac813e96ba19087a27c97d0da02ab5e

5 years agoGroup BR-EDR related SDP variables under transport
Srinu Jella [Thu, 11 Feb 2016 14:17:39 +0000 (19:47 +0530)]
Group BR-EDR related SDP variables under transport

Use Case: Random RNR initiated after HOGP Keyboard disconnection

steps:
1. keep madcatz in advertisement mode and scan, pair from DUT.
2. keep dailog Keyboard in advertisement mode and scan, pair from DUT.
3. Take Keyboard out of range to initiate disconnection from remote
or initiate disconnection from remote.

Failure: DUT trying to do RNR to random device.

Root Cause: when the disconnection happened for LE device, it sets
the wait_disc to true, that is causing random RNR to go for BR-EDR
device.

Fix: Group all BR-EDR related SDP variables under transport check
so that if some other operation on LE will not corrupt these BR-EDR
variables to mislead.

Test: code compilation.
Bug: 69031582
Change-Id: Ic9003f2b85bbaaa30b201b8a639a9d9b52055ac5

5 years agoSplit Timer into OnceTimer and RepeatingTimer
Jakub Pawlowski [Mon, 3 Dec 2018 15:50:40 +0000 (16:50 +0100)]
Split Timer into OnceTimer and RepeatingTimer

Follow the naming convention in libbase, where Callback was split into
OnceCallback, and RepeatingCallback, to make it obvious how many times
callback is expected to be called.

Test: unit tests were split from TimerTest into OnceTimerTest and
RepeatingTimerTest
Bug: 110303473
Change-Id: Ibbb9bb74a2e6e1a0f0f74c6ec44f63c5a4a1537f

5 years agoHearing Aid: Add clear conn_id and close ctrl UIPC when BT turn off
weichinweng [Tue, 27 Nov 2018 05:47:25 +0000 (13:47 +0800)]
Hearing Aid: Add clear conn_id and close ctrl UIPC when BT turn off

* On some condition, BT will stay on BLE_ON state when BT turn off. For
the case, Hearing Aid should be correctly disconnected and ctrl UIPC
close until next BT turn on.
* This CL add clear BtaGATTQueue and Close GATTC to make sure Queue
clean and HA enter disconnected state. And don't restart ctrl UIPC if
HearingAid is shutdown.

Bug: 118803637
Test: make, BT off/on when play A2DP and an app registered.
Change-Id: I1c52307637ee6b34222de9308dcfe1392ad170e8

5 years agoTest: Save SSR dump after test
Jack He [Fri, 30 Nov 2018 00:51:22 +0000 (16:51 -0800)]
Test: Save SSR dump after test

* Save SSR dump from /data/vendor/ssrdump after test invocation

Bug: 120098494
Test: atest :postsubmit
Change-Id: Iafc1666c8cc9fbc7f69b909be630b3d0c1445fe4

5 years agoMerge "Metrics: Add Bluetooth address obfuscator"
Treehugger Robot [Fri, 30 Nov 2018 07:59:20 +0000 (07:59 +0000)]
Merge "Metrics: Add Bluetooth address obfuscator"

5 years agoMerge "Assert if alarm callback is null"
Treehugger Robot [Fri, 30 Nov 2018 01:58:17 +0000 (01:58 +0000)]
Merge "Assert if alarm callback is null"

5 years agoMetrics: Add Bluetooth address obfuscator
Jack He [Fri, 16 Nov 2018 10:59:43 +0000 (02:59 -0800)]
Metrics: Add Bluetooth address obfuscator

* Add an address obfuscator that takes a 256-bit randomly generated
  salt and hashes a Bluetooth MAC address using HMAC-SHA256 algorithm
* The salt is generated per Android device during the first time
  Fluoride native layer is initialized after a connectivity reset
* The output of the above operation is an unique identifier for a
  Bluetooth device on the same Android device, but yet remains
  anonymous across different Android devices.
* Add a logging method loghex(std::array) that allows dumping integral
  arrays into a hex string
* Add more error logging to btif_config_get_bin() so that we know why it
  fails in the future
* Change mutex in btif_config to recursive_mutex to avoid deadlock when
  calling btif_config API functions with API function

Bug: 112969790
Test: mm -j40, bluetooth_test_common
Change-Id: I11f01cc82fe805c97fd7c86ad83b3d324ee5af53

5 years agoAssert if alarm callback is null
Stanley Tng [Mon, 26 Nov 2018 22:44:38 +0000 (14:44 -0800)]
Assert if alarm callback is null

Crash the system when callback is null. This will help to identify and debug the problem. Previously, we got a CFI crash which is hard to isolate.

Test: Run with Hearing Aids but did not simulate the error condition
Bug: 119533256
Change-Id: I9bc2af7c3c405bea3a57c5feb9b213614484507f

5 years agoMerge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release
Bill Yi [Thu, 29 Nov 2018 02:35:03 +0000 (18:35 -0800)]
Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release

Change-Id: I2a349df7ad02b6b57044fe77d92b329e1a5afda0

5 years agoAllow Resolvable Private Address into LE White List
Jakub Pawlowski [Thu, 15 Nov 2018 22:22:21 +0000 (23:22 +0100)]
Allow Resolvable Private Address into LE White List

When doing background connection, we don't want to put RPA into the
white list, as it might expire in 15 minutes.
For direct connect procedure, RPA is ok - the request times out after 30
seconds.

This patch moves address type check from the White List to the background
connection procedure. It is prepearation for handling direct connect
with white list.

Bug: 112827989
Test: sl4a GattConnectTest
Change-Id: I907ad44d1d255c9212ed58112bb8b99464e46f43

5 years agoCentralize call to gatt_update_app_use_link_flag for GATT_Connect
Jakub Pawlowski [Tue, 13 Nov 2018 17:31:08 +0000 (18:31 +0100)]
Centralize call to gatt_update_app_use_link_flag for GATT_Connect

Currently both code paths, doing direct and background connection, call
gatt_update_app_use_link_flag. Move this call to common code.

Bug: 112827989
Test: sl4a GattConnectTest
Change-Id: I5d55f6467ffca78ff785ecdad02dd049ea5481bf

5 years agoMerge "Prevent potential deadlock in Hearing Aids"
Treehugger Robot [Wed, 21 Nov 2018 20:52:18 +0000 (20:52 +0000)]
Merge "Prevent potential deadlock in Hearing Aids"

5 years agoMerge "HFP: Send caller ID in +CLIP command (3/4)"
Treehugger Robot [Wed, 21 Nov 2018 20:21:19 +0000 (20:21 +0000)]
Merge "HFP: Send caller ID in +CLIP command (3/4)"

5 years agoMerge "btsock_signaled: provide debugging info for crash"
Treehugger Robot [Wed, 21 Nov 2018 19:51:32 +0000 (19:51 +0000)]
Merge "btsock_signaled: provide debugging info for crash"

5 years agoMerge "btif_av: remove dead code"
Treehugger Robot [Wed, 21 Nov 2018 19:04:36 +0000 (19:04 +0000)]
Merge "btif_av: remove dead code"

5 years agobtif_av: remove dead code
Hansong Zhang [Wed, 21 Nov 2018 00:04:18 +0000 (16:04 -0800)]
btif_av: remove dead code

Test: manual
Change-Id: I8b172ec2235ae5847f073f8d50ad71761bc37d02

5 years agoPrevent potential deadlock in Hearing Aids
Stanley Tng [Fri, 16 Nov 2018 19:34:28 +0000 (11:34 -0800)]
Prevent potential deadlock in Hearing Aids

Prevent a potential deadlock when calling the main thread but the main
thread is not running.

Bug: 117619792
Test: Manual test to make sure no regression
Change-Id: I6e001533144827b17b88547671765f790ed771bd

5 years agoMerge "Remove unused BTM_BleSetAdvParams"
Treehugger Robot [Tue, 20 Nov 2018 21:13:35 +0000 (21:13 +0000)]
Merge "Remove unused BTM_BleSetAdvParams"

5 years agoRemove unused BTM_BleSetAdvParams
Jakub Pawlowski [Tue, 20 Nov 2018 11:14:10 +0000 (12:14 +0100)]
Remove unused BTM_BleSetAdvParams

Test: compilation
Change-Id: I5797a16b3fd92c5ffa1ad1fd048699a591fd1e4c

5 years agoLinux tests build fix
Jakub Pawlowski [Tue, 20 Nov 2018 18:27:11 +0000 (19:27 +0100)]
Linux tests build fix

Test: compile on Linux using ninja
Change-Id: I180679a7a6f12abe83db0480d9007ebdfdf1d451

5 years agoFix an error in pure virtual function in earlier CL
Stanley Tng [Wed, 7 Nov 2018 20:50:37 +0000 (12:50 -0800)]
Fix an error in pure virtual function in earlier CL

The earlier CL "Fix Spurious Hearing Aid Start and Stop Cmds" is missing
this "=0" to make the virtual function pure. This CL fixes this
oversight.

Test: Compile
Bug: 117619792

Change-Id: Id9e72b8d93f9671c08a613ecb43b4121662770a0

5 years agobtsock_signaled: provide debugging info for crash
Hansong Zhang [Thu, 15 Nov 2018 23:37:12 +0000 (15:37 -0800)]
btsock_signaled: provide debugging info for crash

Test: manual
Bug: 68108403
Change-Id: I89cfc15787f51594535e1e0c00e7a18a317a5d81

5 years agoDump gatt::connection_manager state into bugreport
Jakub Pawlowski [Tue, 13 Nov 2018 14:41:42 +0000 (15:41 +0100)]
Dump gatt::connection_manager state into bugreport

Knowing what's in the white list is useful for debugging.

Bug: 112827989
Test: adb bugreport, verify content.
Change-Id: I195d1ee2fe277f0f0ef534c73f7a964c5f5e61b6

5 years agoUse map instead of list for keeping apps interested in connection
Jakub Pawlowski [Sat, 10 Nov 2018 15:45:35 +0000 (16:45 +0100)]
Use map instead of list for keeping apps interested in connection

Bug: 112827989
Test: BleGattConnectionManager
Change-Id: I7b7ea608f5e27a9f17141ccec0c5d5c06bb22e60

5 years agoFirst tests for connection management
Jakub Pawlowski [Fri, 9 Nov 2018 13:41:01 +0000 (14:41 +0100)]
First tests for connection management

Test: added in this CL
Change-Id: Id3937530e1b0a16c056ae48face78b18c6ec32f0

5 years agointroduce gatt::connection_manager::get_apps_connecting_to
Jakub Pawlowski [Fri, 9 Nov 2018 17:40:04 +0000 (18:40 +0100)]
introduce gatt::connection_manager::get_apps_connecting_to

This is to clean up the interface, and don't expose internal control
structures.

Test: compilation
Change-Id: Id2afc5efb4c14be0b787cfabbe21fc1961381cb7

5 years agoNaming cleanup in stack/gatt/connection_manager.*
Jakub Pawlowski [Fri, 9 Nov 2018 11:42:32 +0000 (12:42 +0100)]
Naming cleanup in stack/gatt/connection_manager.*

Test: compilation
Change-Id: Ic73632cb258515856b9ae5616ec47881b4b28c61

5 years agogatt_utils_white_list -> connection_manager
Jakub Pawlowski [Fri, 9 Nov 2018 10:53:11 +0000 (11:53 +0100)]
gatt_utils_white_list -> connection_manager

Test: compilation
Change-Id: Ib6741ddd8332ff70efd47a8ede0176d887743ff4

5 years agoMerge "AVRCP: Change notification variable when the interim response is sent"
Treehugger Robot [Fri, 9 Nov 2018 02:57:12 +0000 (02:57 +0000)]
Merge "AVRCP: Change notification variable when the interim response is sent"

5 years agoEnable bounds sanitization in Bluetooth.
Ivan Lozano [Fri, 28 Sep 2018 18:23:51 +0000 (11:23 -0700)]
Enable bounds sanitization in Bluetooth.

This enables UBSan bounds sanitization in our bluetooth modules.
This adds run-time bounds checks where the compiler can statically
determine the array bounds.

Bug: 116517182
Test: Pairing devices, playing audio, sharing files.
Change-Id: I9a3ac98aaa6092ac0ad8d1ba080a76b3203bdb26

5 years agoAVRCP: Change notification variable when the interim response is sent
Ajay Panicker [Tue, 26 Jun 2018 21:52:56 +0000 (14:52 -0700)]
AVRCP: Change notification variable when the interim response is sent

This avoids the possibility of having a changed notification be sent
before an interim response is sent when the AVRCP service has to wait
for a response from the media layer for information regarding the
notification.

Also fix the PlayPosition test for AVRCP as it was testing for play
state correctness.

Bug: 109588762
Test: Run host test net_test_avrcp
Change-Id: Icb7bb1068191ecf2a2e390854084b6b9b47537fa
(cherry picked from commit 2d87908fe8825245dcc2e1dbde027331f1e2371d)

5 years agoMinor style fixes in gatt_main.cc
Jakub Pawlowski [Thu, 8 Nov 2018 18:54:49 +0000 (19:54 +0100)]
Minor style fixes in gatt_main.cc

Test: compilation
Change-Id: I446b9e83603e7224abe1eddd030b4502cc7dceb5

5 years agoMerge "Add code coverage report support to Bluetooth"
Treehugger Robot [Thu, 8 Nov 2018 22:02:48 +0000 (22:02 +0000)]
Merge "Add code coverage report support to Bluetooth"

5 years agoHFP: Send caller ID in +CLIP command (3/4)
Benson Li [Tue, 17 Jul 2018 10:05:16 +0000 (18:05 +0800)]
HFP: Send caller ID in +CLIP command (3/4)

* Append caller display name in ag_reslut data if there is name in
  CALL_STATE_INCOMING state
* Process all clip data and store the formatted string to ag_result
  data

Bug: 111378831
Test: runtest bluetooth, runtest -x BluetoothPhoneServiceTest.java
Change-Id: Ief48ed9cb5e0b32274624a90799ab9922dbd656e

5 years agoMerge "HFP: Don't use mSBC for HF devices not supporting related feature"
Treehugger Robot [Thu, 8 Nov 2018 08:43:27 +0000 (08:43 +0000)]
Merge "HFP: Don't use mSBC for HF devices not supporting related feature"

5 years agoFix Spurious Hearing Aid Start and Stop Cmds
Stanley Tng [Sun, 14 Oct 2018 04:17:00 +0000 (21:17 -0700)]
Fix Spurious Hearing Aid Start and Stop Cmds

Prevent the spurious Start and Stop Commands that are send to the
Hearing Aids when there is audio suspend and resume, and also connection
and disconnections.
Also, make sure that the callback for the Audio Suspend and Resume are
done in the main thread; previously, it was running in the wrong socket
thread.
Lastly, make sure that the Connection Update callback are processed
correctly; previously, we are not checking that the right connection
interval are set and taking the callbacks done by service discovery.

Test: Manual testing with Hearing Aids
Bug: 117619792
Change-Id: I33a175947b0118f0234ec6338c20ac6e7963a598
Merged-In: I33a175947b0118f0234ec6338c20ac6e7963a598
(cherry picked from commit cac96c646fac463a9c894ad702bd4428863c9400)

5 years agoAdd code coverage report support to Bluetooth
Ajay Panicker [Thu, 20 Sep 2018 21:39:00 +0000 (14:39 -0700)]
Add code coverage report support to Bluetooth

Allow the generation of code coverage reports for any code that has
native tests.

In order to add coverage support to code do the following steps.

1. Add "clang_file_coverage" as a default to the source library(s) you
   want statistics for.
2. Add "clang_coverage_bin" as a default to the host supported test.
3. Add the test name and the files you want covered to "gen_coverage.py"
    - The files covered can either be a directory or files.
    - Avoid using / at the beginning of a covered file/dir as this
      breaks how the coverage generator resolves filenames.

Bug: 114751344
Test: run ./gen_coverage.py and test arguments manually
Change-Id: I9dd04f6ee2fd642531e301e3bfd52713f862cd4b

5 years agoCleanup LE White List HCI interface
Jakub Pawlowski [Tue, 30 Oct 2018 21:49:30 +0000 (22:49 +0100)]
Cleanup LE White List HCI interface

Replace global functions with callbacks, to reduce interface size.

Test: add/remove at least two devices in whitelist, verify HCI snoop log
Bug: 112827989
Change-Id: Id05c9f4970bbb795309a3a233f83559bcc1c56e2

5 years agoMerge "HFP: support pause character "Comma" in acceptable dial digit string"
Treehugger Robot [Thu, 1 Nov 2018 06:07:45 +0000 (06:07 +0000)]
Merge "HFP: support pause character "Comma" in acceptable dial digit string"

5 years agoHFP: Don't use mSBC for HF devices not supporting related feature
weichinweng [Wed, 17 Oct 2018 07:28:56 +0000 (15:28 +0800)]
HFP: Don't use mSBC for HF devices not supporting related feature

* Some misbehaving HF devices indicate their support some mSBC related
feature but some feature is not support. It will cause some unexpected
behavior.
* This CL adds a workround for checking if HF device indicate which one
is not support on Transparent Synchronous Data, WBS and Codec
Negotiation, Fluoride will assume CVSD codec by default.

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

5 years agoHCI: accept OnceCallback instad of Callback
Jakub Pawlowski [Tue, 30 Oct 2018 17:29:36 +0000 (18:29 +0100)]
HCI: accept OnceCallback instad of Callback

Command complete is guaranteed to happen only once by HCI spec.

Test: run sl4a tests around advertising, which use callback
Change-Id: I3c40ed21c56b41649bbc9519d280339b1cbb285f

5 years agoMerge changes Ie4f783b0,I456a18c6,I8c57dd5a
Treehugger Robot [Tue, 30 Oct 2018 06:41:08 +0000 (06:41 +0000)]
Merge changes Ie4f783b0,I456a18c6,I8c57dd5a

* changes:
  Small cleanup in GATT white list
  Separate GATT white list from global GATT control block.
  Move white list specific code in GATT to separate file

5 years agoHFP: support pause character "Comma" in acceptable dial digit string
jonerlin [Tue, 30 Oct 2018 06:09:41 +0000 (14:09 +0800)]
HFP: support pause character "Comma" in acceptable dial digit string

* To avoid bt stack filter MO call initiated from HF end with by sending dial command with modifier character "," (Comma)

Bug: 118401445
Test: making MO call from carkit/equipment by sending ATD command with phone number plus comma plus DTMF digitals
Change-Id: I5acb913a3c034f10ad704c1b8466634df122b580

5 years agoMerge "Hearing Aid: Combine audio from stereo to mono when only one side connect"
Weichin Weng [Tue, 30 Oct 2018 02:08:44 +0000 (02:08 +0000)]
Merge "Hearing Aid: Combine audio from stereo to mono when only one side connect"

5 years agoSmall cleanup in GATT white list
Jakub Pawlowski [Mon, 29 Oct 2018 14:53:35 +0000 (15:53 +0100)]
Small cleanup in GATT white list

* move local helper functions into local namespace
* reduce dependency on other modules

Bug: 112827989
Test: compilation
Change-Id: Ie4f783b00b5d0b77698412e09e35a5d11ed8f5f6

5 years agoSeparate GATT white list from global GATT control block.
Jakub Pawlowski [Mon, 29 Oct 2018 10:24:32 +0000 (11:24 +0100)]
Separate GATT white list from global GATT control block.

Bug: 112827989
Test: compilation, no functional changes
Change-Id: I456a18c6ce567991c4768afaaa3266085a9d30fb

5 years agoMove white list specific code in GATT to separate file
Jakub Pawlowski [Mon, 29 Oct 2018 09:17:23 +0000 (10:17 +0100)]
Move white list specific code in GATT to separate file

Test: compilation, no functional change
Bug: 112827989
Change-Id: I8c57dd5a3b0d6c088acc1a40d9f3437428a8bd8b

5 years agoBTM_BleClearBgConnDev -> BTM_WhiteListClear
Jakub Pawlowski [Fri, 26 Oct 2018 10:31:41 +0000 (12:31 +0200)]
BTM_BleClearBgConnDev -> BTM_WhiteListClear

BTM_WhiteList* functions are called only from gatt_utils.cc.
BTM_BleClearBgConnDev is currently an exception - instead of being
called from there, it does call gatt_reset_bgdev_list. This patch fixes
that.

Test: compilation, no functional change
Bug: 112827989
Change-Id: I4cd5bfee44c46d2ef37912496cd6cf5298ab1dfc

5 years agoSplit BTM_BleUpdateBgConnDev into BTM_WhiteListAdd and BTM_WhiteListRemove
Jakub Pawlowski [Fri, 26 Oct 2018 09:29:56 +0000 (11:29 +0200)]
Split BTM_BleUpdateBgConnDev into BTM_WhiteListAdd and BTM_WhiteListRemove

There is very little common code between both codepath. Having them
separate makes the code cleaner.

Test: compilation, no functional changes.
Bug: 112827989
Change-Id: I936f69a93366d3230df4435fc4b24962cc0bd4b2

5 years agoLinux build fix
Jakub Pawlowski [Thu, 25 Oct 2018 13:12:43 +0000 (15:12 +0200)]
Linux build fix

Move metrics_linux.cc into common/, where the metrics live now.
Add btif_avrcp_audio_track_linux.cc
Fix BUILD.gn files.
Define FALLTHROUGH_INTENDED for linux, to fix build error.

Test: build with ninja and run on linux
Change-Id: I117d19ed25828389c385f09ad731e8bd61b38030

5 years agoHearing Aid: Combine audio from stereo to mono when only one side connect
weichinweng [Fri, 26 Oct 2018 09:21:13 +0000 (17:21 +0800)]
Hearing Aid: Combine audio from stereo to mono when only one side connect

* On the design of the Hearing Aids, the phone will separate the stereo
audio samples and stream the left audio samples to the left device and
right audio samples to the right device. When only one side connected,
phone will only stream the one side audio sample to one hearing aid
device.
* This CL adds a functionality for checking the left/right hearing aid
and combine audio samples from stereo to mono when only on side connect.

Bug: 117178490
Test: disconnected/reconnected one side hearing when play stereo test
sound.

Change-Id: Idb3871951617680aba3ca82f801a70c95403d889

5 years agoMinor style fixes in gatt_api.cc
Jakub Pawlowski [Thu, 25 Oct 2018 22:23:21 +0000 (00:23 +0200)]
Minor style fixes in gatt_api.cc

Test: compilation
Change-Id: I3050d84443149a5ed77ab1e07f079553546b628c

5 years agoMerge "Add siyuanh@google.com to OWNERS"
Treehugger Robot [Fri, 26 Oct 2018 01:16:15 +0000 (01:16 +0000)]
Merge "Add siyuanh@google.com to OWNERS"

5 years agoSplit gatt_update_auto_connect_dev into separate add/remove functions
Jakub Pawlowski [Thu, 25 Oct 2018 21:04:14 +0000 (23:04 +0200)]
Split gatt_update_auto_connect_dev into separate add/remove functions

Test: compilation, no functional changes
Change-Id: I58b5d565753e0c1b99a3b06b27074b593f3b903b

5 years agoMerge pie-platform-release to aosp-master - DO NOT MERGE
Bill Yi [Wed, 24 Oct 2018 21:48:45 +0000 (14:48 -0700)]
Merge pie-platform-release to aosp-master - DO NOT MERGE

Change-Id: Id9d96121fb33dba3b75b2b5364da997e30006b36

5 years agoAdd siyuanh@google.com to OWNERS
Jack He [Tue, 17 Oct 2017 17:40:38 +0000 (10:40 -0700)]
Add siyuanh@google.com to OWNERS

Test: N/A
Change-Id: I8bdb6e7be8261a25f7ff103a5043001fa7645fee

5 years agoMerge "separate btm_ble_stop_auto_conn from btm_ble_start_auto_conn"
Jakub Pawlowski [Wed, 24 Oct 2018 16:33:59 +0000 (16:33 +0000)]
Merge "separate btm_ble_stop_auto_conn from btm_ble_start_auto_conn"

5 years agoseparate btm_ble_stop_auto_conn from btm_ble_start_auto_conn
Jakub Pawlowski [Wed, 24 Oct 2018 11:22:40 +0000 (13:22 +0200)]
separate btm_ble_stop_auto_conn from btm_ble_start_auto_conn

There is no common code in those two code paths. Also, minor if/else
refactoring to simplify the code.

Test: compilation, no change in how code works.
Change-Id: I82a03a18041bb5ad396f21ed13e8047e093f2765

5 years agoservice: don't use android::String16 in platform-independent code
Jakub Pawlowski [Tue, 23 Oct 2018 19:54:53 +0000 (21:54 +0200)]
service: don't use android::String16 in platform-independent code

Test: compile on linux with ninja
Change-Id: Iac421b43a5516418a33b8c804cfca4c777363b27

5 years agoAllow implicit-fallthrough warnings locally.
Chih-Hung Hsieh [Tue, 16 Oct 2018 17:18:13 +0000 (10:18 -0700)]
Allow implicit-fallthrough warnings locally.

It will be a global error by default.
These warnings will be fixed in new refactored code.

Bug: 112564944
Bug: 116020782
Test: make checkbuild
Change-Id: I67f1170f3f7502a4243d8a5641eb471317b42cf4
Exempt-From-Owner-Approval: do not block on new warnings

5 years agoFix errors around logging when compiling on Linux
Jakub Pawlowski [Tue, 23 Oct 2018 12:46:24 +0000 (14:46 +0200)]
Fix errors around logging when compiling on Linux

* cutils/log.h -> log/log.h
* add missing #include "log/log.h"
* add android_errorWriteWithInfoLog stub

Test: compile on linux using ninja
Change-Id: I720921a2fbf86b5ce5e2a2f691f1e769c91672b6

5 years agoPartial fix for linux build
Jakub Pawlowski [Tue, 23 Oct 2018 13:57:20 +0000 (15:57 +0200)]
Partial fix for linux build

Test: build with ninja on Linux
Change-Id: Ibb5bdde117732556b5b7f0fa6fba8a57c2912782

5 years agoMerge cherrypicks of [5317808, 5317809, 5318498, 5317873, 5318338, 5318195, 5318499...
android-build-team Robot [Sat, 20 Oct 2018 00:19:43 +0000 (00:19 +0000)]
Merge cherrypicks of [531780853178095318498531787353183385318195531849953178745317875531787653182435318244531853753185385318539531854053185415318542531854353185445318545531854653152105317756531855753185585318559531856053185615318339531854753185485318549531856253185635318564531856553185665318172531817353181745318550531840153181965317889531817553181765318577531857853185795318580531858153185035318390531850553183415318551] into pi-qpr1-release

Change-Id: I6df9d99838866ae835f25adc27afe9e29fc6a380

5 years agoFix possible OOB read
Jakub Pawlowski [Wed, 10 Oct 2018 17:35:37 +0000 (19:35 +0200)]
Fix possible OOB read

Bug: 74249842
Change-Id: I0dbe43f0da1f5a8f14bcb69659752de4bd70ca98
(cherry picked from commit 6e6c347e798bf8195a9a02457edf871a97b1cfad)

5 years agoHIDD: Check descriptor length and increase buffer
Hansong Zhang [Tue, 2 Oct 2018 23:26:38 +0000 (16:26 -0700)]
HIDD: Check descriptor length and increase buffer

Since maximum descriptor length is 2048, we need to assign 2054 bytes of
buffer for another 6 bytes of data. Also added a const for maximum
descriptor length.

Bug: 113572366
Test: manual
Change-Id: Ie2b25c9e1a9f2019cbc7e6fbecbb08b643c87946
Merged-In: Ie2b25c9e1a9f2019cbc7e6fbecbb08b643c87946
(cherry picked from commit c0530b211e8a5b43e556c6d47d424b231afb8e99)

5 years agoRun the wakelock JNI callbacks on the JNI thread
Pavlin Radoslavov [Sat, 25 Aug 2018 01:45:16 +0000 (18:45 -0700)]
Run the wakelock JNI callbacks on the JNI thread

All JNI callbacks must be on the JNI thread, otherwise this could
impact the threads' operation.

Bug: 111277984
Test: A2DP streaming
Change-Id: I94fa4500aea62a574c80749e904434e46eb4e942
(cherry picked from commit c788ad703836f6ac0f63e47b20f27b41dcce9353)
(cherry picked from commit f918ab9ff83a750a344871758a308f17b6e8f5fb)

5 years agobta: Pass the correct UUID array size in bta_ag_do_disc
Myles Watson [Thu, 6 Sep 2018 17:57:47 +0000 (10:57 -0700)]
bta: Pass the correct UUID array size in bta_ag_do_disc

Bug: 113164621
Test: Connect HSP from a device to the phone
Change-Id: Iec875cd165ad1cea64c307602bb00b623967c7c7
(cherry picked from commit 9645b5dd62c8166f10798335768aa2a6c3e05e4c)

5 years agoCheck SDU lower bound before allocate p_data
Ugo Yu [Mon, 17 Sep 2018 07:59:30 +0000 (15:59 +0800)]
Check SDU lower bound before allocate p_data

Bug: 112321180
Test: SL4A BleCocTest:test_coc_insecured_connection_write_ascii
Change-Id: Id0c9aa2097f0b6bdc2bb9fa9086daa9452188e1d
(cherry picked from commit 785e12ed58d020a0df075163c1831021c0cde218)