OSDN Git Service

android-x86/system-bt.git
3 years agogd HCI: Do not reset alarm when unregister_client
Chienyuan [Wed, 25 Nov 2020 09:31:40 +0000 (17:31 +0800)]
gd HCI: Do not reset alarm when unregister_client

Tag: #gd-refactor
Bug: 173770236
Test: cert/run --host;
Change-Id: I715bcf366db4845d6e84d88e97b95f9bd230c97d

3 years agoMerge "gd: implement APIs of Advertising for Legacy"
Treehugger Robot [Tue, 24 Nov 2020 22:27:08 +0000 (22:27 +0000)]
Merge "gd: implement APIs of Advertising for Legacy"

3 years agoL2cap shim: Remove unused API
Hansong Zhang [Fri, 20 Nov 2020 00:14:48 +0000 (16:14 -0800)]
L2cap shim: Remove unused API

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Change-Id: I02b5f3779b37cdfa5426df0a447016a86a34c3bc

3 years agoMerge changes I560edb20,Id8f90a59,If35e7bfc
Zach Johnson [Tue, 24 Nov 2020 17:20:28 +0000 (17:20 +0000)]
Merge changes I560edb20,Id8f90a59,If35e7bfc

* changes:
  rusty-gd: some tidying up in rootcanal_hal
  rusty-gd: Add cxx interop layer for the BT HIDL HAL
  eusty-gd: Add timerfd-based timing abstractions

3 years agoMerge changes Iac8f6a8e,I85f0dac1
Treehugger Robot [Tue, 24 Nov 2020 17:19:53 +0000 (17:19 +0000)]
Merge changes Iac8f6a8e,I85f0dac1

* changes:
  rusty-gd: GDDI now caches instances & allows injecting config
  rusty-gd: initial commit for GDDI

3 years agoMerge changes I738f2a13,Id0f99289,Iefd5b0c7,I61013efd,I6f8b8ae8, ...
Treehugger Robot [Tue, 24 Nov 2020 17:15:06 +0000 (17:15 +0000)]
Merge changes I738f2a13,Id0f99289,Iefd5b0c7,I61013efd,I6f8b8ae8, ...

* changes:
  acl_disconnect_after_role_switch:Check for valid acl
  enum-ify stack/gatt/gatt_int::GATT_CH_STATE
  Catch and release ignored btif gatt events
  Remove unused #def stack/include/gatt_api::GATT_CONN_FAIL_ESTABLISH
  Add LOG_DUMPSYS[_TITLE]
  gd: Add acl manager dumpsys data
  Introduce btm circular buffer history
  Add hci error code ROLE_SWITCH_FAILED
  Flush out BtaIdSysText
  Remove unused #include
  Proper const API for stack/include/bt_type::bd_features_text
  Add stack/l2cap/l2c_int::link_state_text
  Expose shim acl remote address accessors
  Re-log stack/l2cap/l2c_api::L2CA_RegisterLECoc
  Re-log stack/l2cap/l2c_api::L2CA_Register

3 years agogd: implement APIs of Advertising for Legacy
Chienyuan [Tue, 24 Nov 2020 11:54:14 +0000 (19:54 +0800)]
gd: implement APIs of Advertising for Legacy

Tag: #gd-refactor
Bug: 169125803
Test: cert/run --host
Test: atest --host bluetooth_test_gd
Change-Id: I317b75c93619f99df6ff40b46fbb44c23e21f437

3 years agoMerge "btm: Add API to check peer's 2M PHY support"
Jakub Pawlowski [Tue, 24 Nov 2020 08:26:58 +0000 (08:26 +0000)]
Merge "btm: Add API to check peer's 2M PHY support"

3 years agobtsnoop_net: Fix instruction for btsnoop logs
Łukasz Rymanowski [Fri, 8 May 2020 23:08:56 +0000 (01:08 +0200)]
btsnoop_net: Fix instruction for btsnoop logs

Change-Id: Ib014a39f108c7e947f0bbf589d6c3c8b15d4bb7d

3 years agoMerge "btaa: undo btaa implementation is fluoride stack"
Michael Sun [Tue, 24 Nov 2020 07:19:51 +0000 (07:19 +0000)]
Merge "btaa: undo btaa implementation is fluoride stack"

3 years agoacl_disconnect_after_role_switch:Check for valid acl
Chris Manton [Mon, 23 Nov 2020 22:54:36 +0000 (14:54 -0800)]
acl_disconnect_after_role_switch:Check for valid acl

Bug: 173763477
Test: gd/cert/run --host
Tag: #refactor

Change-Id: I738f2a13e3378bc924315eff9ef9ffb95be20af7

3 years agoenum-ify stack/gatt/gatt_int::GATT_CH_STATE
Chris Manton [Thu, 19 Nov 2020 21:57:40 +0000 (13:57 -0800)]
enum-ify stack/gatt/gatt_int::GATT_CH_STATE

Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: Id0f99289b4919211056d6565abe293b0b4eee179

3 years agoCatch and release ignored btif gatt events
Chris Manton [Thu, 12 Nov 2020 23:41:18 +0000 (15:41 -0800)]
Catch and release ignored btif gatt events

Prevents false logging errors

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: Iefd5b0c748f61f79c87d23b2da37f285b4df1a96

3 years agoRemove unused #def stack/include/gatt_api::GATT_CONN_FAIL_ESTABLISH
Chris Manton [Wed, 18 Nov 2020 20:58:39 +0000 (12:58 -0800)]
Remove unused #def stack/include/gatt_api::GATT_CONN_FAIL_ESTABLISH

Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I61013efd964bffd125990fe3031a58fa8a3a68a3

3 years agoAdd LOG_DUMPSYS[_TITLE]
Chris Manton [Sun, 22 Nov 2020 22:48:52 +0000 (14:48 -0800)]
Add LOG_DUMPSYS[_TITLE]

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I6f8b8ae83c220324c5f99ce1f06178c13803913d

3 years agogd: Add acl manager dumpsys data
Chris Manton [Sun, 22 Nov 2020 02:58:55 +0000 (18:58 -0800)]
gd: Add acl manager dumpsys data

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I4f47237754a9d16d1653f24a9d223b2a42f97543

3 years agoIntroduce btm circular buffer history
Chris Manton [Mon, 23 Nov 2020 23:23:38 +0000 (15:23 -0800)]
Introduce btm circular buffer history

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: If9ed3213f8a8a96a1ea5d6ad530c7952bf312346

3 years agoAdd hci error code ROLE_SWITCH_FAILED
Chris Manton [Mon, 23 Nov 2020 23:08:30 +0000 (15:08 -0800)]
Add hci error code ROLE_SWITCH_FAILED

Seen in the wild with Bose soundtouch

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I29007526787876f148d664d95ffadaa5e52551d0

3 years agoFlush out BtaIdSysText
Chris Manton [Mon, 23 Nov 2020 22:54:26 +0000 (14:54 -0800)]
Flush out BtaIdSysText

All active bta services seen in the wild

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: Ifafad64e23013bac9f2df1ef13292549bbd13404

3 years agoRemove unused #include
Chris Manton [Sun, 22 Nov 2020 22:48:32 +0000 (14:48 -0800)]
Remove unused #include

Toward readable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I0c1262f796c633242313fd7b507d315ebfc618d3

3 years agoProper const API for stack/include/bt_type::bd_features_text
Chris Manton [Sun, 22 Nov 2020 17:00:47 +0000 (09:00 -0800)]
Proper const API for stack/include/bt_type::bd_features_text

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I2d9700ce398963bfe90602d995ea4faedf082329

3 years agoAdd stack/l2cap/l2c_int::link_state_text
Chris Manton [Fri, 20 Nov 2020 20:31:46 +0000 (12:31 -0800)]
Add stack/l2cap/l2c_int::link_state_text

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: If32f14beece68e85f7cbf345a3f694c1f2553bdb

3 years agoExpose shim acl remote address accessors
Chris Manton [Mon, 23 Nov 2020 05:30:59 +0000 (21:30 -0800)]
Expose shim acl remote address accessors

Bug: 166280067
Test: gd/cert/run --host
Tag: #refactor

Change-Id: Icb1d16d5982f065faf88edd19c8b6e1880546d48

3 years agoRe-log stack/l2cap/l2c_api::L2CA_RegisterLECoc
Chris Manton [Sat, 14 Nov 2020 00:38:01 +0000 (16:38 -0800)]
Re-log stack/l2cap/l2c_api::L2CA_RegisterLECoc

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: Ifd0cf6aff270624dfe5968b02ffe58f8994d823f

3 years agoRe-log stack/l2cap/l2c_api::L2CA_Register
Chris Manton [Sat, 14 Nov 2020 00:46:50 +0000 (16:46 -0800)]
Re-log stack/l2cap/l2c_api::L2CA_Register

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I8e3f8f5e3154a03eb23fd74806424c25cbde5d25

3 years agoMerge "gd: LE Advertising manager fragmentation"
Treehugger Robot [Tue, 24 Nov 2020 03:25:52 +0000 (03:25 +0000)]
Merge "gd: LE Advertising manager fragmentation"

3 years agorusty-gd: some tidying up in rootcanal_hal
Zach Johnson [Thu, 19 Nov 2020 19:08:47 +0000 (11:08 -0800)]
rusty-gd: some tidying up in rootcanal_hal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I560edb20f8a79d766417ebee7972bc6e43be4718

3 years agorusty-gd: Add cxx interop layer for the BT HIDL HAL
Zach Johnson [Thu, 19 Nov 2020 04:29:56 +0000 (20:29 -0800)]
rusty-gd: Add cxx interop layer for the BT HIDL HAL

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: Id8f90a59bdce36224d9de2a05746227a69dc24fb

3 years agoeusty-gd: Add timerfd-based timing abstractions
Zach Johnson [Wed, 18 Nov 2020 17:18:53 +0000 (09:18 -0800)]
eusty-gd: Add timerfd-based timing abstractions

Meant to feel similar to tokio's timing abstractions, but can wake the
system

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: If35e7bfc75a2a15bbd5dc940c0ba03fcdb2b6d4a

3 years agorusty-gd: GDDI now caches instances & allows injecting config
Zach Johnson [Tue, 17 Nov 2020 05:50:49 +0000 (21:50 -0800)]
rusty-gd: GDDI now caches instances & allows injecting config

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: Iac8f6a8edc5aa4ee94c33d20d11a23c9906d0b34

3 years agorusty-gd: initial commit for GDDI
Zach Johnson [Mon, 16 Nov 2020 22:43:06 +0000 (14:43 -0800)]
rusty-gd: initial commit for GDDI

go/gddi for an overview

GDDI (GD dependency injection) aims to solve the issue
of start & stop order, especially in the world where we
bring the stack up partially for testing.

this patch introduces modules & providers, but does not yet save
& remember instances to prevent multiple calls, or provide a way
to seed some object instances (e.g. config), or provide a way to
tear down the started objects

The rest is coming soon.

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I85f0dac139cfab3174053b92e077c80245da4f85

3 years agoL2cap shim: Introduce Classic Dynamic Channel Helper
Hansong Zhang [Fri, 20 Nov 2020 00:13:02 +0000 (16:13 -0800)]
L2cap shim: Introduce Classic Dynamic Channel Helper

Same as LE.

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Change-Id: Ie9c85f5bdadf5235095d357ae77d1668d7fcc694

3 years agoL2cap shim namespace clean up
Hansong Zhang [Thu, 19 Nov 2020 23:51:43 +0000 (15:51 -0800)]
L2cap shim namespace clean up

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Change-Id: Id1b152a6f679b5141c1ae80eab0696d6dafe6087

3 years agoGD L2cap shim workaround
Hansong Zhang [Wed, 18 Nov 2020 02:38:37 +0000 (18:38 -0800)]
GD L2cap shim workaround

* Fix a workflow in classic security enforcement
* Use the ACL workaround for address policy

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Test: Pair and connect with a headset
Change-Id: I31e439ae40f0db98aeed10ec6872a1f25c4f94d0

3 years agorusty-gd: properly read ACL data from the HAL
Zach Johnson [Sun, 15 Nov 2020 00:34:07 +0000 (16:34 -0800)]
rusty-gd: properly read ACL data from the HAL

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost
Change-Id: Ic6ed193f89a689a255820704b606b8ffb03a9ee0

3 years agoMerge changes Ib8d0227e,I2bcd02ea
Zach Johnson [Mon, 23 Nov 2020 19:28:11 +0000 (19:28 +0000)]
Merge changes Ib8d0227e,I2bcd02ea

* changes:
  rusty-packets: rename packets & add packet child enums
  rusty-packets: stub out struct & packet generation

3 years agobtaa: undo btaa implementation is fluoride stack
Michael Sun [Mon, 23 Nov 2020 07:07:01 +0000 (07:07 +0000)]
btaa: undo btaa implementation is fluoride stack

Undo most btaa implementation in the fluoride stack to get ready for
migrating to gd.

Tag: #feature
Bug: 172501038
Test: m
Change-Id: Ibd696edd95ab4eb73ab2387114eca3af14ea66d8

3 years agoMerge "rusty-packets: generate sample enums and make this work end to end"
Zach Johnson [Mon, 23 Nov 2020 17:47:44 +0000 (17:47 +0000)]
Merge "rusty-packets: generate sample enums and make this work end to end"

3 years agobtm: Add API to check peer's 2M PHY support
Łukasz Rymanowski [Tue, 22 Sep 2020 09:53:16 +0000 (09:53 +0000)]
btm: Add API to check peer's 2M PHY support

Sponsor: jpawlowski@
Tag: #feature
Bug: 150670922
Test: compile

Change-Id: I2f0809ba14434d8c4431174aaa67ec01e9ba0788

3 years agobtsnoop: Fix ISO handling
Łukasz Rymanowski [Wed, 9 Sep 2020 08:04:37 +0000 (08:04 +0000)]
btsnoop: Fix ISO handling

Sponsor: jpawlowski@
Tag: #feature
Bug: 150670922
Test: manually verified content of btsnoop log
Change-Id: Ie5cac9c189acf808761ac4213c8eadb497fdb531

3 years agogd: LE Advertising manager fragmentation
Chienyuan [Tue, 17 Nov 2020 13:06:16 +0000 (21:06 +0800)]
gd: LE Advertising manager fragmentation

Tag: #gd-refactor
Bug: 149221472
Test: cert/run --host
Test: atest --host bluetooth_test_gd
Change-Id: I03a84ad57ca16d0df3d1e58f570342b6b8d89513

3 years agorusty-packets: rename packets & add packet child enums
Zach Johnson [Sat, 21 Nov 2020 21:49:39 +0000 (13:49 -0800)]
rusty-packets: rename packets & add packet child enums

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: Ib8d0227e6d51d4bebbe28ddf61e957c943824185

3 years agorusty-packets: stub out struct & packet generation
Zach Johnson [Sat, 21 Nov 2020 01:14:43 +0000 (17:14 -0800)]
rusty-packets: stub out struct & packet generation

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I2bcd02ea82f0e128e3125d93cacc4c2950ac1330

3 years agoMerge changes Ia3d9e7e3,Ie2e264e9,I8767e4f9,I78716099
Zach Johnson [Sat, 21 Nov 2020 00:59:15 +0000 (00:59 +0000)]
Merge changes Ia3d9e7e3,Ie2e264e9,I8767e4f9,I78716099

* changes:
  rusty-packets: generate a file that's ready for content
  rusty-packets: move some cpp generation to raw strings, for clarity
  rusty-packets: stub out rust generation function
  rusty-packets: move C++ and pybind11 to their own file

3 years agorusty-packets: generate sample enums and make this work end to end
Zach Johnson [Sat, 21 Nov 2020 00:57:33 +0000 (16:57 -0800)]
rusty-packets: generate sample enums and make this work end to end

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I9467b6871b3072a64d06bcd8b79887bc6e85c010

3 years agoL2cap shim flag update
Hansong Zhang [Wed, 18 Nov 2020 02:38:21 +0000 (18:38 -0800)]
L2cap shim flag update

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Test: Pair and connect with a headset
Change-Id: Iccb704e6d87f6758c4af7cd9148b88d00751b1c2

3 years agoMerge "Use std::optional instead of std::unique_ptr"
Jooyung Han [Sat, 21 Nov 2020 00:45:44 +0000 (00:45 +0000)]
Merge "Use std::optional instead of std::unique_ptr"

3 years agoMerge changes from topic "gd_oob"
Myles Watson [Fri, 20 Nov 2020 20:37:38 +0000 (20:37 +0000)]
Merge changes from topic "gd_oob"

* changes:
  Security: Add a keyboard bonding test
  RootCanal: Add Passkey and PasskeyFailed
  HciMatchers: enforce argument requirement
  Rename GetOutOfBandData -> GetLeOutOfBandData
  Facade OobDataMessage: Rename members to be generic.
  SecurityTest: Create bond Out of Band

3 years agorusty-packets: generate a file that's ready for content
Zach Johnson [Fri, 20 Nov 2020 18:26:01 +0000 (10:26 -0800)]
rusty-packets: generate a file that's ready for content

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: Ia3d9e7e3d0b8f388204fd22d6ce4df2760af60de

3 years agorusty-packets: move some cpp generation to raw strings, for clarity
Zach Johnson [Fri, 20 Nov 2020 00:24:39 +0000 (16:24 -0800)]
rusty-packets: move some cpp generation to raw strings, for clarity

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: Ie2e264e95630f37a5474f67978e23d2192f89025

3 years agoMerge "rusty-packets: add rust option to switch generated packet type"
Zach Johnson [Fri, 20 Nov 2020 17:41:33 +0000 (17:41 +0000)]
Merge "rusty-packets: add rust option to switch generated packet type"

3 years agoSecurity: Add a keyboard bonding test
Myles Watson [Thu, 19 Nov 2020 19:00:49 +0000 (11:00 -0800)]
Security: Add a keyboard bonding test

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I98b7e16fb8790b001b79e9c802e45b9f180bb203

3 years agoRootCanal: Add Passkey and PasskeyFailed
Myles Watson [Sat, 14 Nov 2020 05:25:51 +0000 (21:25 -0800)]
RootCanal: Add Passkey and PasskeyFailed

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I54f2fb20bf1a071b60c9e621ca40d9e850268909

3 years agoHciMatchers: enforce argument requirement
Martin Brabham [Wed, 18 Nov 2020 00:17:03 +0000 (16:17 -0800)]
HciMatchers: enforce argument requirement

If the command complete opcode is not specified then it
will match ANY command complete event which can prove to
be troubles some when getting a series of CommandComplete()
matches.

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: Ia42c74c6476fd9d0763afa87ad1f61a243942e27

3 years agoRename GetOutOfBandData -> GetLeOutOfBandData
Martin Brabham [Tue, 17 Nov 2020 22:26:57 +0000 (14:26 -0800)]
Rename GetOutOfBandData -> GetLeOutOfBandData

Currently, this function is only used by cert tests.
This rename is a stopgap until it is dropped from the
FacadeConfigurationApi interface in favor of the SecurityManager
interface.

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest:test_successful_dut_initiated_ssp_oob
Test: cert/run --host LeSecurityTest
Change-Id: Ib1a79de46d3a59ec1c14338e8328718d114aed2a

3 years agoFacade OobDataMessage: Rename members to be generic.
Martin Brabham [Tue, 17 Nov 2020 22:00:47 +0000 (14:00 -0800)]
Facade OobDataMessage: Rename members to be generic.

Member names are LE specific when that isn't necessary.
Renaming as Classic now uses the same message too.

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest:test_successful_dut_initiated_ssp_oob
Test: cert/run --host LeSecurityTest
Change-Id: Ifd2c311a73d3e11cc64e287f18a5cb3e386e2f3c

3 years agoSecurityTest: Create bond Out of Band
Martin Brabham [Tue, 17 Nov 2020 02:01:43 +0000 (18:01 -0800)]
SecurityTest: Create bond Out of Band

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest:test_successful_dut_initiated_ssp_oob
Change-Id: I18c58bc7d9a6f33363befd60d8089544fe060ee9

3 years agoPySecurity: Add create_bond_out_of_band
Martin Brabham [Tue, 17 Nov 2020 02:01:18 +0000 (18:01 -0800)]
PySecurity: Add create_bond_out_of_band

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I41ac53a3b29e2409a1eb2da60abe8f37db84a9f4

3 years agoSecurity Facade: Implement CreateBondOutOfBand
Martin Brabham [Tue, 17 Nov 2020 01:18:42 +0000 (17:18 -0800)]
Security Facade: Implement CreateBondOutOfBand

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I78766ba130578b434298e739135951c9713a6748

3 years agoClassicPairingHandler: Add Out of Band support.
Martin Brabham [Tue, 17 Nov 2020 01:14:01 +0000 (17:14 -0800)]
ClassicPairingHandler: Add Out of Band support.

Adds support for p192, p256, and both.  As well as
secure connections "extended data" versions of the
RemoteOobDataRequestReply.

Add several unit tests to verify the pairing handler
correctly behaves.

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Test: atest --host bluetooth_test_gd -- --test-arg com.android.tradefed.testtype.GTest:native-test-flag:--gtest_filter=ClassicPairingHandlerTest*
Change-Id: I72016f380a29ad11ec9bdd9e0dcb3383c092c830

3 years agorusty-packets: stub out rust generation function
Zach Johnson [Thu, 19 Nov 2020 23:51:17 +0000 (15:51 -0800)]
rusty-packets: stub out rust generation function

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I8767e4f9ebcf8de6930ab905142afc1a002fdb43

3 years agorusty-packets: move C++ and pybind11 to their own file
Zach Johnson [Thu, 19 Nov 2020 23:34:01 +0000 (15:34 -0800)]
rusty-packets: move C++ and pybind11 to their own file

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I787160993d299b0102daa0a92add4b61f036be43

3 years agorusty-packets: add rust option to switch generated packet type
Zach Johnson [Thu, 19 Nov 2020 23:14:42 +0000 (15:14 -0800)]
rusty-packets: add rust option to switch generated packet type

also add some debug messages to make it easier to see what
the C++ version is doing.

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost SimpleHalTest
Change-Id: I0832bb74cffeeb0474aa0f81545a667d4ab6c1bb

3 years agoMerge changes Idfc28489,I56a62a3c,Ibfea3d22
Treehugger Robot [Thu, 19 Nov 2020 21:45:54 +0000 (21:45 +0000)]
Merge changes Idfc28489,I56a62a3c,Ibfea3d22

* changes:
  Improve shim Btm::GetAddressType
  Fix stack shutdown
  GD L2cap improvements

3 years agoMerge "RootCanal: Allow both sides to have OOB data"
Treehugger Robot [Thu, 19 Nov 2020 21:42:34 +0000 (21:42 +0000)]
Merge "RootCanal: Allow both sides to have OOB data"

3 years agoImprove shim Btm::GetAddressType
Hansong Zhang [Wed, 18 Nov 2020 00:42:10 +0000 (16:42 -0800)]
Improve shim Btm::GetAddressType

If legacy btm already knows its type, use it.

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Change-Id: Idfc28489f7d674dba7c724baccce0d4ee9170831

3 years agoIntroduce LE COC security enforcement shim
Hansong Zhang [Tue, 17 Nov 2020 23:13:51 +0000 (15:13 -0800)]
Introduce LE COC security enforcement shim

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Test: Pair and connect with a headset
Change-Id: Iad2d1e71582886c05a4c7df39cc85735cb3f8abf

3 years agoFix stack shutdown
Hansong Zhang [Wed, 18 Nov 2020 20:51:38 +0000 (12:51 -0800)]
Fix stack shutdown

Stop main thread first, before btm shutdown, so that we won't handle
ADV reports during shutdown.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I56a62a3c193997bc2e548dee38817ef758d82f2f

3 years agoGD L2cap improvements
Hansong Zhang [Wed, 18 Nov 2020 00:37:53 +0000 (16:37 -0800)]
GD L2cap improvements

* Store the role from updates.
* Update PSM check.  LE doesn't need it because it uses SPSM.

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Change-Id: Ibfea3d227a999c8e31e6897628c257084b43174e

3 years agoMerge changes Ic66d8fcd,I9ffbe874,I59e6926b,I1fb172f7,I0eb60ace, ...
Zach Johnson [Thu, 19 Nov 2020 18:36:42 +0000 (18:36 +0000)]
Merge changes Ic66d8fcd,I9ffbe874,I59e6926b,I1fb172f7,I0eb60ace, ...

* changes:
  Add some wait commands inside PyHal
  Simplify scan parameters & start/stop
  Simplify le random address setting for tests
  Simplify le connection logic for SimpleHalTest
  Simplify Le connect logic for SimpleHalTest
  Simplify advertisement in SimpleHalTest
  Add HciMatchers.Exactly, for more compact tests
  Add HAL reset helper
  Add advertisement abstraction in PyHal
  Add an advertisment abstraction to PyHci

3 years agogd: Add hci error code CONNECTION_FAILED_ESTABLISHMENT
Chris Manton [Wed, 18 Nov 2020 20:51:18 +0000 (12:51 -0800)]
gd: Add hci error code CONNECTION_FAILED_ESTABLISHMENT

Occurs when a connection ACL is requested to a given
device but there is already an existing ACL connection.

Bug: 145832107
Test: gd/cert/run --host
Tag: #refactor
Change-Id: I609374ba9376f2a1056971fc514d97615931c62a

3 years agoMerge changes I333524dc,Ia460804d,I90cfe69e,I848e344b,Ie9108602, ...
Zach Johnson [Thu, 19 Nov 2020 04:49:39 +0000 (04:49 +0000)]
Merge changes I333524dc,Ia460804d,I90cfe69e,I848e344b,Ie9108602, ...

* changes:
  Add read_own_addres to PyHal
  Simplify ACL connection components of DirectHciTest
  Add send_acl_first to PyHal, to simplify redundancy
  Fold ACL sending into PyHal
  Simplify ACL sending in SimpleHalTest
  Add shortcut for enabling inquiry in PyHal
  Simplify DirectHciTest send_hal_acl_data
  Add HciMatchers.LoopbackOf to avoid imprecise matching
  Improve signal to noise in DirectHciTest
  DirectHciTest, remove send_hal_hci_command
  Improve hci facade proto

3 years agoRootCanal: Allow both sides to have OOB data
Myles Watson [Thu, 19 Nov 2020 01:16:59 +0000 (17:16 -0800)]
RootCanal: Allow both sides to have OOB data

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I1c30296ec80aaac883fc3012982bf6fb76c34771

3 years agoAdd some wait commands inside PyHal
Zach Johnson [Sat, 14 Nov 2020 23:50:00 +0000 (15:50 -0800)]
Add some wait commands inside PyHal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Ic66d8fcd09f3c930de0a8b1063ec355e86df4d20

3 years agoSimplify scan parameters & start/stop
Zach Johnson [Sat, 14 Nov 2020 23:12:41 +0000 (15:12 -0800)]
Simplify scan parameters & start/stop

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I9ffbe874bf84e338bd1d38873fbecac6f83fa9b5

3 years agoSimplify le random address setting for tests
Zach Johnson [Sat, 14 Nov 2020 23:06:34 +0000 (15:06 -0800)]
Simplify le random address setting for tests

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I59e6926bb00b377b3580742800fbe2743c067181

3 years agoSimplify le connection logic for SimpleHalTest
Zach Johnson [Sat, 14 Nov 2020 23:00:43 +0000 (15:00 -0800)]
Simplify le connection logic for SimpleHalTest

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I1fb172f75ccd01fd449af2748ea9885991822594

3 years agoSimplify Le connect logic for SimpleHalTest
Zach Johnson [Sat, 14 Nov 2020 22:52:03 +0000 (14:52 -0800)]
Simplify Le connect logic for SimpleHalTest

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I0eb60ace4e5b354803fcbb331484cbb556f86e0f

3 years agoSimplify advertisement in SimpleHalTest
Zach Johnson [Sat, 14 Nov 2020 21:39:14 +0000 (13:39 -0800)]
Simplify advertisement in SimpleHalTest

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I297cfeac69b143d5783122f1ec103fd67af11446

3 years agoAdd read_own_addres to PyHal
Zach Johnson [Fri, 13 Nov 2020 05:34:43 +0000 (21:34 -0800)]
Add read_own_addres to PyHal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I333524dcc50d7f9cc586ab66514cab04908686ab

3 years agoAdd HciMatchers.Exactly, for more compact tests
Zach Johnson [Sat, 14 Nov 2020 21:28:09 +0000 (13:28 -0800)]
Add HciMatchers.Exactly, for more compact tests

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: If87927d3e491f234000b7c9321832897e91bba04

3 years agoSimplify ACL connection components of DirectHciTest
Zach Johnson [Fri, 13 Nov 2020 05:22:22 +0000 (21:22 -0800)]
Simplify ACL connection components of DirectHciTest

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Ia460804d5a8654b3ba305ca414ba1797498aecd3

3 years agoAdd HAL reset helper
Zach Johnson [Sat, 14 Nov 2020 20:48:57 +0000 (12:48 -0800)]
Add HAL reset helper

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Ia2df0a7e05e8d8fccc8af5005c3fb2e4a5d6a6fe

3 years agoAdd send_acl_first to PyHal, to simplify redundancy
Zach Johnson [Fri, 13 Nov 2020 04:36:10 +0000 (20:36 -0800)]
Add send_acl_first to PyHal, to simplify redundancy

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I90cfe69ec30ed6b92366df81874c2ab30abe7f84

3 years agoAdd advertisement abstraction in PyHal
Zach Johnson [Fri, 13 Nov 2020 18:16:32 +0000 (10:16 -0800)]
Add advertisement abstraction in PyHal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I07d3bb46876f86fb2aba74b49cddde7425703937

3 years agoFold ACL sending into PyHal
Zach Johnson [Fri, 13 Nov 2020 04:22:27 +0000 (20:22 -0800)]
Fold ACL sending into PyHal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I848e344bca3b4b2516a061fdd3c221a5a9409db4

3 years agoAdd an advertisment abstraction to PyHci
Zach Johnson [Fri, 13 Nov 2020 06:23:41 +0000 (22:23 -0800)]
Add an advertisment abstraction to PyHci

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I919e9769023f53ac645313a151fdff8e70417e26

3 years agoSimplify ACL sending in SimpleHalTest
Zach Johnson [Fri, 13 Nov 2020 04:17:56 +0000 (20:17 -0800)]
Simplify ACL sending in SimpleHalTest

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Ie9108602b0b23701a0cf9c98c4a3f314db389dd1

3 years agoAdd shortcut for enabling inquiry in PyHal
Zach Johnson [Fri, 13 Nov 2020 04:09:30 +0000 (20:09 -0800)]
Add shortcut for enabling inquiry in PyHal

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I74197927c8a61b9ab970557a9f49830b26b2d876

3 years agoSimplify DirectHciTest send_hal_acl_data
Zach Johnson [Fri, 13 Nov 2020 03:52:55 +0000 (19:52 -0800)]
Simplify DirectHciTest send_hal_acl_data

first step towards more general code

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I4957acd5868f4d079fdffb255df16200e919429b

3 years agoAdd HciMatchers.LoopbackOf to avoid imprecise matching
Zach Johnson [Fri, 13 Nov 2020 02:09:49 +0000 (18:09 -0800)]
Add HciMatchers.LoopbackOf to avoid imprecise matching

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Id9b18af3075225b3ac09a6af485d424476151b33

3 years agoImprove signal to noise in DirectHciTest
Zach Johnson [Fri, 13 Nov 2020 00:53:45 +0000 (16:53 -0800)]
Improve signal to noise in DirectHciTest

import concrete objects instead of hci_packets.xyz everywhere

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: Ie906397e586ee6c12ef533d9201f7e11f4ca5f35

3 years agoDirectHciTest, remove send_hal_hci_command
Zach Johnson [Fri, 13 Nov 2020 00:20:14 +0000 (16:20 -0800)]
DirectHciTest, remove send_hal_hci_command

call to the PyHal helper instead

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host DirectHciTest
Change-Id: I432c0ccd92b8dd717fda943952605062fa6e8d23

3 years agoImprove hci facade proto
Zach Johnson [Fri, 13 Nov 2020 00:16:05 +0000 (16:16 -0800)]
Improve hci facade proto

reduce redundant or extra words

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --host
Change-Id: I3994dcf0cb41784a660e6c28987b9be306f42d87

3 years agoMerge "remove invalid test, restucture simple_hal_test"
Zach Johnson [Wed, 18 Nov 2020 22:09:19 +0000 (22:09 +0000)]
Merge "remove invalid test, restucture simple_hal_test"

3 years agoMerge changes I9b41e751,If93d4d62
Zach Johnson [Wed, 18 Nov 2020 17:20:31 +0000 (17:20 +0000)]
Merge changes I9b41e751,If93d4d62

* changes:
  rusty-gd: plumb through ACL in the hal
  rusty-gd: plumb through commands and events for the hci hal facade

3 years agoMerge "RootCanal: Allow only the peer to have OOB data"
Treehugger Robot [Wed, 18 Nov 2020 17:08:57 +0000 (17:08 +0000)]
Merge "RootCanal: Allow only the peer to have OOB data"

3 years agoUse std::optional instead of std::unique_ptr
Jooyung Han [Wed, 18 Nov 2020 12:57:57 +0000 (21:57 +0900)]
Use std::optional instead of std::unique_ptr

Since Android R, Parcel provides read/write methods for "@nullable"
values using std::optional.

Bug: 149784838
Tag: #refactor
Test: atest --host bluetooth_test_gd
Change-Id: Iae76dc0d7a991888687cf572a43b26b28ad2e93d

3 years agoMerge "shim: check subevent for advertising module"
Treehugger Robot [Wed, 18 Nov 2020 05:56:49 +0000 (05:56 +0000)]
Merge "shim: check subevent for advertising module"

3 years agoRootCanal: Allow only the peer to have OOB data
Myles Watson [Wed, 18 Nov 2020 03:02:43 +0000 (19:02 -0800)]
RootCanal: Allow only the peer to have OOB data

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I9ea880d906ac607e659f1532dd093127fa0f7e0a