OSDN Git Service

android-x86/system-bt.git
4 years agoUpdate file group names
Martin Brabham [Fri, 18 Oct 2019 20:59:24 +0000 (13:59 -0700)]
Update file group names

Bug: N/A
Test: builds
Change-Id: Ie33178a3397343d0a80959a9e39f2f4ba03d5734

4 years agoMerge "Add a fuzzer in bluetooth gd for l2cap dynamic channel allocator"
Treehugger Robot [Fri, 18 Oct 2019 00:34:20 +0000 (00:34 +0000)]
Merge "Add a fuzzer in bluetooth gd for l2cap dynamic channel allocator"

4 years agoAdd a fuzzer in bluetooth gd for l2cap dynamic channel allocator
Zongheng Wang [Wed, 16 Oct 2019 23:39:11 +0000 (16:39 -0700)]
Add a fuzzer in bluetooth gd for l2cap dynamic channel allocator

Initialized fuzz test for Bluetooth GD library. There is one fuzz target
gd/fuzz_test.cc and it will call all fuzz tests in gd.

Created a fuzzer for l2cap classic internal dynamic channel allocator to
test DynamicChannelAllocator::IsPsmUsed(Psm psm).

Bug: 142684649
Test: bluetooth_gd_fuzz_test
Change-Id: If7c66d6aefc5d52448824f7f96f3118607a37215

4 years agoConnect gd/neighbor into build system
Chris Manton [Thu, 17 Oct 2019 05:26:22 +0000 (22:26 -0700)]
Connect gd/neighbor into build system

Bug: 142060811
Test: Compiles but for realz
Change-Id: I719133c6466aab5b1813c9c2e49e7c1a4f29ca6b

4 years agoFix initiating_PHYS bit in HCI_LE_Extend_Create_Connection
Kevin Wang [Thu, 17 Oct 2019 06:18:57 +0000 (14:18 +0800)]
Fix initiating_PHYS bit in HCI_LE_Extend_Create_Connection

The initiating_PHYS bit in HCI_LE_Extend_Create_Connection should
be set properly according to the ability of bluetooth controller.
PHY_LE_CODED bit should be 0x04 instead of 0x03.

Test: Start to scan on settings then pick LE device to create bond

Bug: 142840872

Change-Id: Ia991ac2d4090629f0c20e41cdb2ab992aefcba72

4 years agoMerge "Inquiry module implementation"
Chris Manton [Thu, 17 Oct 2019 04:49:07 +0000 (04:49 +0000)]
Merge "Inquiry module implementation"

4 years agoMerge "Add connectability module"
Treehugger Robot [Thu, 17 Oct 2019 01:29:44 +0000 (01:29 +0000)]
Merge "Add connectability module"

4 years agoMerge changes Ib4c81ba3,I79bead5d
Treehugger Robot [Thu, 17 Oct 2019 00:35:16 +0000 (00:35 +0000)]
Merge changes Ib4c81ba3,I79bead5d

* changes:
  Add discoverability module
  Add page scan module

4 years agoMerge "Make hci::AclConnection aware of AddressType for LE Connections"
Treehugger Robot [Thu, 17 Oct 2019 00:04:14 +0000 (00:04 +0000)]
Merge "Make hci::AclConnection aware of AddressType for LE Connections"

4 years agoMerge "HFP: remove the dropped HF connection request message in btif connect_queue...
Treehugger Robot [Wed, 16 Oct 2019 23:53:22 +0000 (23:53 +0000)]
Merge "HFP: remove the dropped HF connection request message in btif connect_queue and advance to the next scheduled connection request."

4 years agoMerge "Classic inquiry scan API"
Treehugger Robot [Wed, 16 Oct 2019 23:35:11 +0000 (23:35 +0000)]
Merge "Classic inquiry scan API"

4 years agoAdd discoverability module
Chris Manton [Wed, 16 Oct 2019 23:11:11 +0000 (16:11 -0700)]
Add discoverability module

Bug: 142060811
Test: Compiles
Change-Id: Ib4c81ba3d4c30c30602d451c97609f7577e3e8e3

4 years agoAdd connectability module
Chris Manton [Wed, 16 Oct 2019 22:53:16 +0000 (15:53 -0700)]
Add connectability module

Bug: 142060811
Test: Compiles
Change-Id: I0afa5f6a29b8c9c4d2b3e7dd8df427549abe01d5

4 years agoAdd page scan module
Chris Manton [Wed, 16 Oct 2019 22:35:19 +0000 (15:35 -0700)]
Add page scan module

Bug: 142060811
Test: Compiles
Change-Id: I79bead5da3706520fd4c22c4e0e921d930bd5fb2

4 years agoInquiry module implementation
Chris Manton [Wed, 16 Oct 2019 17:26:32 +0000 (10:26 -0700)]
Inquiry module implementation

Bug: 142061208
Test: Compiles
Change-Id: Iead1e6dfe2c476ecd4671a99413527b9b628bb36

4 years agoClassic inquiry scan API
Chris Manton [Tue, 15 Oct 2019 16:42:29 +0000 (09:42 -0700)]
Classic inquiry scan API

Bug: 142061208
Test: API - Compiles
Change-Id: Ie7a5bda3f10bedefc412b50f61c593e496999596

4 years agoMerge "Inquiry and page scan common module"
Treehugger Robot [Wed, 16 Oct 2019 21:02:57 +0000 (21:02 +0000)]
Merge "Inquiry and page scan common module"

4 years agoMake hci::AclConnection aware of AddressType for LE Connections
Jakub Pawlowski [Wed, 16 Oct 2019 12:54:53 +0000 (14:54 +0200)]
Make hci::AclConnection aware of AddressType for LE Connections

Bug: 142341141
Change-Id: I64e3e3265195d10e488e9c25d369d9c458ad67cc

4 years agoMerge "Add Page Write commands"
Treehugger Robot [Wed, 16 Oct 2019 19:42:45 +0000 (19:42 +0000)]
Merge "Add Page Write commands"

4 years agoMerge "Support inquiry commands and tests"
Chris Manton [Wed, 16 Oct 2019 16:10:21 +0000 (16:10 +0000)]
Merge "Support inquiry commands and tests"

4 years agoHFP: remove the dropped HF connection request message in btif connect_queue and advan...
jonerlin [Mon, 23 Sep 2019 15:25:48 +0000 (23:25 +0800)]
HFP: remove the dropped HF connection request message in btif connect_queue and advance to the next scheduled connection request.

* hf connect-request message does not be handled in btif connect_queue when remote headset has already reconnected hfp, but it did not be removed, either.
it will make subsequent connecting request messsages blocked in btif connect_queue and never be handled.
* Add unit test for btif_profile_queue to verify the case when connect_cb() returns non BT_STATUS_SUCCESS

Bug: 140846154
Test: Connected 2 headset (HS1, HS2) -> Disable Bluetooth and Turn Off
HS2 ->  Enable Bluetooth and Turn On HS2 -> Check hfp and a2dp profole
state after HS2 connected

Change-Id: I503fba1975054efe3180ecf1f7daa917fb6edf99

4 years agoSecurityModule boilerplate code
Jakub Pawlowski [Thu, 10 Oct 2019 12:36:29 +0000 (14:36 +0200)]
SecurityModule boilerplate code

This is boilerplate code for SecurityModule and SecurityManager

Bug: 142341141
Test: no test yet
Change-Id: Ie08c8ef7ee78e71a9c61dff6b45192ce0e1c3f1c

4 years agoMerge "HID host: Support SET REPORT"
Treehugger Robot [Wed, 16 Oct 2019 03:16:12 +0000 (03:16 +0000)]
Merge "HID host: Support SET REPORT"

4 years agoAdd Page Write commands
Chris Manton [Tue, 15 Oct 2019 23:02:42 +0000 (16:02 -0700)]
Add Page Write commands

Bug: 142060811
Test: bluetooth_test_gd

Change-Id: I270715f9b8d8872f303aea76d70d25cef407b965

4 years agoSupport inquiry commands and tests
Chris Manton [Mon, 14 Oct 2019 20:11:55 +0000 (13:11 -0700)]
Support inquiry commands and tests

Bug: 142061208
Test: bluetooth_test_gd
Change-Id: I53de39850c985f2d63cda21ad0e16686dba0b5ac

4 years agoHCI: Add LE advertising and scanning interfaces
Myles Watson [Mon, 14 Oct 2019 23:23:38 +0000 (16:23 -0700)]
HCI: Add LE advertising and scanning interfaces

Bug: 139080884
Test: builds
Change-Id: Iea96dc023e2e59f9969b65208881a9f407d4b461

4 years agoMerge "Add property check for gd shim entry"
Treehugger Robot [Tue, 15 Oct 2019 01:38:56 +0000 (01:38 +0000)]
Merge "Add property check for gd shim entry"

4 years agoInquiry and page scan common module
Chris Manton [Mon, 14 Oct 2019 23:14:30 +0000 (16:14 -0700)]
Inquiry and page scan common module

Bug: 142061208
Test: Builds successfully
Change-Id: I0ca7afb996490fff71030bf949ea9647924fd458

4 years agoAdd property check for gd shim entry
Chris Manton [Fri, 11 Oct 2019 02:44:06 +0000 (19:44 -0700)]
Add property check for gd shim entry

Bug: 14042172
Test: Ensure boot into both stacks
Test: adb shell stop; adb shell setprop bluetooth.gd.enabled 1 ; adb shell start
Test: adb shell stop; adb shell setprop bluetooth.gd.enabled 0 ; adb shell start

Change-Id: Ied131f5444dd33201197e9f19d0f4bc88c069f8c

4 years agoRename "smp" to "security"
Jakub Pawlowski [Mon, 14 Oct 2019 12:49:55 +0000 (14:49 +0200)]
Rename "smp" to "security"

SMP is just name of protocol used for one aspect of security management.
Rename the namespace in order to avoid any further confusions.

Test: compliation
Bug: 142341141
Change-Id: Id505fa3cd4b653c8486db2bca5f82233e731ec51

4 years ago[system][bt] fix -Wreorder-init-list again
Nick Desaulniers [Fri, 11 Oct 2019 21:50:44 +0000 (14:50 -0700)]
[system][bt] fix -Wreorder-init-list again

C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Change-Id: I7dc825e2cdb0777b1be01df0a41adf9b3b644ff5

4 years agoMerge changes I30972458,I62dd309d
Nick Desaulniers [Fri, 11 Oct 2019 15:51:01 +0000 (15:51 +0000)]
Merge changes I30972458,I62dd309d

* changes:
  [system][bt] fix -Wdangling-gsl
  [system][bt] fix -Wreorder-init-list

4 years agoMerge "L2CAP classic signalling handler, data pipeline, and cert test"
Treehugger Robot [Fri, 11 Oct 2019 00:21:11 +0000 (00:21 +0000)]
Merge "L2CAP classic signalling handler, data pipeline, and cert test"

4 years ago[system][bt] fix -Wdangling-gsl
Nick Desaulniers [Thu, 10 Oct 2019 21:04:47 +0000 (14:04 -0700)]
[system][bt] fix -Wdangling-gsl

BtAddrString() returns a std::string. It's not safe to chain a call to
c_str() as otherwise the returned std::string is a temporary, and the
expression evaluates to an immediately dangling pointer.

Bug: 139945549
Test: mm
Change-Id: I30972458abcc563b24ee0d80b289c3efd6c3e04d
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
4 years ago[system][bt] fix -Wreorder-init-list
Nick Desaulniers [Wed, 9 Oct 2019 18:06:55 +0000 (11:06 -0700)]
[system][bt] fix -Wreorder-init-list

C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Change-Id: I62dd309d5749c74c18e4291e7d1cef1f3587bf41
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
4 years agoMerge "[system][bt][gd] fix -Wreorder-init-list"
Treehugger Robot [Wed, 9 Oct 2019 21:18:10 +0000 (21:18 +0000)]
Merge "[system][bt][gd] fix -Wreorder-init-list"

4 years ago[system][bt][gd] fix -Wreorder-init-list
Nick Desaulniers [Wed, 9 Oct 2019 18:06:55 +0000 (11:06 -0700)]
[system][bt][gd] fix -Wreorder-init-list

C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Change-Id: I4ed1a2c2865cfa26b45db970202340ae582ba78d
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
4 years agoL2CAP classic signalling handler, data pipeline, and cert test
Hansong Zhang [Fri, 20 Sep 2019 22:50:42 +0000 (15:50 -0700)]
L2CAP classic signalling handler, data pipeline, and cert test

Supports listening to an incoming L2CAP connection, open the channel and
transfer data.

Test: bluetooth_test_gd and cert/run_cert.sh
Bug: 138260719
Change-Id: I5a1b93dc30b43bb149c32e5f4ef5404f2d091cdb

4 years agohci_pdl: Inquiry commands
Chris Manton [Fri, 4 Oct 2019 00:31:12 +0000 (17:31 -0700)]
hci_pdl: Inquiry commands

Test: Run and verify on actual device
Bug: 142061208

Change-Id: I7d99aec75691528da75a563943d0db01cb2e3920

4 years agoHCI: Add GAP data to advertising packets
Myles Watson [Tue, 9 Jul 2019 22:24:54 +0000 (15:24 -0700)]
HCI: Add GAP data to advertising packets

Test: Build
Change-Id: I7ebc7d190c4bfc5ae0635bdfbd35b7e8a147ba96

4 years agoPDL: Add padding fields
Myles Watson [Fri, 4 Oct 2019 22:59:41 +0000 (15:59 -0700)]
PDL: Add padding fields

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I6b020b2d47565e8e724e8114a2031be71e8a22ec

4 years agoPDL: Support Type Length Value in Structs
Myles Watson [Thu, 3 Oct 2019 22:48:29 +0000 (15:48 -0700)]
PDL: Support Type Length Value in Structs

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: If2a83908c507f37915e9a8520a1797cf5fc704a5

4 years agoPDL: Allow parent packets with no parameters
Myles Watson [Fri, 4 Oct 2019 23:01:07 +0000 (16:01 -0700)]
PDL: Allow parent packets with no parameters

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I75e7c3a5d5bc653cc5df29ec406238cf9adf8cfc

4 years agoPDL: Add an error for redefinition
Myles Watson [Fri, 4 Oct 2019 00:22:39 +0000 (17:22 -0700)]
PDL: Add an error for redefinition

Bug: 138260498
Test: define a duplicate type and compile
Change-Id: I54c4016d6eabf1b969b12616d4b88e3f2b593c9e

4 years agoPDL: Use fixed portion of dynamic sizes for arrays
Myles Watson [Fri, 4 Oct 2019 23:02:38 +0000 (16:02 -0700)]
PDL: Use fixed portion of dynamic sizes for arrays

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I271f3bd2c7eef13379fe3e0c059d82e2d1ddd37a

4 years agoMerge "GD HCI: add unittest for LeConnectionCallbacks"
Treehugger Robot [Fri, 4 Oct 2019 13:16:01 +0000 (13:16 +0000)]
Merge "GD HCI: add unittest for LeConnectionCallbacks"

4 years agoGD HCI: add unittest for LeConnectionCallbacks
Chienyuan [Thu, 3 Oct 2019 08:39:02 +0000 (16:39 +0800)]
GD HCI: add unittest for LeConnectionCallbacks

Test: run bluetooth_test_gd
Change-Id: Ibb1255a7f3736ade798825751c6063d5ed2f0455

4 years agoSplit L2CAP Classic and LE stacks into separate modules
Jack He [Fri, 4 Oct 2019 00:11:07 +0000 (17:11 -0700)]
Split L2CAP Classic and LE stacks into separate modules

* Although L2CAP LE and Classic stacks look similar, they are actually very different when diving into details
* Splitting them into two separate modules will benefit in the following ways:
 * One can start a LE only stack
 * One can turn off Classic stack entirely when not needed
 * Dependencies are more obvious, e.g. LE-CoC only depends on LE L2CAP and A2DP only depends on Classic L2CAP
* Changed test names as GTEST does not allow test name collisions
* New directory structure after the change:
  - l2cap: common headers that should be exposed to public
    - internal: common internal libraries shared between LE and classic
    - classic: classic headers that should be exposed to public
      - internal: internal libraries for classic
      - cert: certification stack for classic
   - le: LE headers that should be exposed to public
      - internal: internal libraries for LE
      - cert: certification stack for LE

Using Bash
 for file in classic_*; do git mv "$file" "classic/${file/classic_/}"; done
 for file in le_*; do git mv "$file" "le/${file/le_/}"; done
 for file in internal/le_*; do git mv "$file" "le/${file/le_/}"; done
 for file in internal/classic_*; do git mv "$file" "classic/${file/classic_/}"; done
 for file in classic/*; do if [ -f "$file" ]; then sed -i -e 's/Classic//g' "$file"; fi; done
 for file in classic/internal/*; do if [ -f "$file" ]; then sed -i -e 's/Classic//g' "$file"; fi; done
 for file in le/*; do if [ -f "$file" ]; then sed -i -e 's/Le//g' "$file"; fi; done
 for file in le/internal/*; do if [ -f "$file" ]; then sed -i -e 's/Le//g' "$file"; fi; done

Using IDE:
 replace "namespace l2cap {" with "namespace l2cap { namespace classic {" in classic/
 replace "}  // namespace l2cap" with "} }" in classic/
 replace "namespace l2cap {" with "namespace l2cap { namespace le {" in le/
 replace "}  // namespace l2cap" with "} }" in le/
 replace "l2cap/classic_" with "l2cap/classic/" in classic/
 replace "l2cap/internal/classic_" with "l2cap/classic/internal/" in classic/
 replace "l2cap/le_" with "l2cap/le/" in le/
 replace "l2cap/internal/le_" with "l2cap/le/internal/" in le/

Bug: 140938432
Test: bluetooth_test_gd
Change-Id: I29eafefc5b6be4033e5db811776230d28ca312b2

4 years agoMerge "PDL: Add GetStructOffset and GetStructSize"
Treehugger Robot [Thu, 3 Oct 2019 20:53:23 +0000 (20:53 +0000)]
Merge "PDL: Add GetStructOffset and GetStructSize"

4 years agoMerge "L2cap dynamic channel and service"
Treehugger Robot [Thu, 3 Oct 2019 20:19:24 +0000 (20:19 +0000)]
Merge "L2cap dynamic channel and service"

4 years agoMerge changes I62125269,Icbe89252
Treehugger Robot [Thu, 3 Oct 2019 19:59:53 +0000 (19:59 +0000)]
Merge changes I62125269,Icbe89252

* changes:
  PDL: Use Size for StructField sizes
  PDL: Pass the size to GenBounds

4 years agoMerge "PDL: Add for_struct to GenExtractor"
Treehugger Robot [Thu, 3 Oct 2019 19:52:22 +0000 (19:52 +0000)]
Merge "PDL: Add for_struct to GenExtractor"

4 years agoMerge "Update WriteInquiryScanActivity"
Treehugger Robot [Thu, 3 Oct 2019 18:28:01 +0000 (18:28 +0000)]
Merge "Update WriteInquiryScanActivity"

4 years agoUpdate WriteInquiryScanActivity
Chris Manton [Thu, 3 Oct 2019 04:54:41 +0000 (21:54 -0700)]
Update WriteInquiryScanActivity

Test: Compiles
Bug: 142061208

Change-Id: I969e94e393812528ec4ba38a87b4055bc42c67d3

4 years agoMerge "Add Read Number of Supported Iac complete"
Treehugger Robot [Thu, 3 Oct 2019 18:25:11 +0000 (18:25 +0000)]
Merge "Add Read Number of Supported Iac complete"

4 years agoMerge "Add Read Page Timeout Complete View"
Treehugger Robot [Thu, 3 Oct 2019 18:24:23 +0000 (18:24 +0000)]
Merge "Add Read Page Timeout Complete View"

4 years agoPDL: Add GetStructOffset and GetStructSize
Myles Watson [Thu, 3 Oct 2019 16:08:34 +0000 (09:08 -0700)]
PDL: Add GetStructOffset and GetStructSize

Structs are parsed all at once, so they don't need as much
information as packets.

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I49d433332874514d2cc1c5779865437fab5533b4

4 years agoPDL: Use Size for StructField sizes
Myles Watson [Thu, 3 Oct 2019 16:05:13 +0000 (09:05 -0700)]
PDL: Use Size for StructField sizes

Structs can have dynamic sizes, which need to be passed in.

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I621252699b597e728ff1566b95babd98cf00e8d4

4 years agoPDL: Pass the size to GenBounds
Myles Watson [Wed, 2 Oct 2019 22:07:05 +0000 (15:07 -0700)]
PDL: Pass the size to GenBounds

There are different sizes, depending on where GenBounds is called.

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: Icbe892529919fdad0f0b98a3b66a2b24cb25f910

4 years agoPDL: Add for_struct to GenExtractor
Myles Watson [Wed, 2 Oct 2019 22:01:15 +0000 (15:01 -0700)]
PDL: Add for_struct to GenExtractor

Enable field-specific size checks when parsing structs.

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I3a8d132d1277fda027d5a6df61cdfb55b5519e02

4 years agoLegacy portion of btm shim layer
Chris Manton [Tue, 1 Oct 2019 18:26:49 +0000 (11:26 -0700)]
Legacy portion of btm shim layer

bug: 141963466
Test: Boots into old stack; no crash in new stack

Change-Id: I021a7f2f446a17bc4f1c1fbbd36cf1227ca6705e

4 years agoL2cap dynamic channel and service
Hansong Zhang [Tue, 10 Sep 2019 23:12:05 +0000 (16:12 -0700)]
L2cap dynamic channel and service

Add internal implementation for ClassicDynamicChannel
Signalling packets will be handled in next commit

Test: cert/run_cert.sh and bluetooth_test_gd
Bug: 138260719
Change-Id: I3b0fee9837034988e6490372ffbfd5ece90250f7

4 years agoMerge "GD HCI: implement connection management commands of AclManager"
Myles Watson [Thu, 3 Oct 2019 13:12:16 +0000 (13:12 +0000)]
Merge "GD HCI: implement connection management commands of AclManager"

4 years agoGD HCI: implement connection management commands of AclManager
Chienyuan [Wed, 2 Oct 2019 07:18:55 +0000 (15:18 +0800)]
GD HCI: implement connection management commands of AclManager

Bug: 139700781
Test: run_device_cert.sh
Change-Id: Ic8d91568114419f3c7508a252887aca32cec316f

4 years agoMerge "Legacy portion of l2cap shim layer"
Chris Manton [Thu, 3 Oct 2019 04:03:46 +0000 (04:03 +0000)]
Merge "Legacy portion of l2cap shim layer"

4 years agoMerge "ServiceDiscoveryProtocol DB Full"
Joseph Pirozzo [Thu, 3 Oct 2019 00:03:52 +0000 (00:03 +0000)]
Merge "ServiceDiscoveryProtocol DB Full"

4 years agoAdd Read Number of Supported Iac complete
Chris Manton [Wed, 2 Oct 2019 23:51:58 +0000 (16:51 -0700)]
Add Read Number of Supported Iac complete

Test: Compiles
Change-Id: If3944596f1196483522f0f52819d2a2ec52f2e14

4 years agoMerge "L2CAP: Use VariableSizeStruct in config options"
Myles Watson [Wed, 2 Oct 2019 23:52:16 +0000 (23:52 +0000)]
Merge "L2CAP: Use VariableSizeStruct in config options"

4 years agoAdd Read Page Timeout Complete View
Chris Manton [Wed, 2 Oct 2019 23:13:31 +0000 (16:13 -0700)]
Add Read Page Timeout Complete View

Test: Compiles
Change-Id: I63d9ac31ba47c4914498854a62939b067103bced

4 years agoLegacy portion of l2cap shim layer
Chris Manton [Mon, 30 Sep 2019 17:52:55 +0000 (10:52 -0700)]
Legacy portion of l2cap shim layer

bug: 141759087
Test: Boots into old stack; no crash in new stack
Change-Id: I0455bb67e12a9751084a6aaef61760a4ce2d77b7

4 years agoMerge "Use the same fixed channel allocator for both Classic and LE connections"
Treehugger Robot [Wed, 2 Oct 2019 20:56:32 +0000 (20:56 +0000)]
Merge "Use the same fixed channel allocator for both Classic and LE connections"

4 years agoMerge "Implement LE L2CAP Fixed Channel"
Treehugger Robot [Wed, 2 Oct 2019 20:55:24 +0000 (20:55 +0000)]
Merge "Implement LE L2CAP Fixed Channel"

4 years agoL2CAP: Use VariableSizeStruct in config options
Myles Watson [Thu, 11 Jul 2019 23:17:05 +0000 (16:17 -0700)]
L2CAP: Use VariableSizeStruct in config options

Test: l2cap_packets_test
Change-Id: I8876dfe91a2bd059156131b51ba6609e112c64e8

4 years agoPDL: Only find offsets from the beginning for structs
Myles Watson [Tue, 1 Oct 2019 17:09:15 +0000 (10:09 -0700)]
PDL: Only find offsets from the beginning for structs

Test: bluetooth_packet_parser_test
Change-Id: I9c7286ad8fa04b1b9cff3062730da0a5778938bd

4 years agoPDL: Inline ParseStruct functions
Myles Watson [Wed, 2 Oct 2019 00:08:29 +0000 (17:08 -0700)]
PDL: Inline ParseStruct functions

Bug: 138260498
Test: bluetooth_packet_parser_test
Change-Id: I9656f00bf3e1ca8a26def02df030ca1fa8f87151

4 years agoUse the same fixed channel allocator for both Classic and LE connections
Jack He [Wed, 2 Oct 2019 03:44:04 +0000 (20:44 -0700)]
Use the same fixed channel allocator for both Classic and LE connections

* Merge identical logic for fixed channel allocation among Classic and
  LE fixed channel connections
* Use Classic mocks as a place holder to write tests for
  L2capFixedChannelAllocatorTest

Test: bluetooth_test_gd
Bug: 140938432
Change-Id: Ibff6cb2c3120d967efe828e91cb8f9f2bdefc398

4 years agoImplement LE L2CAP Fixed Channel
Jack He [Fri, 27 Sep 2019 01:27:41 +0000 (18:27 -0700)]
Implement LE L2CAP Fixed Channel

* Implemented LE fixed channel implementation with reference from classic
  fixed channel implementation
* Adjusted LE specific logic in link manager and other related
  components
* Added address type across the LE fixed channel stack
* Adjusted unit test for LE fixed channel cases

Bug: 140938432
Test: bluetooth_test_gd
Change-Id: I7c5cd27e917efa1e72dce05828c26146c10797c2

4 years agoL2CAP Classic dynamic channel and allocator impl
Hansong Zhang [Tue, 1 Oct 2019 18:06:32 +0000 (11:06 -0700)]
L2CAP Classic dynamic channel and allocator impl

Reland I15f40c6b55d180003afaa14252c576b1b2a5e25e L2CAP Classic dynamic
channel and allocator impl, with the fix of NPE

Test: bluetooth_test_gd and cert/run_cert.sh
Bug: 138260719
Change-Id: I5c42dcb5871086903ac0f87441235ff75bfc8fdf

4 years agoServiceDiscoveryProtocol DB Full
Joseph Pirozzo [Tue, 1 Oct 2019 21:13:29 +0000 (14:13 -0700)]
ServiceDiscoveryProtocol DB Full

Increase the size of the local SDP DB to cope with newer phones supporting
more Bluetooth profiles.

Bug: 141889288
Test: pair Bluetooth device verify no warning "SDP - DB full add_attr"
Change-Id: I823ea6e178f098a0441efde4fb7d8e7fb68e38c0

4 years agoMerge "PDL: Enforce ENUM_STYLE"
Treehugger Robot [Tue, 1 Oct 2019 17:19:27 +0000 (17:19 +0000)]
Merge "PDL: Enforce ENUM_STYLE"

4 years agoMerge "PDL: Add variable-sized structs"
Treehugger Robot [Tue, 1 Oct 2019 07:45:41 +0000 (07:45 +0000)]
Merge "PDL: Add variable-sized structs"

4 years agoMerge "Prevent bluetooth native crash during failed security authentication"
Treehugger Robot [Tue, 1 Oct 2019 07:11:42 +0000 (07:11 +0000)]
Merge "Prevent bluetooth native crash during failed security authentication"

4 years agoPDL: Enforce ENUM_STYLE
Myles Watson [Mon, 30 Sep 2019 20:27:20 +0000 (13:27 -0700)]
PDL: Enforce ENUM_STYLE

Test: Compile a PDL file with CamelCase enum values
Change-Id: I11dbda43479550629ea539cb91941b0dabe79889

4 years agoPDL: Add variable-sized structs
Myles Watson [Wed, 25 Sep 2019 22:33:39 +0000 (15:33 -0700)]
PDL: Add variable-sized structs

Test: bluetooth_packet_parser_test
Change-Id: Ib003d3b9e125167c14c89bdca316d013dee9bd0d

4 years agoRevert "L2CAP Classic dynamic channel and allocator impl"
Hansong Zhang [Mon, 30 Sep 2019 20:56:51 +0000 (20:56 +0000)]
Revert "L2CAP Classic dynamic channel and allocator impl"

This reverts commit 76559c16d6f1899495e601644363556eb587feea.

Reason for revert: Broke test!

Change-Id: If0ef8fc64ba16c7bded9d4849d5b09a4217489bf

4 years agoL2CAP Classic dynamic channel and allocator impl
Hansong Zhang [Fri, 20 Sep 2019 21:25:59 +0000 (14:25 -0700)]
L2CAP Classic dynamic channel and allocator impl

Test: bluetooth_test_gd and cert/run_cert.sh
Bug: 138260719
Change-Id: I15f40c6b55d180003afaa14252c576b1b2a5e25e

4 years agoMerge "GD HCI: Add unittest for AclConnection"
Treehugger Robot [Fri, 27 Sep 2019 17:37:40 +0000 (17:37 +0000)]
Merge "GD HCI: Add unittest for AclConnection"

4 years agoPrevent bluetooth native crash during failed security authentication
jonerlin [Tue, 27 Aug 2019 17:12:41 +0000 (01:12 +0800)]
Prevent bluetooth native crash during failed security authentication

* Use-after-free issue cause Bluetooth native crash during failed security authentication
* fixes a regression caused by commit SHA 26d629c

Bug: 137828534
Test: pair with Bluetooth keyboard/carkit -> input incorrect PIN code.
Change-Id: Ia1f7dad678fc71ebf4af6b943c6a9e6102e67592

4 years agoGD HCI: Add unittest for AclConnection
Chienyuan [Fri, 27 Sep 2019 09:27:27 +0000 (17:27 +0800)]
GD HCI: Add unittest for AclConnection

Bug: 139700781
Test: run bluetooth_test_gd
Change-Id: I4bef1ad26b2cd4bc81e572b513852d94a8898899

4 years agoMerge "Change sec_state before resend pending command"
Treehugger Robot [Fri, 27 Sep 2019 06:58:01 +0000 (06:58 +0000)]
Merge "Change sec_state before resend pending command"

4 years agoChange sec_state before resend pending command
Vic Huang [Sun, 15 Sep 2019 09:59:17 +0000 (17:59 +0800)]
Change sec_state before resend pending command

Description:
When phone trigger rfcomm create connection during pairing, the create
connection command will be saved to pending command array and wait for
resend.
When authentication completed, btm_sec_change_pairing_state is called to
change the pair state to idle and then resend the command in pending
command array if any. After that, stack set the sec_state to idle if
needed. (If sec_state is not idle, it means we are authenticating or
encrypting)

The issue is the resend command will not work as expected in function
btm_sec_execute_procedure because sec_state is not set to idle yet.

Solution:
Reorder the flow in btm_sec_auth_complete to make sure sec_state set to
idle if needed before invoking btm_sec_change_pairing_state(which resend
the command in the pending command array). And also set sec_flags to
BTM_SEC_AUTHENTICATED to avoid redundant authentication.

Bug: 131108715
Test: run sl4a to create rfcomm connection during pairing
(cmd)bta_bond
(cmd)rfcomm_connect <uuid>

Change-Id: I2521225610506db294d2ad8769f256705a4afaaa

4 years agoL2CAP dynamic channel API
Hansong Zhang [Fri, 20 Sep 2019 21:14:01 +0000 (14:14 -0700)]
L2CAP dynamic channel API

Add API for Classic Dynamic Channel
Test: cert/run_cert.sh and bluetooth_test_gd
Bug: 138260719

Change-Id: I7afb0d7e540ae1c133c967045163e400f86e312a

4 years agoMerge "Disable leak detection locally."
Steven Moreland [Thu, 26 Sep 2019 18:48:54 +0000 (18:48 +0000)]
Merge "Disable leak detection locally."

4 years agoMerge changes I6266c445,I0d9e9296
Myles Watson [Thu, 26 Sep 2019 17:05:05 +0000 (17:05 +0000)]
Merge changes I6266c445,I0d9e9296

* changes:
  A2DP: Don't wait for role switch when unsupported by the BT SoC
  A2DP: Don't wait for role switch on a blacklisted device

4 years agoA2DP: Don't wait for role switch when unsupported by the BT SoC
Cheney Ni [Thu, 26 Sep 2019 13:48:02 +0000 (21:48 +0800)]
A2DP: Don't wait for role switch when unsupported by the BT SoC

Bug: 141678907
Test: Do A2DP playback manually
Change-Id: I6266c44562da861cd342d040e0802cd832e4accb

4 years agoMerge "Rename to bluetooth_stack_with_facade"
Treehugger Robot [Thu, 26 Sep 2019 15:45:45 +0000 (15:45 +0000)]
Merge "Rename to bluetooth_stack_with_facade"

4 years agoA2DP: Don't wait for role switch on a blacklisted device
Cheney Ni [Wed, 25 Sep 2019 13:33:25 +0000 (21:33 +0800)]
A2DP: Don't wait for role switch on a blacklisted device

When there are 2 or more ACL links, we will try to be the master for
better link quality, and setup flags to wait for the following role
switch results. Because this is an asynchronous task, we would check
flags for any further actions. However, there would not be other results
for role switch IOP, and could be just ignored.

Bug: 141177108
Test: Add headset to IOP and do A2DP playback manually
Change-Id: I0d9e92968765365410909908ffcaf6dc81161ea0

4 years agoMerge "PDL: Use std::optional to signal Parse failure"
Treehugger Robot [Thu, 26 Sep 2019 15:42:44 +0000 (15:42 +0000)]
Merge "PDL: Use std::optional to signal Parse failure"

4 years agoMerge "RootCanal: Add Classic Connection Management commands"
Treehugger Robot [Thu, 26 Sep 2019 13:39:35 +0000 (13:39 +0000)]
Merge "RootCanal: Add Classic Connection Management commands"

4 years agoRootCanal: Add Classic Connection Management commands
Chienyuan [Wed, 25 Sep 2019 11:23:21 +0000 (19:23 +0800)]
RootCanal: Add Classic Connection Management commands

Bug: 139700781
Test: run_cert.sh
Change-Id: Ic4781d155eec74be98f2d178a60169cc0b360a4d