OSDN Git Service

android-x86/system-bt.git
7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 20:56:52 +0000 (20:56 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453 am: c80b2fc096  -s ours am: f79aebe2b9  -s ours am: 9005269de3  -s ours am: c464bfcd50  -s ours am: f728c0d6cd  -s ours am: 37a0953a2f  -s ours
am: 091d2acaf8

Change-Id: Iac2fc4280421950fdb42dbcddaeb7dd170147b01

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 20:56:11 +0000 (20:56 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev am: ee18c2bdd9 am: cf3547d9a2 am: 0141629f97 am: d79fd6108c am: acb2d613e8  -s ours
am: 92633956fe

Change-Id: Id2b687eb3d16e6eec682a512bf05ed13f0ca9b23

7 years agoAllocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401...
Pavlin Radoslavov [Thu, 13 Jul 2017 20:55:52 +0000 (20:55 +0000)]
Allocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401f62 am: 6a44d1821b am: 4e8db0e0b4 am: 8a6b2b86ba  -s ours
am: b3639fc6d3  -s ours

Change-Id: Ie3219423afceddbb0cbc32e33c8c50d2060a7330

7 years agoMerge "Add missing continuation offset check for SDP continuation requests" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 20:55:17 +0000 (20:55 +0000)]
Merge "Add missing continuation offset check for SDP continuation requests" into oc-dev
am: 8109294976

Change-Id: I43121a744aede2a65efa8dd3995fdd1bb3dc8a2d

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 20:54:58 +0000 (20:54 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into oc-dev
am: 5dbe611a15

Change-Id: Ie12b30c5fa2a871bad9f74986d0e7cf67368e226

7 years agoMerge "resolve merge conflicts of 7d0ad232f to oc-dr1-dev" into oc-dr1-dev
TreeHugger Robot [Thu, 13 Jul 2017 20:51:10 +0000 (20:51 +0000)]
Merge "resolve merge conflicts of 7d0ad232f to oc-dr1-dev" into oc-dr1-dev

7 years agobt: fix sdp service name by removing NULL char
Timm Korte [Mon, 15 May 2017 06:30:00 +0000 (08:30 +0200)]
bt: fix sdp service name by removing NULL char

The Bluedroid stack uses a C string with terminating NULL char as a
service name. Since in BT, strings are TLV encoded (type, length,
value), this doesn't make sense.

Simple fix is to copy the string without the trailing NULL by
removing the "+1" after the strlen call when passing the string as
uint8_t array to the lower level functions.
The current behaviour keeps some older devices from being able to
connect to an Android providing a Serial Port profile due to having
the wrong service name (that is, including a NULL at the end instead
of the correct string).

Test: Checked against Linux BlueZ, which does not include this extra
null character.

Bug: 63665003
Change-Id: I6a43024ff89ac09e4b2d2e5cfb407b6e9323f0bd
Signed-off-by: Timm Korte <timm.korte@gmail.com>
(cherry picked from commit 625f798c696229b0cc58e5f85409fd029f987473)

7 years agoresolve merge conflicts of 7d0ad232f to oc-dr1-dev
Pavlin Radoslavov [Thu, 13 Jul 2017 18:37:19 +0000 (11:37 -0700)]
resolve merge conflicts of 7d0ad232f to oc-dr1-dev

Test: Code inspection.
Change-Id: I5406558028da5a52647dec7f4f691c6c68a5591e

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:34:40 +0000 (18:34 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453 am: c80b2fc096  -s ours am: f79aebe2b9  -s ours am: 9005269de3  -s ours am: c464bfcd50  -s ours am: f728c0d6cd  -s ours
am: 37a0953a2f  -s ours

Change-Id: Ia591d50d3e2bfd54a5d1f574f883e9db99369c4b

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:32:10 +0000 (18:32 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453 am: c80b2fc096  -s ours am: f79aebe2b9  -s ours am: 9005269de3  -s ours am: c464bfcd50  -s ours
am: f728c0d6cd  -s ours

Change-Id: I1a85ce7d1cf860bb251d6899dbdf2b05bd2bcb6e

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:29:39 +0000 (18:29 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453 am: c80b2fc096  -s ours am: f79aebe2b9  -s ours am: 9005269de3  -s ours
am: c464bfcd50  -s ours

Change-Id: I97811392efb8e88411006d43d4d499599392f682

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:26:40 +0000 (18:26 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453 am: c80b2fc096  -s ours am: f79aebe2b9  -s ours
am: 9005269de3  -s ours

Change-Id: Ia2e716810d7a667becfe79b5ce5995225ed57648

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:23:39 +0000 (18:23 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453 am: c80b2fc096  -s ours
am: f79aebe2b9  -s ours

Change-Id: I98be6f0d6399502bbf523e3531865a608111c076

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:20:40 +0000 (18:20 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7 am: 5d9bbfe453
am: c80b2fc096  -s ours

Change-Id: I143dcc7f5db0b852b596eeb62ac78f1beda40b3c

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:18:09 +0000 (18:18 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948 am: b4cf6c5aa7
am: 5d9bbfe453

Change-Id: I0d39c39b4b573b7df297ed1d93191aff18712fec

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:16:23 +0000 (18:16 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev am: ee18c2bdd9 am: cf3547d9a2 am: 0141629f97 am: d79fd6108c
am: acb2d613e8  -s ours

Change-Id: Iadd78e80ac0f6d6b198a2edd7d97492eb2f692cb

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948
Pavlin Radoslavov [Thu, 13 Jul 2017 18:16:08 +0000 (18:16 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote am: f7a7f7a948
am: b4cf6c5aa7

Change-Id: I915ceaf816dc806ba91da7791aa1b43460615935

7 years agoAllocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:16:07 +0000 (18:16 +0000)]
Allocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401f62 am: 6a44d1821b am: 4e8db0e0b4
am: 8a6b2b86ba  -s ours

Change-Id: I15e24d3ee6db3a03facf05df6a4b59c0bbd10e0f

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:13:52 +0000 (18:13 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev am: ee18c2bdd9 am: cf3547d9a2 am: 0141629f97
am: d79fd6108c

Change-Id: Ibc5fee1b8c7f9b3a73a66ead8485b5b35418f1b6

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Thu, 13 Jul 2017 18:13:38 +0000 (18:13 +0000)]
Disable PAN Reverse Tethering when connection originated by the Remote
am: f7a7f7a948

Change-Id: I5d1c8050de38dde922f9891e70574205422ee7be

7 years agoAllocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:13:38 +0000 (18:13 +0000)]
Allocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401f62 am: 6a44d1821b
am: 4e8db0e0b4

Change-Id: I4b45cfe89d4460520eca795858309a83886e6c70

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:11:26 +0000 (18:11 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev am: ee18c2bdd9 am: cf3547d9a2
am: 0141629f97

Change-Id: I8635a23f75175bcde855ddf925ce2da0efd7de2b

7 years agoAllocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401f62
Pavlin Radoslavov [Thu, 13 Jul 2017 18:11:07 +0000 (18:11 +0000)]
Allocate buffers of the right size when BT_HDR is included am: 510697a0d7 am: 5da7401f62
am: 6a44d1821b

Change-Id: Idfaeec3e29c40905e50e69df944134e403d41a1b

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:08:51 +0000 (18:08 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev am: ee18c2bdd9
am: cf3547d9a2

Change-Id: Ia5a9015eb954fd331c2a06120456b98baafc0f17

7 years agoAllocate buffers of the right size when BT_HDR is included am: 510697a0d7
Pavlin Radoslavov [Thu, 13 Jul 2017 18:08:37 +0000 (18:08 +0000)]
Allocate buffers of the right size when BT_HDR is included am: 510697a0d7
am: 5da7401f62

Change-Id: I551622b60e882a85a9c739ec22d08a5af55cb1c9

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
Pavlin Radoslavov [Thu, 13 Jul 2017 18:06:58 +0000 (18:06 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev
am: ee18c2bdd9

Change-Id: I077fed75c11c360dd38d4988f08dca4dd8ddf604

7 years agoAllocate buffers of the right size when BT_HDR is included
Pavlin Radoslavov [Thu, 13 Jul 2017 18:06:36 +0000 (18:06 +0000)]
Allocate buffers of the right size when BT_HDR is included
am: 510697a0d7

Change-Id: I5ca796fc392413dbf7f89332d1172904f980fab5

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
TreeHugger Robot [Thu, 13 Jul 2017 18:02:23 +0000 (18:02 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into nyc-dev

7 years agoMerge "Add missing continuation offset check for SDP continuation requests" into...
TreeHugger Robot [Thu, 13 Jul 2017 17:53:39 +0000 (17:53 +0000)]
Merge "Add missing continuation offset check for SDP continuation requests" into oc-dev

7 years agoMerge "Disable PAN Reverse Tethering when connection originated by the Remote" into...
TreeHugger Robot [Thu, 13 Jul 2017 17:52:13 +0000 (17:52 +0000)]
Merge "Disable PAN Reverse Tethering when connection originated by the Remote" into oc-dev

7 years agoMerge "Add a missing check for PAN buffer size before copying data" into oc-dev
Pavlin Radoslavov [Thu, 13 Jul 2017 17:29:05 +0000 (17:29 +0000)]
Merge "Add a missing check for PAN buffer size before copying data" into oc-dev
am: ff7bd36bb7

Change-Id: I1f4eda1132635ad3ee7016f7ad423cea20e293c9

7 years agoMerge "Add missing packet length checks while parsing BNEP control packets" into...
TreeHugger Robot [Thu, 13 Jul 2017 17:25:27 +0000 (17:25 +0000)]
Merge "Add missing packet length checks while parsing BNEP control packets" into oc-dev

7 years agoMerge "Add a missing check for PAN buffer size before copying data" into oc-dev
TreeHugger Robot [Thu, 13 Jul 2017 17:24:30 +0000 (17:24 +0000)]
Merge "Add a missing check for PAN buffer size before copying data" into oc-dev

7 years agoAllocate buffers of the right size when BT_HDR is included
Pavlin Radoslavov [Thu, 13 Jul 2017 17:19:07 +0000 (17:19 +0000)]
Allocate buffers of the right size when BT_HDR is included
am: 8810ffba99

Change-Id: Iba43743c47ce1e0dc0221177b0d168692fa44bdf

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Thu, 13 Jul 2017 01:39:31 +0000 (18:39 -0700)]
Disable PAN Reverse Tethering when connection originated by the Remote

* Check for valid interactions between the three PAN profile roles per
  Table 1 in PAN Profile v1.0 spec.
* Explicitly disable connections to the local PANU if the remote is
  not PANU.

Bug: 63145701
Test: External script
Change-Id: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
Merged-In: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
(cherry picked from commit 9aea2c2f92dd5245f6b35d564ce8e471fec2b4ec)
(cherry picked from commit 3f2ee5b546b65b5b021779588316249276ed3827)
(cherry picked from commit 40c7cefb12ac1a70bf7b1c770c1ab21a5b3f229e)
(cherry picked from commit f7a7f7a948e38195e8ca897785ac5d489082f0cc)

7 years agoAllocate buffers of the right size when BT_HDR is included
Pavlin Radoslavov [Thu, 6 Jul 2017 20:39:02 +0000 (13:39 -0700)]
Allocate buffers of the right size when BT_HDR is included

Bug: 63146105
Test: External script
Change-Id: I1f2c871e3fcf57aabdad9d07905e6dae643bd496
Merged-In: I1f2c871e3fcf57aabdad9d07905e6dae643bd496
(cherry picked from commit d88838a7237cd672d87b6b9cc8d56fff625fd1d5)
(cherry picked from commit b648c7dfe45c57842d58576f558fdf8edff10bec)
(cherry picked from commit 338e0485940ab278e6a2dc12285ba0798b79cfa4)

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Thu, 13 Jul 2017 01:39:31 +0000 (18:39 -0700)]
Disable PAN Reverse Tethering when connection originated by the Remote

* Check for valid interactions between the three PAN profile roles per
  Table 1 in PAN Profile v1.0 spec.
* Explicitly disable connections to the local PANU if the remote is
  not PANU.

Bug: 63145701
Test: External script
Change-Id: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
Merged-In: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
(cherry picked from commit 9aea2c2f92dd5245f6b35d564ce8e471fec2b4ec)
(cherry picked from commit 3f2ee5b546b65b5b021779588316249276ed3827)
(cherry picked from commit 40c7cefb12ac1a70bf7b1c770c1ab21a5b3f229e)

7 years agoAdd missing packet length checks while parsing BNEP control packets
Pavlin Radoslavov [Thu, 6 Jul 2017 23:51:35 +0000 (16:51 -0700)]
Add missing packet length checks while parsing BNEP control packets

Bug: 63146237
Test: External script
Change-Id: Ie778f3c99df81c85ed988f3af89b4edbcc2eeb99
Merged-In: Ie778f3c99df81c85ed988f3af89b4edbcc2eeb99
(cherry picked from commit 7feaeb006941a1494d7cdc0a2ffc4bb1004b38b4)

7 years agoAdd missing continuation offset check for SDP continuation requests
Pavlin Radoslavov [Sat, 8 Jul 2017 00:17:31 +0000 (17:17 -0700)]
Add missing continuation offset check for SDP continuation requests

Bug: 63146698
Test: External script
Change-Id: Iea52f1689dc12bfe0d4b57996f17db4bc3bd5983
Merged-In: Iea52f1689dc12bfe0d4b57996f17db4bc3bd5983

7 years agoDisable PAN Reverse Tethering when connection originated by the Remote
Pavlin Radoslavov [Fri, 7 Jul 2017 08:48:40 +0000 (01:48 -0700)]
Disable PAN Reverse Tethering when connection originated by the Remote

* Check for valid interactions between the three PAN profile roles per
  Table 1 in PAN Profile v1.0 spec.
* Explicitly disable connections to the local PANU if the remote is
  not PANU.

Bug: 63145701
Test: External script
Change-Id: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a
Merged-In: I29a7e404ba7e4453b6a7c59148a2b3eb7395303a

7 years agoAdd a missing check for PAN buffer size before copying data
Pavlin Radoslavov [Thu, 6 Jul 2017 23:58:24 +0000 (16:58 -0700)]
Add a missing check for PAN buffer size before copying data

Bug: 63146237
Test: External script
Change-Id: I3e9c8a767a8a2a80ff56ccb48c56ca0d4b8c3402
Merged-In: I3e9c8a767a8a2a80ff56ccb48c56ca0d4b8c3402

7 years agoAllocate buffers of the right size when BT_HDR is included
Pavlin Radoslavov [Thu, 6 Jul 2017 20:39:02 +0000 (13:39 -0700)]
Allocate buffers of the right size when BT_HDR is included

Bug: 63146105
Test: External script
Change-Id: I1f2c871e3fcf57aabdad9d07905e6dae643bd496
Merged-In: I1f2c871e3fcf57aabdad9d07905e6dae643bd496

7 years agoAllow collection of Bluetooth firmware dumps in bugreports (3/3)
Ajay Panicker [Wed, 12 Jul 2017 18:45:08 +0000 (11:45 -0700)]
Allow collection of Bluetooth firmware dumps in bugreports (3/3)

This patch is temporary and should be removed once the bug is resolved

Bug: 63390057
Test: Force a hci timeout and collect a bugreport on walleye
Change-Id: Idab6d87c1b0540ea325fa1019ea2c9e97f3218f2

7 years agoGATT: Expose opportunistic client API to Java
Jack He [Thu, 29 Jun 2017 20:58:47 +0000 (13:58 -0700)]
GATT: Expose opportunistic client API to Java

* Opportunistic GATT connection allows system service to subscribe to
  characteristic notifications without holding the BLE connection
* Exposing this flag to Java allows Android applications to use it

Bug: 63347806
Test: make, test on Android App
Change-Id: Ic470acd63bf45d1c33696abed1e93b30746fb7a2
Merged-In: Ic470acd63bf45d1c33696abed1e93b30746fb7a2
(cherry picked from commit 5120fedf20eb29fa65cef561c475d18d51197b25)

7 years agoFix crashes on stack shutdown
Jakub Pawlowski [Thu, 22 Jun 2017 19:45:30 +0000 (12:45 -0700)]
Fix crashes on stack shutdown

During stack shutdown, Unregister would sometimes get called after the
stack is already cleaned up, and the AdvertiseManager::Get would crash
on null check assertion. Ensure that stack is initialized before
Unregister call.

Bug: 37888261
Test: none
Change-Id: I7a4bbcd24ec7d24d21d04fe842985baaac899321
Merged-In: I7a4bbcd24ec7d24d21d04fe842985baaac899321

7 years agoMerge "Revert "Blacklist Kinivo BTC350 for Absolute Volume"" into oc-dr1-dev
TreeHugger Robot [Fri, 7 Jul 2017 21:22:41 +0000 (21:22 +0000)]
Merge "Revert "Blacklist Kinivo BTC350 for Absolute Volume"" into oc-dr1-dev

7 years agoRevert "Blacklist Kinivo BTC350 for Absolute Volume"
Tom Turney [Fri, 7 Jul 2017 18:11:46 +0000 (18:11 +0000)]
Revert "Blacklist Kinivo BTC350 for Absolute Volume"

This reverts commit 84e8fa9b0873c31b6ee5dce53405db9e9ff77a31.

This is actually due to b/63073544 not an issue with the device.

Change-Id: I8433adcfc7ff8f3bf8a16eccb72f0522fa896fef

7 years agoDo not delete device record on HCI_ERR_KEY_MISSING
Jinguang Dong [Wed, 28 Jun 2017 01:50:37 +0000 (09:50 +0800)]
Do not delete device record on HCI_ERR_KEY_MISSING

If an auth_complete event is received with HCI_ERR_KEY_MISSING, the
p_dev_rec->sm4 flag will be set to "BTM_SM4_UNKNOWN" in the
BTM_SecClearSecurityFlags() function. This will prevent the
BTM_SM4_RETRY procedure from being executed, which can cause
pairing failures.

To reproduce:
 1. Two Phones, A: Android O, B: Android N.
 2. Enable B in Bluetooth visable mode
 3. A start discovery and create pairing with B successfully
 4. B cancel pairing with A by remove A from pairing device
    list of B.
 5. A create paring with B again by touch paired device in A,
    this first step will be failed.

Bug: 62615213
Test: manual
Change-Id: I514ba2f4d0fd2621c11bd83aeec24b8c6c6d2d5a
Signed-off-by: Yequan Song <songyequan@huawei.com>
(cherry picked from commit 549ec693c2a3a240a5b688a1311cc7c55daa59fc)

7 years agoBluetooth - Add tracing for TX queue and LDAC ABR
Philip Cuadra [Fri, 9 Jun 2017 21:36:06 +0000 (14:36 -0700)]
Bluetooth - Add tracing for TX queue and LDAC ABR

For debugging, add tracing to show the length of the TX queue and the
LDAC ABR level.

Test:  Ran bluetooth, took a systrace

Change-Id: Ia23764d68f27ae8209e37c4a0836852d73cf6cbc

7 years agoDon't initiate role switch for blacklisted devices
Srinu Jella [Wed, 7 Dec 2016 13:46:31 +0000 (19:16 +0530)]
Don't initiate role switch for blacklisted devices

Some devices always reject role switches and role switch
retries from the DUT may lead to A2DP glitches and LMP timeouts.

Test: manual
Bug: 33000157
Change-Id: I535a2c45ced0e14cf5530f78f3367569b306b1f4
Merged-In: I535a2c45ced0e14cf5530f78f3367569b306b1f4
(cherry picked from commit 811200c8d120d987695445c28fda378677ba21c1)

7 years agoAdd missing lock protection when freeing RFCOMM port queues
Pavlin Radoslavov [Sat, 1 Jul 2017 04:25:15 +0000 (21:25 -0700)]
Add missing lock protection when freeing RFCOMM port queues

Bug: 63100223
Test: Code compilation
Change-Id: Ibbafb9586e9807688276c9eb2f6399cb3ee487c9
(cherry picked from commit 16f4cf0bb17cee817da11f2775f4a00d290eaba7)

7 years agoMerge "A2DP: Add mandatory elements for SBC SRC capabilities" into oc-dr1-dev
TreeHugger Robot [Thu, 6 Jul 2017 17:19:45 +0000 (17:19 +0000)]
Merge "A2DP: Add mandatory elements for SBC SRC capabilities" into oc-dr1-dev

7 years agoA2DP: Add mandatory elements for SBC SRC capabilities
koh.changseok [Mon, 3 Jul 2017 17:37:42 +0000 (02:37 +0900)]
A2DP: Add mandatory elements for SBC SRC capabilities

* The SBC items below are mandatory for SBC SRC capabilities
(see A2DP_SPEC_V13.pdf, Section 4.3.2):
 - Channel Mode - mono
 - Block Length - 4, 8, 12, 16
* Updated/fixed the corresponding unit tests

Bug: 63260735
Test: Manual - A2DP SBC streaming
Change-Id: I04c4f0b830411bc736d7c402b86006c182af02e7
(cherry picked from commit 444ea2c15a24cabaae87c8806b5d50e6ecb9a24d)

7 years agoDynamic blacklist device for role switch
Srinu Jella [Thu, 8 Dec 2016 13:33:20 +0000 (19:03 +0530)]
Dynamic blacklist device for role switch

- Blacklist the device if it's rejected the role switch for
   max number of times. Same is added to the interop_database.

- Maximum number of failed (BTM_MAX_SW_ROLE_FAILED_ATTEMPTS)
  attempts set to 3 and it is configurable.

- Same blacklisted device is referred by the BTM module when
  any other module like profile is requesting for role switch
  and BTM module returns BTM_REPEATED_ATTEMPTS as the switch
  role status.

Test: Code compilation
Bug: 32999957
Change-Id: Ie999104a2c8ca507605ef3e1d454865cee98dcd2
(cherry picked from commit 942648ef5a4b25508cc9ffe7073ddab5e04a9ab4)

7 years agoSet the A2DP media channel as a high priority L2CAP link
Ben YoungTae Kim [Tue, 20 Jun 2017 13:56:08 +0000 (19:26 +0530)]
Set the A2DP media channel as a high priority L2CAP link

Use dynamic ACL buffer allocation for high priority links:
1. Ensure dedicated ACL buffers for high priority links
2. Adjust buffer allocation if the priority of the link changes

Test: Manually tested with 4 HID devices and A2DP streaming scenario
Bug: 30787081
Change-Id: Id3c4a76e360aee322e9f8073bd399807e7987990
(cherry picked from commit 624ba681a63fa5ecf778b0b019735359654c6dd0)

7 years agobtif: Pass UIDs changed up to the Java layer
Marie Janssen [Fri, 23 Jun 2017 20:01:35 +0000 (20:01 +0000)]
btif: Pass UIDs changed up to the Java layer
am: 39f664e629

Change-Id: I61d182617ea69cb060fb27e26a3d3b0a24fb07c0

7 years agobtif: Pass UIDs changed up to the Java layer
Marie Janssen [Fri, 23 Jun 2017 00:21:10 +0000 (17:21 -0700)]
btif: Pass UIDs changed up to the Java layer

Previously we were simply responding with an INTERIM response and
leaving it at that.

Test: connect to BMW kit and check that interim is sent from Java
Bug: 62775732
Change-Id: Idb7de4417438f0c9697ee5c838b511cdd2223e80
(cherry picked from commit 3d7c99dc6db3f2a0392a0b273140eb03e0050ee5)

7 years agoFix BLE remote address resolution
Jacky Cheung [Fri, 23 Jun 2017 02:50:50 +0000 (02:50 +0000)]
Fix BLE remote address resolution
am: 5235a8c4cc

Change-Id: I533d76ef00b9971c48347362b5092b81471e46d4

7 years agoFix BLE remote address resolution
Jacky Cheung [Wed, 21 Jun 2017 16:44:23 +0000 (09:44 -0700)]
Fix BLE remote address resolution

The hash segment of the resolvable device address needs to be extracted
for comparison.

Bug: 62589903
Test: manual
(cherry picked from commit 7c58ca38433bc923c653c334b712fb05d25cab36)

Merged-In: I979a8ad3074b692503b0c882bd90041ba4fbfb4d
Change-Id: I5db8f266c9ee3022b2a8a882540870e5eecd0736

7 years agoMerge "Ensure we don't send more packets than firmware allows" into oc-dr1-dev
TreeHugger Robot [Thu, 22 Jun 2017 01:06:35 +0000 (01:06 +0000)]
Merge "Ensure we don't send more packets than firmware allows" into oc-dr1-dev

7 years agoMerge "Fix transport quota exhaustion" into oc-dr1-dev
TreeHugger Robot [Thu, 22 Jun 2017 00:39:43 +0000 (00:39 +0000)]
Merge "Fix transport quota exhaustion" into oc-dr1-dev

7 years agoFix peer address type in LE extended create connection command
Subramanian Srinivasan [Wed, 21 Jun 2017 23:29:05 +0000 (23:29 +0000)]
Fix peer address type in LE extended create connection command
am: 77ecddc3a4

Change-Id: Ida0be85163d5f615e8a2bb286edd372fd67699dd

7 years agoEnsure we don't send more packets than firmware allows
Yamei Du [Wed, 18 Nov 2015 09:28:07 +0000 (17:28 +0800)]
Ensure we don't send more packets than firmware allows

Make TX complete callback after we've sent the packet
to the lower layers and adjusted our in flight packet
count.

Bug: 26763700
Test: manual
Change-Id: Iaba14a11c1583da2a72769ebd096e0baedf857c3

7 years agoFix transport quota exhaustion
Ruina Liu [Thu, 24 Sep 2015 02:04:16 +0000 (10:04 +0800)]
Fix transport quota exhaustion

BREDR and BLE use round-robin for link quota.

If you have exhausted one transport's quota,
the break will cause traffic for all transports
to cease.

Change to a continue to prevent this.

Change-Id: I7ca739dfbf02acd2e30527c16ca616a7bad70c51
Test: manual
CR-Id: ALPS02303646

7 years agoFix peer address type in LE extended create connection command
Subramanian Srinivasan [Fri, 9 Jun 2017 00:19:05 +0000 (17:19 -0700)]
Fix peer address type in LE extended create connection command

As per BT Spec 5.0, peer address type in LE extended create
connection command can have only either 0x00 or 0x01 as valid
values. This change fixes setting of incorrect peer address
type values in extended create connection command.

Bug: 62578331
Bug: 62358300
Change-Id: I792d48be7637fc571727e7e51de1fc397158b4d5

7 years agoAdd a mechanism to avoid using AVDTP RECONFIGURE for blacklisted devices
Pavlin Radoslavov [Wed, 21 Jun 2017 02:49:01 +0000 (02:49 +0000)]
Add a mechanism to avoid using AVDTP RECONFIGURE for blacklisted devices
am: b5c932fe13

Change-Id: Icf9a802783136090208dbb7eba95a4904e035819

7 years agoAdd a mechanism to avoid using AVDTP RECONFIGURE for blacklisted devices
Pavlin Radoslavov [Mon, 19 Jun 2017 19:44:11 +0000 (12:44 -0700)]
Add a mechanism to avoid using AVDTP RECONFIGURE for blacklisted devices

Some carkits report SUCCESS for AVDTP RECONFIGURE commands when
changing A2DP codec configuration. However, there is no audio coming
from the carkit.

Bug: 37625892
Test: Manual - A2DP Codec reconfiguration while streaming audio
Change-Id: I01f37a2514e490986a20e96ace78c92463403396
Merged-In: I01f37a2514e490986a20e96ace78c92463403396
(cherry picked from commit e91297a4d1a77ae0c367fbe756090b7357e9893a)

7 years agoDisable 48.0kHz sampling rate for AAC - update the unit test
Pavlin Radoslavov [Tue, 20 Jun 2017 16:46:40 +0000 (16:46 +0000)]
Disable 48.0kHz sampling rate for AAC - update the unit test
am: 78120a1a24

Change-Id: Ieb4ee6ed56ed5be7d797f493ce8c27cbbfd1c3ab

7 years agoDisable 48.0kHz sampling rate for AAC - update the unit test
Pavlin Radoslavov [Tue, 20 Jun 2017 04:12:37 +0000 (21:12 -0700)]
Disable 48.0kHz sampling rate for AAC - update the unit test

Some carkits have issues playing A2DP audio using AAC with 48.0kHz
sampling rate, while playing AAC with 44.1kHz sampling rate is fine.

Bug: 38443632
Bug: 62301376
Test: manual
Change-Id: I5a8b72e86fb1a2cbf92f85e7a6c340cee58dadb5
(cherry picked from commit 858b6a15f528468e2b1b497dba27337f40220f7b)

7 years agoFix HID crashing on no descriptor
Jakub Pawlowski [Wed, 14 Jun 2017 02:03:08 +0000 (02:03 +0000)]
Fix HID crashing on no descriptor
am: a87ca9a392

Change-Id: Ide869d7b5cbf08196a77f4e8516f67b8dc2ef628

7 years agoFix HID crashing on no descriptor
Jakub Pawlowski [Tue, 13 Jun 2017 21:16:57 +0000 (14:16 -0700)]
Fix HID crashing on no descriptor

Bug: 62461796
Test: compilation test
Change-Id: Ic7b1fcc4b6f3c8680f1810679ed609f2691fa4aa

7 years agobta_dm: Stop copying garbage
Martin Brabham [Mon, 12 Jun 2017 18:26:49 +0000 (18:26 +0000)]
bta_dm: Stop copying garbage
am: e92648629c  -s ours

Change-Id: I5f5f01d79ed8f16f7761e43028f5e221b1e7423d

7 years agobta_dm: Stop copying garbage
Martin Brabham [Mon, 1 May 2017 23:30:40 +0000 (16:30 -0700)]
bta_dm: Stop copying garbage

After we reach 7 ACL connections we have 7 peer device records.
Once we reach this then we lose a connection and shrink the list we
copy garbage into the last peer device record.  This can cause the flag
remove_dev_pending to be set to something > 0 thus true which causes the
stack to remove the device and its bonding information on the next
acl change event.

ACL Connections can happen from any connection (pairing, SDP, etc...)

Bug: 36598959
Test: Manual
Change-Id: Ifbaa4098edba442274ffde183960ef53169988e7
Merged-In: Ifbaa4098edba442274ffde183960ef53169988e7

7 years agoeSCO: Limit number of retries after mSBC connection failure
Jack He [Fri, 9 Jun 2017 23:30:00 +0000 (23:30 +0000)]
eSCO: Limit number of retries after mSBC connection failure
am: 12fb8883d0

Change-Id: I910b806866109a2ac70b1a9975baa908e307e67c

7 years agoeSCO: Limit number of retries after mSBC connection failure
Jack He [Wed, 7 Jun 2017 23:44:30 +0000 (16:44 -0700)]
eSCO: Limit number of retries after mSBC connection failure

* When peer device supports mSBC and codec negotiation, Fluoride stack
  will try to do the following when establishing a eSCO/SCO connection:
    1) Negotiate to mSBC by sending +BCS:2
    2) Try establishing eSCO/SCO connection using mSBC T2 settings
    3) If that failed, downgrade to mSBC T1 settings and retry
    4) If that failed, re-negotiate codec to CVSD, by sending +BCS:1
    5) Retry using CVSD S4 (HFP 1.7 and above) or S3 settings
    6) If this failed stop trying and report failure to upper stack
* Retry is achieved by:
    * Retry is only possible when inuse_codec = BTA_AG_CODEC_MSBC
    * Set codec_msbc_settings to BTA_AG_SCO_MSBC_SETTINGS_T1 when T2
       failed to connect in step 3 above
    * Set codec_fallback to true when T1 failed so that CVSD is used
       in step 4 above
* Retry stop is achieved by:
    * Set inuse_codec = BTA_AG_CODEC_CVSD
    * Set codec_msbc_settings back to BTA_AG_SCO_MSBC_SETTINGS_T2
    * Set codec_fallback to false and codec_updated to true so that
      the stack is ready for the next application triggerred SCO
      connection attempt
* Removed retry_with_sco_only as both Setup Synchronous Connection
  Command (0x0028) and Enhanced Setup Synchronous Connection Command
  (0x003D) fall back to SCO connection if eSCO is not supported.
  See page 858/2772 and 895/2772 of BT4.2 specification document
* Besides both code paths are the same for retry_with_sco_only after
  eSCO changes went in

Bug: 62426841
Test: make, HFP regression, testplans/91406
Change-Id: I205311c55e8763c48b6eb43c27f242927384036e
(cherry picked from commit e82e56bb2a1e5565b73333b60dc6b30936f52e80)

7 years agoIgnore the Class Of Device if the value is invalid
Pavlin Radoslavov [Fri, 9 Jun 2017 02:10:13 +0000 (02:10 +0000)]
Ignore the Class Of Device if the value is invalid
am: 7fe86917d7

Change-Id: I9d35ec3793ed61e10f11a500af868ebda682764b

7 years agoIgnore the Class Of Device if the value is invalid
Pavlin Radoslavov [Thu, 8 Jun 2017 22:22:52 +0000 (15:22 -0700)]
Ignore the Class Of Device if the value is invalid

If a Bluetooth Device is dual-mode and is discoverable as both
a Classic and a LE device, ignore unknown "zero" values
triggered by the LE advertisements. Otherwise, those could overwrite
a valid (previously discovered) Class Of Device.

Bug: 37615863
Test: Manual with LG HBS1100 headset
Change-Id: I5a0f6ef56248b41d973b850a5542475e45e0312d
(cherry picked from commit a052757882927c042399d614bc298f9704ce07a3)

7 years agoFix GATT over BREDR not connecting
Jakub Pawlowski [Thu, 8 Jun 2017 17:59:34 +0000 (17:59 +0000)]
Fix GATT over BREDR not connecting
am: e0035727e3

Change-Id: I97ece2b97b1000bb9104757680e03063ee04c432

7 years agoFix GATT over BREDR not connecting
Jakub Pawlowski [Wed, 7 Jun 2017 18:26:36 +0000 (11:26 -0700)]
Fix GATT over BREDR not connecting

For BREDR connections, the upper stack always sends the request with
transport type DUMO, and this should be treated as BREDR if the device
is not known as LE only.

Bug: 62387078
Test: pts GattOverBrEdrTest
Change-Id: I726252e85e78bff2c9585332d2748a0d92a9f6d3

7 years agoMerge "Fix loops iteration" into oc-dr1-dev
Jakub Pawlowski [Wed, 7 Jun 2017 23:54:59 +0000 (23:54 +0000)]
Merge "Fix loops iteration" into oc-dr1-dev

7 years agoDisable 48.0kHz sampling rate for AAC
Pavlin Radoslavov [Wed, 7 Jun 2017 22:05:45 +0000 (22:05 +0000)]
Disable 48.0kHz sampling rate for AAC
am: ad73569d62

Change-Id: Ic295d9d8d09ba555372bd786b8045e309c80c390

7 years agoFix loops iteration
Jakub Pawlowski [Wed, 7 Jun 2017 16:07:26 +0000 (09:07 -0700)]
Fix loops iteration

The erase() already increment the iterator. If the loop additionally do
"it++", it will skip some elements, and might iterate over the end.

Test: compilation test
Change-Id: Ibd9c993d8e80d807f5d7bc920da36ee538477438

7 years agoDisable 48.0kHz sampling rate for AAC
Pavlin Radoslavov [Fri, 2 Jun 2017 17:45:43 +0000 (10:45 -0700)]
Disable 48.0kHz sampling rate for AAC

Some carkits have issues playing A2DP audio using AAC with 48.0kHz
sampling rate, while playing AAC with 44.1kHz sampling rate is fine.

Bug: 38443632
Bug: 62301376
Test: manual
Change-Id: I50de2db1d5386d41bfe361fbac99fc7ebbbd3640
(cherry picked from commit 3d268331ae32bd70f60984c9553db1c961073c42)

7 years agoUse std::unordered_set for keeping app_hold_link am: 3dda89880b am: f21ae6ed4f am...
Jakub Pawlowski [Wed, 7 Jun 2017 04:05:28 +0000 (04:05 +0000)]
Use std::unordered_set for keeping app_hold_link am: 3dda89880b am: f21ae6ed4f am: f13ffd521a
am: f987dd4bec

Change-Id: I2425fb1baf970e3d121e14e8294d45e2513ad47c

7 years agoUse std::unordered_set for keeping app_hold_link am: 3dda89880b am: f21ae6ed4f
Jakub Pawlowski [Wed, 7 Jun 2017 03:53:55 +0000 (03:53 +0000)]
Use std::unordered_set for keeping app_hold_link am: 3dda89880b am: f21ae6ed4f
am: f13ffd521a

Change-Id: I51e28d5202184f3dafba5d22682497f649ff326f

7 years agoUse std::unordered_set for keeping app_hold_link am: 3dda89880b
Jakub Pawlowski [Wed, 7 Jun 2017 03:45:56 +0000 (03:45 +0000)]
Use std::unordered_set for keeping app_hold_link am: 3dda89880b
am: f21ae6ed4f

Change-Id: I1d06135b7488cfe3a9f8dd7f33ef71aec4abef86

7 years agoUse std::unordered_set for keeping app_hold_link
Jakub Pawlowski [Wed, 7 Jun 2017 03:38:55 +0000 (03:38 +0000)]
Use std::unordered_set for keeping app_hold_link
am: 3dda89880b

Change-Id: I75b54eb119d655ede8331eb8105b01329a46a92e

7 years agoUse std::unordered_set for keeping app_hold_link
Jakub Pawlowski [Mon, 5 Jun 2017 22:23:32 +0000 (15:23 -0700)]
Use std::unordered_set for keeping app_hold_link

Change-Id: Ia8a0c9a2264979c1ff89faa5ddf17a83fcb7c7ce

7 years agoGet rid of clcb_idx in favour of pointers am: e4f42abab3 am: 5958c225ad am: 09273a05f4
Jakub Pawlowski [Wed, 7 Jun 2017 01:53:46 +0000 (01:53 +0000)]
Get rid of clcb_idx in favour of pointers am: e4f42abab3 am: 5958c225ad am: 09273a05f4
am: 866740dbf9

Change-Id: I721e60b6f892cee0901540be505a75be6e3d6d0b

7 years agouse std::queue for keeping tGATT_CMD_Q am: d1a9313471 am: 05bd66b651 am: 8b37d9d337
Jakub Pawlowski [Wed, 7 Jun 2017 01:53:29 +0000 (01:53 +0000)]
use std::queue for keeping tGATT_CMD_Q am: d1a9313471 am: 05bd66b651 am: 8b37d9d337
am: ad1e6a7c44

Change-Id: I0707f44414c56587e42ff41be058efc040c3e3ca

7 years agoGet rid of clcb_idx in favour of pointers am: e4f42abab3 am: 5958c225ad
Jakub Pawlowski [Wed, 7 Jun 2017 01:49:31 +0000 (01:49 +0000)]
Get rid of clcb_idx in favour of pointers am: e4f42abab3 am: 5958c225ad
am: 09273a05f4

Change-Id: I332f5503adbc01a98ebc9554be2f6102770c00e7

7 years agouse std::queue for keeping tGATT_CMD_Q am: d1a9313471 am: 05bd66b651
Jakub Pawlowski [Wed, 7 Jun 2017 01:49:13 +0000 (01:49 +0000)]
use std::queue for keeping tGATT_CMD_Q am: d1a9313471 am: 05bd66b651
am: 8b37d9d337

Change-Id: I78e802eada40f4b5c29cb74fba580fed9b1c6ce7

7 years agoGet rid of clcb_idx in favour of pointers am: e4f42abab3
Jakub Pawlowski [Wed, 7 Jun 2017 01:47:00 +0000 (01:47 +0000)]
Get rid of clcb_idx in favour of pointers am: e4f42abab3
am: 5958c225ad

Change-Id: Iad5b0a28e81f8a7eb6e332c22481ae49656e975e

7 years agouse std::queue for keeping tGATT_CMD_Q am: d1a9313471
Jakub Pawlowski [Wed, 7 Jun 2017 01:46:46 +0000 (01:46 +0000)]
use std::queue for keeping tGATT_CMD_Q am: d1a9313471
am: 05bd66b651

Change-Id: I2face2724f4c52c14769bd1c79a6783f8e4c2d47

7 years agoGet rid of clcb_idx in favour of pointers
Jakub Pawlowski [Wed, 7 Jun 2017 01:44:28 +0000 (01:44 +0000)]
Get rid of clcb_idx in favour of pointers
am: e4f42abab3

Change-Id: Ie15226cacea4121d0bb7ca9a9cec732d0170f4f1

7 years agoRefactor tGATT_BG_CONN_DEV am: 7cfd8391f6 am: 77157460ba am: 7b55503837
Jakub Pawlowski [Wed, 7 Jun 2017 01:44:16 +0000 (01:44 +0000)]
Refactor tGATT_BG_CONN_DEV am: 7cfd8391f6 am: 77157460ba am: 7b55503837
am: 3491d92903

Change-Id: I1e69aa803d3e25080cd9e485e69eefe1918de025

7 years agouse std::queue for keeping tGATT_CMD_Q
Jakub Pawlowski [Wed, 7 Jun 2017 01:44:15 +0000 (01:44 +0000)]
use std::queue for keeping tGATT_CMD_Q
am: d1a9313471

Change-Id: I2708947e05fdf3835c23874af353349b203f11e4

7 years agoRefactor tGATT_BG_CONN_DEV am: 7cfd8391f6 am: 77157460ba
Jakub Pawlowski [Wed, 7 Jun 2017 01:41:42 +0000 (01:41 +0000)]
Refactor tGATT_BG_CONN_DEV am: 7cfd8391f6 am: 77157460ba
am: 7b55503837

Change-Id: I3f1ef7c9daea0aee2769cc4386eb32b2d8c3e96f

7 years agoRefactor tGATT_BG_CONN_DEV am: 7cfd8391f6
Jakub Pawlowski [Wed, 7 Jun 2017 01:39:45 +0000 (01:39 +0000)]
Refactor tGATT_BG_CONN_DEV am: 7cfd8391f6
am: 77157460ba

Change-Id: I0d5bc72270c5d7b2cd88cb5e91ace28a07e2cc99

7 years agoGet rid of clcb_idx in favour of pointers
Jakub Pawlowski [Wed, 31 May 2017 16:44:00 +0000 (09:44 -0700)]
Get rid of clcb_idx in favour of pointers

Test: compilation test
Change-Id: Ib2c4b13b85343693e6cff4a94eed49382e3aec00