OSDN Git Service

android-x86/system-bt.git
3 years agoAdd boilerplate code for 5.2 COC
Hansong Zhang [Tue, 19 Jan 2021 22:55:06 +0000 (14:55 -0800)]
Add boilerplate code for 5.2 COC

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

3 years agoMerge changes Ia3f3c5d7,If3aaeccc,I74915b3a,I49b167a3,Iab536745
Treehugger Robot [Wed, 20 Jan 2021 05:55:12 +0000 (05:55 +0000)]
Merge changes Ia3f3c5d7,If3aaeccc,I74915b3a,I49b167a3,Iab536745

* changes:
  Include rfcdefs and add btm_client_interface
  Add tBTM_DEVCB::Init/Free
  Add tSCO_CB::Init
  Remove useless global level of indirection
  Add and Use stack//btm_acl::internal::set_default_packet_types_supported

3 years agoMerge changes I5a31f506,If496d946
Treehugger Robot [Wed, 20 Jan 2021 03:09:40 +0000 (03:09 +0000)]
Merge changes I5a31f506,If496d946

* changes:
  Consolidate assignment btm_cb.acl_cb_.btm_acl_pkt_types_supported
  Add param BTM_acl_after_controller_started::controller_t

3 years agoMerge changes I3a54a514,Iada70c9f,I1fb728ce,I181f0d77,I1df3c852, ...
Zach Johnson [Wed, 20 Jan 2021 03:00:52 +0000 (03:00 +0000)]
Merge changes I3a54a514,Iada70c9f,I1fb728ce,I181f0d77,I1df3c852, ...

* changes:
  rusty-gd: migrate classic acl to a directory, in prep for facade
  rusty-gd: some tidying in acl
  rusty-gd: add authentication complete for classic acl
  rusty-gd: implement connection request for classic ACL
  rusty-gd: wire through classic ACL API for disconnect
  rusty-gd: expose core byte rx/tx for classic ACL
  rusty-gd: move acl core from lib.rs to core.rs
  rusty-gd: implement connection complete for classic acl
  rusty-gd: simplify acl internal requests by using structured enums
  rusty-gd: start classic acl manager
  rusty-gd: report acl disconnections
  rusty-gd: implement ACL connection close
  rusty-gd: add ACL credit control
  rusty-gd: implement outbound fragmentation & dispatch
  rusty-gd: add packet reassembler
  rusty-gd: implement vector payloads for packets
  rusty-gd: start ACL - simple dispatch of inbound traffic

3 years agoInclude rfcdefs and add btm_client_interface
Chris Manton [Sun, 17 Jan 2021 22:16:01 +0000 (14:16 -0800)]
Include rfcdefs and add btm_client_interface

Towards including what you use

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: Ia3f3c5d7d803a39272727f2a3a9a93febd0efad9

3 years agoConsolidate assignment btm_cb.acl_cb_.btm_acl_pkt_types_supported
Chris Manton [Sat, 9 Jan 2021 22:11:24 +0000 (14:11 -0800)]
Consolidate assignment btm_cb.acl_cb_.btm_acl_pkt_types_supported

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: I5a31f506d1dcabc4446aaf8033db4b2159a65705

3 years agoAdd tBTM_DEVCB::Init/Free
Chris Manton [Sat, 9 Jan 2021 22:40:37 +0000 (14:40 -0800)]
Add tBTM_DEVCB::Init/Free

Towards encapsulated code

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

Change-Id: If3aaeccc0ea876d9d9f5ca87893035cb222b789e

3 years agoAdd param BTM_acl_after_controller_started::controller_t
Chris Manton [Sat, 9 Jan 2021 21:32:06 +0000 (13:32 -0800)]
Add param BTM_acl_after_controller_started::controller_t

Towards injectable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: If496d94615ebca3e459f9b2dbe6b114710258d7a

3 years agoAdd tSCO_CB::Init
Chris Manton [Sat, 9 Jan 2021 22:32:08 +0000 (14:32 -0800)]
Add tSCO_CB::Init

Towards encapsulated code

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

Change-Id: I74915b3a39423483206297df7e04a6572fd5ba51

3 years agoRemove useless global level of indirection
Chris Manton [Sat, 9 Jan 2021 22:29:00 +0000 (14:29 -0800)]
Remove useless global level of indirection

Towards encapsulated code

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

Change-Id: I49b167a33a7733d5abf3a290a45f63e801b7401d

3 years agoAdd and Use stack//btm_acl::internal::set_default_packet_types_supported
Chris Manton [Sat, 9 Jan 2021 22:14:52 +0000 (14:14 -0800)]
Add and Use stack//btm_acl::internal::set_default_packet_types_supported

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: Iab53674505ab691565b7b83a282aa28c76454614

3 years agoMerge "gd: Update random address when command success"
Treehugger Robot [Wed, 20 Jan 2021 02:45:05 +0000 (02:45 +0000)]
Merge "gd: Update random address when command success"

3 years agoMerge changes Icba988d3,Ia8874c80,I36da3481,Ica4914f5
Treehugger Robot [Wed, 20 Jan 2021 02:39:09 +0000 (02:39 +0000)]
Merge changes Icba988d3,Ia8874c80,I36da3481,Ica4914f5

* changes:
  Add test SetSupervisorTimeoutOnConnectionSuccess
  Fully encapsulate tBTM_SEC_DEV_REC::is_originator
  Use tBTM_SEC_DEV_REC::IsLocallyInitiated
  Add API tBTM_SEC_DEV_REC::IsLocallyInitiated

3 years agoMerge "gd: Handle scan parameter"
Treehugger Robot [Wed, 20 Jan 2021 01:44:29 +0000 (01:44 +0000)]
Merge "gd: Handle scan parameter"

3 years agoMerge "gd: Fix bug of AdvertisingCache"
Treehugger Robot [Wed, 20 Jan 2021 01:35:30 +0000 (01:35 +0000)]
Merge "gd: Fix bug of AdvertisingCache"

3 years agorusty-gd: migrate classic acl to a directory, in prep for facade
Zach Johnson [Thu, 31 Dec 2020 18:27:14 +0000 (10:27 -0800)]
rusty-gd: migrate classic acl to a directory, in prep for facade

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

3 years agorusty-gd: some tidying in acl
Zach Johnson [Thu, 31 Dec 2020 03:06:18 +0000 (19:06 -0800)]
rusty-gd: some tidying in acl

use short variable names where the usage context is so small it's self
explanatory (a little more go-like)

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

3 years agorusty-gd: add authentication complete for classic acl
Zach Johnson [Thu, 31 Dec 2020 01:42:24 +0000 (17:42 -0800)]
rusty-gd: add authentication complete for classic acl

also, use common event packet-for-connection forwarnding mechanism
between core and classic

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

3 years agorusty-gd: implement connection request for classic ACL
Zach Johnson [Thu, 31 Dec 2020 01:14:15 +0000 (17:14 -0800)]
rusty-gd: implement connection request for classic ACL

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

3 years agorusty-gd: wire through classic ACL API for disconnect
Zach Johnson [Thu, 31 Dec 2020 01:00:04 +0000 (17:00 -0800)]
rusty-gd: wire through classic ACL API for disconnect

also, since we are unregistering implicitly upon disconnect, no need to
expose that in the core

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

3 years agorusty-gd: expose core byte rx/tx for classic ACL
Zach Johnson [Thu, 31 Dec 2020 00:00:04 +0000 (16:00 -0800)]
rusty-gd: expose core byte rx/tx for classic ACL

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

3 years agorusty-gd: move acl core from lib.rs to core.rs
Zach Johnson [Wed, 30 Dec 2020 22:48:28 +0000 (14:48 -0800)]
rusty-gd: move acl core from lib.rs to core.rs

this allows internals to stay internal

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

3 years agorusty-gd: implement connection complete for classic acl
Zach Johnson [Wed, 30 Dec 2020 22:40:07 +0000 (14:40 -0800)]
rusty-gd: implement connection complete for classic acl

still not hooked up into the core dispatch yet, coming soon

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

3 years agorusty-gd: simplify acl internal requests by using structured enums
Zach Johnson [Wed, 30 Dec 2020 18:52:11 +0000 (10:52 -0800)]
rusty-gd: simplify acl internal requests by using structured enums

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

3 years agorusty-gd: start classic acl manager
Zach Johnson [Wed, 30 Dec 2020 18:44:31 +0000 (10:44 -0800)]
rusty-gd: start classic acl manager

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

3 years agorusty-gd: report acl disconnections
Zach Johnson [Wed, 30 Dec 2020 03:25:46 +0000 (19:25 -0800)]
rusty-gd: report acl disconnections

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

3 years agorusty-gd: implement ACL connection close
Zach Johnson [Wed, 30 Dec 2020 02:07:52 +0000 (18:07 -0800)]
rusty-gd: implement ACL connection close

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

3 years agorusty-gd: add ACL credit control
Zach Johnson [Wed, 30 Dec 2020 01:36:58 +0000 (17:36 -0800)]
rusty-gd: add ACL credit control

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

3 years agorusty-gd: implement outbound fragmentation & dispatch
Zach Johnson [Tue, 29 Dec 2020 21:55:12 +0000 (13:55 -0800)]
rusty-gd: implement outbound fragmentation & dispatch

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

3 years agorusty-gd: add packet reassembler
Zach Johnson [Mon, 28 Dec 2020 22:52:36 +0000 (14:52 -0800)]
rusty-gd: add packet reassembler

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

3 years agorusty-gd: implement vector payloads for packets
Zach Johnson [Mon, 28 Dec 2020 20:50:45 +0000 (12:50 -0800)]
rusty-gd: implement vector payloads for packets

this way, we can get the contents to pass to higher layers from ACL, etc

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

3 years agorusty-gd: start ACL - simple dispatch of inbound traffic
Zach Johnson [Mon, 28 Dec 2020 19:43:02 +0000 (11:43 -0800)]
rusty-gd: start ACL - simple dispatch of inbound traffic

does not do reassembly or anything like that yet

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

3 years agoAdd test SetSupervisorTimeoutOnConnectionSuccess
Chris Manton [Mon, 11 Jan 2021 06:07:07 +0000 (22:07 -0800)]
Add test SetSupervisorTimeoutOnConnectionSuccess

Towards testable code

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

Change-Id: Icba988d39df5f3210b5e97e3da2dbbca98a12cd4

3 years agoRe-log stack/acl/btm_acl::btm_acl_created
Chris Manton [Mon, 11 Jan 2021 06:30:02 +0000 (22:30 -0800)]
Re-log stack/acl/btm_acl::btm_acl_created

Towards loggable code

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

Change-Id: I1e6ffe540d913839577c6a7969ddf2d073b83332

3 years agoFully encapsulate tBTM_SEC_DEV_REC::is_originator
Chris Manton [Mon, 11 Jan 2021 06:06:47 +0000 (22:06 -0800)]
Fully encapsulate tBTM_SEC_DEV_REC::is_originator

Towards encapsulated code

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

Change-Id: Ia8874c80ceedeb6e331dfbff48e3fc9ddee6cc87

3 years agoRe-log stack/btm/btm_sec::btm_sec_connected
Chris Manton [Mon, 11 Jan 2021 05:53:48 +0000 (21:53 -0800)]
Re-log stack/btm/btm_sec::btm_sec_connected

Towards loggable code

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

Change-Id: I0d613230cdc7a0701aa848effa129cc4b8c58b4b

3 years agoUse tBTM_SEC_DEV_REC::IsLocallyInitiated
Chris Manton [Mon, 11 Jan 2021 06:06:29 +0000 (22:06 -0800)]
Use tBTM_SEC_DEV_REC::IsLocallyInitiated

Towards encapsulated code

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

Change-Id: I36da3481eb54ce016df021fa6d24f3f82555ace8

3 years agoAdd API tBTM_SEC_DEV_REC::IsLocallyInitiated
Chris Manton [Mon, 11 Jan 2021 06:09:38 +0000 (22:09 -0800)]
Add API tBTM_SEC_DEV_REC::IsLocallyInitiated

Towards encapsulated code

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

Change-Id: Ica4914f5030667594f926892f6c7794d87bd6aee

3 years agoUse stack/acl/btm_acl::hci_btm_set_link_supervision_timeout
Chris Manton [Mon, 11 Jan 2021 06:51:33 +0000 (22:51 -0800)]
Use stack/acl/btm_acl::hci_btm_set_link_supervision_timeout

Towards readable code

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

Change-Id: I5fa26134ddd5485d940d7f18a7d26bbd27959a31

3 years agoAdd stack/acl/btm_acl::hci_btm_set_link_supervision_timeout
Chris Manton [Mon, 11 Jan 2021 03:37:13 +0000 (19:37 -0800)]
Add stack/acl/btm_acl::hci_btm_set_link_supervision_timeout

Towards modular and testable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: Ib940a203a5bfa2293d0c95741071364a01aa5967

3 years agoTest stack/acl/btm_acl::on_acl_br_edr_{success,failed}
Chris Manton [Sun, 10 Jan 2021 23:39:36 +0000 (15:39 -0800)]
Test stack/acl/btm_acl::on_acl_br_edr_{success,failed}

Try not to re-converge divergent code paths

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: Ic8a795369972bb38e5ab9bb51c9e735c382680e4

3 years agogd_shim_acl: Plumb stack/acl/btm_acl::on_acl_br_edr_{success,failed}
Chris Manton [Sun, 10 Jan 2021 23:31:15 +0000 (15:31 -0800)]
gd_shim_acl: Plumb stack/acl/btm_acl::on_acl_br_edr_{success,failed}

Try not to re-converge divergent code paths

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: Ie78d6b8c8d4eca1a24175a07f4e775e92439ce1b

3 years agoUse stack/acl/btm_acl::on_acl_br_edr_{success,failed}
Chris Manton [Sun, 10 Jan 2021 22:51:01 +0000 (14:51 -0800)]
Use stack/acl/btm_acl::on_acl_br_edr_{success,failed}

Try not to re-converge divergent code paths

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: I9f3abe06f0ee276af583fbcb715f198710f48fec

3 years agoAdd stack/acl/btm_acl::on_acl_br_edr_{success,failed}
Chris Manton [Sun, 10 Jan 2021 22:48:35 +0000 (14:48 -0800)]
Add stack/acl/btm_acl::on_acl_br_edr_{success,failed}

Try not to re-converge divergent code paths

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: Ib11b50c696c162b9c0aea59c6d92ccf711619808

3 years agoDe-anonymize tBTM_SEC_DEV_REC
Chris Manton [Mon, 11 Jan 2021 05:51:40 +0000 (21:51 -0800)]
De-anonymize tBTM_SEC_DEV_REC

Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: I4f49a92b5fbd227b537899e130291394c130cb9f

3 years agoInternalize stack/acl/btm_acl::hci_start_role_switch_to_central
Chris Manton [Sun, 17 Jan 2021 17:17:24 +0000 (09:17 -0800)]
Internalize stack/acl/btm_acl::hci_start_role_switch_to_central

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: I00d0111acf7e36a2288a6f8975cad9253bd340a0

3 years agogd: Handle scan parameter
Chienyuan [Fri, 15 Jan 2021 09:23:40 +0000 (17:23 +0800)]
gd: Handle scan parameter

Tag: #gd-refactor
Bug: 177044452
Test: gd/cert/run
Change-Id: Icb9638b8f852350c36010df89d29a2dd224dc89d

3 years agoUse some L2cap APIs in btm_sec
Hansong Zhang [Sun, 17 Jan 2021 09:08:05 +0000 (01:08 -0800)]
Use some L2cap APIs in btm_sec

When we need to start encryption or handle encryption change, link must
be up and L2cap must be already connected.

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

3 years agoSimplify some L2cap code
Hansong Zhang [Sat, 16 Jan 2021 00:31:19 +0000 (16:31 -0800)]
Simplify some L2cap code

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

3 years agogd: Update random address when command success
Chienyuan [Tue, 19 Jan 2021 13:43:10 +0000 (21:43 +0800)]
gd: Update random address when command success

Tag: #gd-refactor
Bug: 152348535
Test: gd/cert/run --host
Change-Id: I8a457cd5f1633a4c75babb14529a7c9f7ecebac6

3 years agogd: Fix bug of AdvertisingCache
Chienyuan [Fri, 15 Jan 2021 05:57:49 +0000 (13:57 +0800)]
gd: Fix bug of AdvertisingCache

Tag: #gd-refactor
Bug: 177044452
Test: gd/cert/run --host
Change-Id: Ib7052061335e6eb9eed13c74272f6f80c1550d97

3 years agoMerge "gd: Implement address rotation for advertising set"
Treehugger Robot [Mon, 18 Jan 2021 11:30:20 +0000 (11:30 +0000)]
Merge "gd: Implement address rotation for advertising set"

3 years agoMerge "Add ISO type support on btsnooz.py script"
Treehugger Robot [Mon, 18 Jan 2021 02:56:19 +0000 (02:56 +0000)]
Merge "Add ISO type support on btsnooz.py script"

3 years agoAdd ISO type support on btsnooz.py script
Alice Kuo [Fri, 15 Jan 2021 03:39:52 +0000 (11:39 +0800)]
Add ISO type support on btsnooz.py script

Support to decode the ISO packet from the compressed btsnoop in
bugreport.

Bug: 150670922
Bug: 177616528
Test: btsnooz.py bugreport-*.txt which contain ISO traffic.
Tag: #feature
Change-Id: I070ec3023ed2ef65c3d1fce90dcfe2b9d695a89f

3 years agoFix linter
Hansong Zhang [Fri, 15 Jan 2021 19:48:17 +0000 (11:48 -0800)]
Fix linter

Test: bluetooth_test_gd
Tag: #gd-refactor
Bug: 141555841
Change-Id: Icbf6ddfd077988ba1feb6646c6909ee1a91e50c6

3 years agoMerge changes from topic "avrcp-target-cover-art"
Sal Savage [Fri, 15 Jan 2021 19:59:49 +0000 (19:59 +0000)]
Merge changes from topic "avrcp-target-cover-art"

* changes:
  Add tests for the AVRCP Target Cover Art feature
  Pass BIP client status down and use it to decide to send image handles
  Add a path to add the PSM of the BIP OBEX server to the SDP record
  Allow NewAvrcp to manage its own SDP record

3 years agoRoundRobinScheduler: Add multi priority support
Hansong Zhang [Fri, 15 Jan 2021 06:34:05 +0000 (22:34 -0800)]
RoundRobinScheduler: Add multi priority support

And add SetAclTxPriority() API in AclManager and shim

Test: cert/run
Test: bluetooth_test_gd
Tag: #gd-refactor
Bug: 141555841
Change-Id: I6d5911dfea23b7e7440738c0c4d51a3e3ffbf52f

3 years agoWire up SetChannelTxPriority
Hansong Zhang [Fri, 15 Jan 2021 02:56:02 +0000 (18:56 -0800)]
Wire up SetChannelTxPriority

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

3 years agoL2cap scheduler: Implement high priority channel
Hansong Zhang [Fri, 15 Jan 2021 01:55:26 +0000 (17:55 -0800)]
L2cap scheduler: Implement high priority channel

Add a high priority queue for these channels in scheduler.

Introduce MockQueue to help test with BidiQueueEnd callbacks.

Test: cert/run
Test: bluetooth_test_gd
Tag: #gd-refactor
Bug: 141555841
Change-Id: I3b60002f0d2ac2fb4d3307717dce128ccb06247c

3 years agoIntroduce MultiPriorityQueue
Hansong Zhang [Fri, 15 Jan 2021 05:58:27 +0000 (21:58 -0800)]
Introduce MultiPriorityQueue

ACL and L2cap needs to prioritize some link/channels in some cases.  A
traditional priority queue requires predefined comparison, which can be
hard for our use case (PacketBuilder).  Instead, we specify the priority
value when we push to a queue.

Test: bluetooth_test_gd
Tag: #gd-refactor
Bug: 141555841
Change-Id: I33414b4bf81e9f63c88d8627376b565f5c5bb6de

3 years agoRefactor L2CA_SetFixedChannelTout
Hansong Zhang [Thu, 14 Jan 2021 21:00:45 +0000 (13:00 -0800)]
Refactor L2CA_SetFixedChannelTout

It's always used by LE GATT, so let's change it to
L2CA_SetLeGattTimeout.

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

3 years agoMerge changes Ia401bcf0,I724939c1,I606f4aff,I548ee2ad,Iee6c37a7, ...
Zach Johnson [Fri, 15 Jan 2021 15:58:33 +0000 (15:58 +0000)]
Merge changes Ia401bcf0,I724939c1,I606f4aff,I548ee2ad,Iee6c37a7, ...

* changes:
  rusty-gd: update hal facade
  rusty-gd: introduce RxAdapter
  rusty-gd: switch hci facade to grpc context
  rusty-gd: shim & facade are very similar, start sharing code
  rusty-gd: split HAL into control & acl
  rusty-gd: allow parting out injected values

3 years agogd: Implement address rotation for advertising set
Chienyuan [Thu, 14 Jan 2021 13:47:03 +0000 (21:47 +0800)]
gd: Implement address rotation for advertising set

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

3 years agoMerge "RootCanal: Check PIN on both sides"
Treehugger Robot [Fri, 15 Jan 2021 03:25:46 +0000 (03:25 +0000)]
Merge "RootCanal: Check PIN on both sides"

3 years agoRootCanal: Check PIN on both sides
Myles Watson [Fri, 15 Jan 2021 01:27:27 +0000 (17:27 -0800)]
RootCanal: Check PIN on both sides

Bug: 148864229
Tag: #gd-refactor
Test: cert/run
Change-Id: I54801c552afe6cc1068c9104836fbe4a211d566c

3 years agoMerge "Fix v2 format decoding in btsnooz.py"
Treehugger Robot [Thu, 14 Jan 2021 23:45:21 +0000 (23:45 +0000)]
Merge "Fix v2 format decoding in btsnooz.py"

3 years agoMerge changes I5d0c9f45,I847253d5,I05ec50c5,I4d55a4b3
Zach Johnson [Thu, 14 Jan 2021 20:02:52 +0000 (20:02 +0000)]
Merge changes I5d0c9f45,I847253d5,I05ec50c5,I4d55a4b3

* changes:
  rusty-gd: simplify exported types
  rusty-gd: implement controller shim
  rusty-gd: back message loop thread with rust, if rust enabled
  don't expose main thread message loop

3 years agofix mac build
Zach Johnson [Thu, 14 Jan 2021 19:54:00 +0000 (11:54 -0800)]
fix mac build

Bug: 177491893
Test: compile
Change-Id: Icc181273d8a771bb908dff4d5708fb2b2c38de18

3 years agoMerge "RootCanal: Reject unsolicited PIN responses"
Treehugger Robot [Thu, 14 Jan 2021 18:24:07 +0000 (18:24 +0000)]
Merge "RootCanal: Reject unsolicited PIN responses"

3 years agoAdd callbacks in LE link manager
Hansong Zhang [Thu, 14 Jan 2021 00:29:41 +0000 (16:29 -0800)]
Add callbacks in LE link manager

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

3 years agoMerge "Swich TEST_MAPPING config to unit_tests:true"
Julien Desprez [Thu, 14 Jan 2021 18:01:12 +0000 (18:01 +0000)]
Merge "Swich TEST_MAPPING config to unit_tests:true"

3 years agoL2cap LE shim: Don't match address type
Hansong Zhang [Wed, 13 Jan 2021 23:52:59 +0000 (15:52 -0800)]
L2cap LE shim: Don't match address type

In legacy stack, address type is not used in some L2cap LE APIs.
Matching it might cause problem.  Instead, we use address only, just
like legacy stack.

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

3 years agoRemove unused L2cap shim API
Hansong Zhang [Wed, 13 Jan 2021 20:54:07 +0000 (12:54 -0800)]
Remove unused L2cap shim API

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

3 years agoImplement L2CA_EnableUpdateBleConnParams in shim
Hansong Zhang [Wed, 13 Jan 2021 20:19:24 +0000 (12:19 -0800)]
Implement L2CA_EnableUpdateBleConnParams in shim

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

3 years agoSwich TEST_MAPPING config to unit_tests:true
Julien Desprez [Wed, 13 Jan 2021 20:02:39 +0000 (12:02 -0800)]
Swich TEST_MAPPING config to unit_tests:true

All unit_tests:true are run in presubmit which avoids
the explicit definition of TEST_MAPPING.

Test: presubmit runs all those tests
Bug: 175408655
Change-Id: I4d42ce5da5cdca819e61691475e8645e83942ab1
Merged-In: Ib6e861158b8b9b426b48147b778f49f73c35be9f

3 years agoRootCanal: Reject unsolicited PIN responses
Myles Watson [Thu, 14 Jan 2021 01:36:19 +0000 (17:36 -0800)]
RootCanal: Reject unsolicited PIN responses

Bug: 148864229
Tag: #gd-refactor
Test: cert/run
Change-Id: Ic6bcd706e243ea37e949cefaa77f5fd02e197061

3 years agorusty-gd: update hal facade
Zach Johnson [Wed, 23 Dec 2020 02:02:19 +0000 (18:02 -0800)]
rusty-gd: update hal facade

use RpcContext & RxAdapter

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

3 years agorusty-gd: introduce RxAdapter
Zach Johnson [Wed, 23 Dec 2020 00:06:15 +0000 (16:06 -0800)]
rusty-gd: introduce RxAdapter

this consolidates logic for dispatching channels over gRPC or callbacks
into legacy

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

3 years agorusty-gd: switch hci facade to grpc context
Zach Johnson [Tue, 22 Dec 2020 23:24:40 +0000 (15:24 -0800)]
rusty-gd: switch hci facade to grpc context

this is backed by the tokio runtime, but
we don't need to pass it around

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

3 years agorusty-gd: shim & facade are very similar, start sharing code
Zach Johnson [Tue, 22 Dec 2020 23:02:04 +0000 (15:02 -0800)]
rusty-gd: shim & facade are very similar, start sharing code

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

3 years agorusty-gd: split HAL into control & acl
Zach Johnson [Tue, 22 Dec 2020 22:34:37 +0000 (14:34 -0800)]
rusty-gd: split HAL into control & acl

this way the ACL can bypass the HCI layer entirely

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

3 years agorusty-gd: allow parting out injected values
Zach Johnson [Tue, 22 Dec 2020 21:59:28 +0000 (13:59 -0800)]
rusty-gd: allow parting out injected values

this way we can inject only what we actually care about

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

3 years agorusty-gd: simplify exported types
Zach Johnson [Tue, 22 Dec 2020 08:05:31 +0000 (00:05 -0800)]
rusty-gd: simplify exported types

drop the exports, it's simpler

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

3 years agorusty-gd: implement controller shim
Zach Johnson [Tue, 22 Dec 2020 07:16:48 +0000 (23:16 -0800)]
rusty-gd: implement controller shim

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

3 years agorusty-gd: back message loop thread with rust, if rust enabled
Zach Johnson [Tue, 22 Dec 2020 02:14:30 +0000 (18:14 -0800)]
rusty-gd: back message loop thread with rust, if rust enabled

the rust code runs in a single threaded environment.
since the main thread is now implicitly running in this environment too,
this means we no longer need to transfer contexts in the shim

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

3 years agoMerge changes Ic8ddcac8,I5f2ae561
Zach Johnson [Wed, 13 Jan 2021 23:13:38 +0000 (23:13 +0000)]
Merge changes Ic8ddcac8,I5f2ae561

* changes:
  rusty-gd: implement custom types & read address in controller
  rusty-gd: implement command sending via HCI shim

3 years agoAdd tests for the AVRCP Target Cover Art feature
Sal Savage [Mon, 9 Mar 2020 23:01:25 +0000 (16:01 -0700)]
Add tests for the AVRCP Target Cover Art feature

Tag: #feature
Bug: 153076316
Test: atest net_test_avrcp
Test: atest net_test_btpackets
Test: atest net_test_btif
Change-Id: I38e2b4aae5a5f2b1e379f1d3f071f18214d7d5e9

3 years agoMerge changes I9f667570,I056a3fdc,I685a3220,I81cdee3a,I7e053cff
Treehugger Robot [Wed, 13 Jan 2021 20:38:03 +0000 (20:38 +0000)]
Merge changes I9f667570,I056a3fdc,I685a3220,I81cdee3a,I7e053cff

* changes:
  Properly use tHCI_STATUS and hci error code equivalence
  Use proper stack/btm/btm_sec::btm_status_text
  gd: Include hci handle in unsuccessful mode change event
  Use proper bta/gatt/bta_gattc_act::gatt_disconnection_reason_text
  Add gatt_disconnection_reason_text

3 years agoL2cap shim: Implement L2CA_GetBleConnRole
Hansong Zhang [Wed, 13 Jan 2021 05:54:54 +0000 (21:54 -0800)]
L2cap shim: Implement L2CA_GetBleConnRole

Note: We haven't routed LE link property callbacks yet.

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

3 years agoRemove unused API L2CA_CancelBleConnectReq
Hansong Zhang [Wed, 13 Jan 2021 05:39:42 +0000 (21:39 -0800)]
Remove unused API L2CA_CancelBleConnectReq

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

3 years agogatt_disconnect: Remove L2CA_CancelBleConnectReq
Hansong Zhang [Wed, 13 Jan 2021 05:15:31 +0000 (21:15 -0800)]
gatt_disconnect: Remove L2CA_CancelBleConnectReq

When the link is not up, we need to cancel create connection.  In this
case, calling L2CA_CancelBleConnectReq() is just removing the gatt
direct connect client CONN_MGR_ID_L2CAP.  Then we clean up tcb.

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

3 years agoRefactor LE disconnnect reason
Hansong Zhang [Wed, 13 Jan 2021 03:06:44 +0000 (19:06 -0800)]
Refactor LE disconnnect reason

When we initiate a disconnection, the reason should always be terminated
by local host.  We only need to check the reason when there is a
disconnection complete HCI event.  Therefore, we can get rid of
L2CA_GetDisconnectReason().

The only GATT app using disconnect reason is HOGP, and the only
interesting state is connection timeout.  Send this event from shim.

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

3 years agoMerge changes I8e04ea0c,Ia710365d
Treehugger Robot [Wed, 13 Jan 2021 19:43:55 +0000 (19:43 +0000)]
Merge changes I8e04ea0c,Ia710365d

* changes:
  gd: Handle data status for extended advertising report
  gd: Handle scan response

3 years agop_clcb->reason is never set
Hansong Zhang [Wed, 13 Jan 2021 01:47:08 +0000 (17:47 -0800)]
p_clcb->reason is never set

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

3 years agoRemove unused data length API
Hansong Zhang [Wed, 13 Jan 2021 00:34:53 +0000 (16:34 -0800)]
Remove unused data length API

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

3 years agoSupport BTM_SetBleDataLength when L2cap shim is on
Hansong Zhang [Wed, 13 Jan 2021 00:22:00 +0000 (16:22 -0800)]
Support BTM_SetBleDataLength when L2cap shim is on

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

3 years agoGATT: Set data length directly
Hansong Zhang [Wed, 13 Jan 2021 00:17:27 +0000 (16:17 -0800)]
GATT: Set data length directly

Since only GATT, hearing aid (hardcoded), JNI (hidden API) can set data
length, we just skip L2cap set data length path, and directly send HCI
command.

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

3 years agoFix v2 format decoding in btsnooz.py
Neil Mayhew [Thu, 10 Dec 2020 03:14:15 +0000 (20:14 -0700)]
Fix v2 format decoding in btsnooz.py

The delta_time_ms field now seems to be 64 bits instead of 32. Without
this change, dumps fail to decode and the script exits with a TypeError
because type_to_hci encounters an unknown packet type.

Bug: 175283029
Test: ./btsnooz.py bugreport-WXYZ.txt
Tag: #refactor
Sponsor: optedoblivion@
Change-Id: Ib893ee63abacf5335a4cbabb1dbdfc1702da77e6

3 years agoClean up BTM_SetBleDataLength
Hansong Zhang [Wed, 13 Jan 2021 00:14:13 +0000 (16:14 -0800)]
Clean up BTM_SetBleDataLength

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

3 years agoSimplify max data length request
Hansong Zhang [Wed, 13 Jan 2021 00:11:26 +0000 (16:11 -0800)]
Simplify max data length request

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