OSDN Git Service

android-x86/system-bt.git
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 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 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 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 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

3 years agoHci layer: Minor clean up
Hansong Zhang [Tue, 17 Nov 2020 23:05:15 +0000 (15:05 -0800)]
Hci layer: Minor clean up

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

3 years agoMerge "enum-ify stack/include/bt_types::BT_PSM_"
Chris Manton [Wed, 18 Nov 2020 00:50:23 +0000 (00:50 +0000)]
Merge "enum-ify stack/include/bt_types::BT_PSM_"

3 years agoL2cap shim improvement
Hansong Zhang [Thu, 5 Nov 2020 23:41:54 +0000 (15:41 -0800)]
L2cap shim improvement

Implement ReadRemoteVersion in L2cap shim.
Notify BTA layer directly when connection is up/down.

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

3 years agoL2cap shim: Add role switch
Hansong Zhang [Thu, 5 Nov 2020 23:35:45 +0000 (15:35 -0800)]
L2cap shim: Add role switch

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

3 years agoenum-ify stack/include/bt_types::BT_PSM_
Chris Manton [Fri, 13 Nov 2020 23:55:42 +0000 (15:55 -0800)]
enum-ify stack/include/bt_types::BT_PSM_

Toward readable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: Icf24f483a807c28763bf677f5d01b13cc3c9c553

3 years agoremove invalid test, restucture simple_hal_test
Zach Johnson [Thu, 12 Nov 2020 20:57:34 +0000 (12:57 -0800)]
remove invalid test, restucture simple_hal_test

use PyHal abstractions

test_none_event only passed on C++ gd because the reset event
was dropped because the test had not yet asked for the event
stream.

doesn't happen with rust, so the test was failing. by using the
abstractions, the stream gets registered before anthing happens
so the behavior is consistent.

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

3 years agorusty-gd: plumb through ACL in the hal
Zach Johnson [Thu, 12 Nov 2020 01:43:29 +0000 (17:43 -0800)]
rusty-gd: plumb through ACL in the hal

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

3 years agorusty-gd: plumb through commands and events for the hci hal facade
Zach Johnson [Wed, 11 Nov 2020 23:19:48 +0000 (15:19 -0800)]
rusty-gd: plumb through commands and events for the hci hal facade

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

3 years agoacl: Implement ReadRemoteVersionInformation for LE
Myles Watson [Tue, 17 Nov 2020 17:35:54 +0000 (09:35 -0800)]
acl: Implement ReadRemoteVersionInformation for LE

Bug: 172725986
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Change-Id: I114c5510ea8396244c68b11b333249092333cff9

3 years agoacl: Remove DisconnectorForLe
Myles Watson [Tue, 17 Nov 2020 15:30:54 +0000 (07:30 -0800)]
acl: Remove DisconnectorForLe

Bug: 172725986
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Change-Id: Id9a5dcbba3f4be0490baa13d3ff538f0f2158c5c

3 years agoAdd AclCommands for LE and BR/EDR
Myles Watson [Tue, 17 Nov 2020 05:24:21 +0000 (21:24 -0800)]
Add AclCommands for LE and BR/EDR

Bug: 172725986
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Change-Id: I822ce0751be08a98a30c219853e1540e2e461a08

3 years agoMerge "hci: Close linter IfChange block"
Treehugger Robot [Tue, 17 Nov 2020 07:03:43 +0000 (07:03 +0000)]
Merge "hci: Close linter IfChange block"

3 years agohci: Close linter IfChange block
Myles Watson [Tue, 17 Nov 2020 05:34:20 +0000 (21:34 -0800)]
hci: Close linter IfChange block

Bug: 172725986
Test: Upload CL and look for the linter complaining
Tag: #gd-refactor
Change-Id: Iadc778588d6ef95253c1efa4459c39feca845498

3 years agoMerge "btaa: do not initialize btaa module if init flag set to false"
Treehugger Robot [Tue, 17 Nov 2020 01:06:41 +0000 (01:06 +0000)]
Merge "btaa: do not initialize btaa module if init flag set to false"

3 years agoMerge "btaa: null check btaa instance when receiving callback from SystemSuspend"
Treehugger Robot [Mon, 16 Nov 2020 23:17:24 +0000 (23:17 +0000)]
Merge "btaa: null check btaa instance when receiving callback from SystemSuspend"

3 years agobtaa: do not initialize btaa module if init flag set to false
Michael Sun [Mon, 16 Nov 2020 22:24:18 +0000 (22:24 +0000)]
btaa: do not initialize btaa module if init flag set to false

Tag: #feature
Bug: 173435736
Test: m, verified BTAA not get initialized
Change-Id: I6b4195df5c908e5d7ccd7d27424c6bda7d7e5a36

3 years agobtaa: null check btaa instance when receiving callback from SystemSuspend
Michael Sun [Mon, 16 Nov 2020 21:53:12 +0000 (21:53 +0000)]
btaa: null check btaa instance when receiving callback from SystemSuspend

Perform null pointer check upon receive callbacks from SystemSuspend
to mitigation the exception caused crash.

Tag: #feature
Bug: 173435736
Test: m
Change-Id: Ie15d179ebce82fdd91f32b3d8a98bb9bf8c66e84

3 years agoMerge "SecurityManager: Add CreateBondOutOfBand interface."
Treehugger Robot [Mon, 16 Nov 2020 21:52:21 +0000 (21:52 +0000)]
Merge "SecurityManager: Add CreateBondOutOfBand interface."

3 years agoMerge "GD Security OobData"
Treehugger Robot [Mon, 16 Nov 2020 21:28:49 +0000 (21:28 +0000)]
Merge "GD Security OobData"

3 years agoMerge changes I4386b836,I27e6b6ce,I84842b13
Treehugger Robot [Mon, 16 Nov 2020 20:30:58 +0000 (20:30 +0000)]
Merge changes I4386b836,I27e6b6ce,I84842b13

* changes:
  GD Security Facade
  CertSecurity: Add accept_oob_pairing function
  Cert SecurityTest: Create branching conditional for multi test run

3 years agoMerge changes I53b512b1,I1be0028c,Iabd6b355,I7d3ccb15
Myles Watson [Mon, 16 Nov 2020 20:27:23 +0000 (20:27 +0000)]
Merge changes I53b512b1,I1be0028c,Iabd6b355,I7d3ccb15

* changes:
  CertSecurity: Add OOB related interfaces
  PySecurity: Add enable_secure_connections interface
  HciCaptures: Add OOB Related captures
  HciMatchers: Add OOB Related events.

3 years agoMerge "rusty-gd: switch added services based on module under test"
Zach Johnson [Mon, 16 Nov 2020 20:22:59 +0000 (20:22 +0000)]
Merge "rusty-gd: switch added services based on module under test"

3 years agoSecurityManager: Add CreateBondOutOfBand interface.
Martin Brabham [Mon, 16 Nov 2020 18:45:25 +0000 (10:45 -0800)]
SecurityManager: Add CreateBondOutOfBand interface.

Allow for creating bonds with remote Out of Band data.

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

3 years agoGD Security OobData
Martin Brabham [Mon, 16 Nov 2020 18:39:50 +0000 (10:39 -0800)]
GD Security OobData

Create an object to represent OobData in the Security Module.

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

3 years agoGD Security Facade
Martin Brabham [Fri, 13 Nov 2020 03:38:40 +0000 (19:38 -0800)]
GD Security Facade

Add CreateBondOutOfBand and OobDataBondMessage

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

3 years agorusty-gd: switch added services based on module under test
Zach Johnson [Wed, 11 Nov 2020 21:54:16 +0000 (13:54 -0800)]
rusty-gd: switch added services based on module under test

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

3 years agoCertSecurity: Add OOB related interfaces
Martin Brabham [Fri, 13 Nov 2020 23:06:55 +0000 (15:06 -0800)]
CertSecurity: Add OOB related interfaces

 - set_remote_oob_data
 - get_oob_data_from_controller
 - enable_secure_connections

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

3 years agoCertSecurity: Add accept_oob_pairing function
Martin Brabham [Sat, 14 Nov 2020 00:06:35 +0000 (16:06 -0800)]
CertSecurity: Add accept_oob_pairing function

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

3 years agoPySecurity: Add enable_secure_connections interface
Martin Brabham [Fri, 13 Nov 2020 21:59:46 +0000 (13:59 -0800)]
PySecurity: Add enable_secure_connections interface

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

3 years agoCert SecurityTest: Create branching conditional for multi test run
Martin Brabham [Fri, 13 Nov 2020 23:47:13 +0000 (15:47 -0800)]
Cert SecurityTest: Create branching conditional for multi test run

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

3 years agoHciCaptures: Add OOB Related captures
Martin Brabham [Fri, 13 Nov 2020 00:40:07 +0000 (16:40 -0800)]
HciCaptures: Add OOB Related captures

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

3 years agoHciMatchers: Add OOB Related events.
Martin Brabham [Fri, 13 Nov 2020 00:39:16 +0000 (16:39 -0800)]
HciMatchers: Add OOB Related events.

Additionally, add a useful Logger function that assisted with
solving the problem.

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

3 years agoMerge "Simplify HAL protos"
Zach Johnson [Mon, 16 Nov 2020 18:06:56 +0000 (18:06 +0000)]
Merge "Simplify HAL protos"

3 years agoshim: check subevent for advertising module
Chienyuan [Mon, 16 Nov 2020 08:47:58 +0000 (16:47 +0800)]
shim: check subevent for advertising module

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

3 years agoMerge "Disable sniff for faulty remotes"
Treehugger Robot [Mon, 16 Nov 2020 01:54:17 +0000 (01:54 +0000)]
Merge "Disable sniff for faulty remotes"

3 years agoCanonicalization of tGATT_CBACK gap and gatt
Chris Manton [Thu, 12 Nov 2020 18:41:01 +0000 (10:41 -0800)]
Canonicalization of tGATT_CBACK gap and gatt

Towards readable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I34092cd3c8776d649532a192e90190516d2ae09d

3 years agoMerge "Fix for Multiplication overflow will be crash btstack"
Treehugger Robot [Sat, 14 Nov 2020 00:07:38 +0000 (00:07 +0000)]
Merge "Fix for Multiplication overflow will be crash btstack"

3 years agoMerge changes I014fe130,I2e0301e3
Zach Johnson [Fri, 13 Nov 2020 19:41:21 +0000 (19:41 +0000)]
Merge changes I014fe130,I2e0301e3

* changes:
  rusty-gd: convert hci facade to rust_grpcio build targets
  rusty-gd: add stubs for hci hal facade

3 years agoFix for Multiplication overflow will be crash btstack
cnx421 [Fri, 6 Nov 2020 07:35:04 +0000 (15:35 +0800)]
Fix for Multiplication overflow will be crash btstack

When a2dp using LDAC ecoding PCM,if encoding thread is runned by deley after 2 secends,
btstack will overflow .System will abort to crash by arm gcc code.

Bug: 172590955
Tag: #stability
Test: compile & verify basic functions working
Test: pair to a support LDAC ecode BT headset

Change-Id: Ie470bd51bfd7951d0c674b37aa6af7554cf9faa8

3 years agoMerge "gd: Use ExtendedAdvertising as main advertising function"
Treehugger Robot [Fri, 13 Nov 2020 06:42:38 +0000 (06:42 +0000)]
Merge "gd: Use ExtendedAdvertising as main advertising function"

3 years agoMerge changes Ida69a204,Iad4dbf36,I6749a539,Iab3b9763
Michael Sun [Thu, 12 Nov 2020 20:35:32 +0000 (20:35 +0000)]
Merge changes Ida69a204,Iad4dbf36,I6749a539,Iab3b9763

* changes:
  btaa: subscribe to bt_snoop to receive HCI data
  btaa: subscribe to SystemSuspend for wakelock notification
  btaa: subscribe to SystemSuspend for wakeup notification
  btaa: introduce Bluetooth Activity Attribution skeleton

3 years agol2cap: Allow services without config indicator cb to register
Chris Manton [Wed, 11 Nov 2020 19:44:29 +0000 (11:44 -0800)]
l2cap: Allow services without config indicator cb to register

l2cap prevented BNEP from registering b/c of a missing
(now optional) config indicator callback.

Bug: 170278807
Tag: #stability
Test: CtsVerifier

Change-Id: Ibe849b2de82913f2228d877227179c223aab8c4e

3 years agoRe-log stack/l2cap/l2c_api::L2CA_DisconnectReq
Chris Manton [Thu, 12 Nov 2020 00:44:15 +0000 (16:44 -0800)]
Re-log stack/l2cap/l2c_api::L2CA_DisconnectReq

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I407f9aa305a8e70c23a1b83a898684f2798a5a32

3 years agoRe-log stack/acl/btm_acl::acl_disconnect_after_role_switch
Chris Manton [Thu, 12 Nov 2020 00:44:45 +0000 (16:44 -0800)]
Re-log stack/acl/btm_acl::acl_disconnect_after_role_switch

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: Ifa72697bc33520e21c51ce7d82856497adf6f282

3 years agoRe-log stack/gatt/gatt_cl::gatt_process_prep_write_rsp
Chris Manton [Thu, 12 Nov 2020 16:40:10 +0000 (08:40 -0800)]
Re-log stack/gatt/gatt_cl::gatt_process_prep_write_rsp

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: Ice004fb4babd77075dd1dba26198186df75c5880

3 years agoStat-ify btif/src/btif_gatt_client
Chris Manton [Thu, 12 Nov 2020 00:44:27 +0000 (16:44 -0800)]
Stat-ify btif/src/btif_gatt_client

Toward readable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I2d7da0024fefd37ae7c72d0e13d3087904740182

3 years agoAdd btif/src/btif_gatt_client::bta_gattc_event_text
Chris Manton [Wed, 11 Nov 2020 22:03:43 +0000 (14:03 -0800)]
Add btif/src/btif_gatt_client::bta_gattc_event_text

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I041492f74c5e0d91f1b8f45370c263bcd8f5b343

3 years agogatt: Properly put gatt status in field
Chris Manton [Thu, 12 Nov 2020 02:27:12 +0000 (18:27 -0800)]
gatt: Properly put gatt status in field

Bug: 172805487
Test: CtsVerifier
Tag: #stability

Change-Id: I4e730cd8b367fe9764bae3bc49a7a4ee8f00c708

3 years agoDisable sniff for faulty remotes
Venkata Jagadeesh Garaga [Thu, 23 May 2019 12:43:53 +0000 (18:13 +0530)]
Disable sniff for faulty remotes

Some remote supports sniff but when dut initiates sniff req,
remote wont respond and acl connection will be terminated
from soc with LMP responce time out

Tag: #compatibility
Bug: 163109241
Test: Manual
Change-Id: I77b5c0daf22c9f3adaf2a7b75c20bc8e27d8990c

3 years agol2cap: Add mtu and mps to lead eatt channel
Chris Manton [Wed, 11 Nov 2020 20:58:17 +0000 (12:58 -0800)]
l2cap: Add mtu and mps to lead eatt channel

Bug: 159786353
Test: CtsVerifier
Tag: #feature

Change-Id: Ia5be81bde7a10d0b8e466b9b856d75d52b43a349

3 years agoRe-log stack/l2cap/l2c_ble::l2cble_process_sig_cmd
Chris Manton [Wed, 11 Nov 2020 20:03:41 +0000 (12:03 -0800)]
Re-log stack/l2cap/l2c_ble::l2cble_process_sig_cmd

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I6aad2f2d7768fc5baaab2577c5c6814d23629c53

3 years agoStat-ify functions in bta/sys/bta_sys_main
Chris Manton [Wed, 11 Nov 2020 23:40:56 +0000 (15:40 -0800)]
Stat-ify functions in bta/sys/bta_sys_main

Toward readble code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: Ibb761116da5ccec5562ac144349f8f419cb10319

3 years agoAdd BtaIdSysText::BTA_ID_GATTC
Chris Manton [Thu, 12 Nov 2020 00:27:13 +0000 (16:27 -0800)]
Add BtaIdSysText::BTA_ID_GATTC

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I554f271c622e8c9e7285b26494bdd90bd0a68822

3 years agoAdd stack/include/l2cdefs::l2cap_le_result_code_text
Chris Manton [Wed, 11 Nov 2020 16:54:36 +0000 (08:54 -0800)]
Add stack/include/l2cdefs::l2cap_le_result_code_text

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I4ed9cca2e866f5862e029916e2b964e720628eb2

3 years agoUse stack/l2cap/l2c_csm::channel_state_text()
Chris Manton [Wed, 11 Nov 2020 16:20:19 +0000 (08:20 -0800)]
Use stack/l2cap/l2c_csm::channel_state_text()

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I29fde7572ac65e739d83cec7c19cae2d3bd773a6

3 years agoenum-ify stack/l2cap/l2c_int::L2CEVT_LP
Chris Manton [Wed, 11 Nov 2020 15:57:27 +0000 (07:57 -0800)]
enum-ify stack/l2cap/l2c_int::L2CEVT_LP

Toward readable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I03fa8bfd1866d7bb3d8cb8a1b7c6315c744728c4

3 years agoAdd stack/l2cap/l2c_csm::channel_state_text
Chris Manton [Wed, 11 Nov 2020 15:51:12 +0000 (07:51 -0800)]
Add stack/l2cap/l2c_csm::channel_state_text

Toward loggable code

Bug: 163134718
Tag: #refactor
Test: CtsVerifier

Change-Id: I6a85fe9e5d0ae3c16fa2dd5fe4933f754f270a9f

3 years agoSimplify HAL protos
Zach Johnson [Wed, 11 Nov 2020 20:51:59 +0000 (12:51 -0800)]
Simplify HAL protos

* It's the HciHal, so HCI on functions and structs is redundant.
* FetchXYZ returns a stream, so rename to StreamXYZ
* Event & Commands are less about packets, so drop packet from the
struct names

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

3 years agoClean up user apps before GD is shutdown
Hansong Zhang [Wed, 11 Nov 2020 19:25:16 +0000 (11:25 -0800)]
Clean up user apps before GD is shutdown

GATT, L2C, SDP, BTM depend on GD core modules if GD is enabled. Stop
them first before GD.

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

3 years agoMerge "L2CAP: keep cached peer configuration locally"
Treehugger Robot [Wed, 11 Nov 2020 17:41:14 +0000 (17:41 +0000)]
Merge "L2CAP: keep cached peer configuration locally"

3 years agoMerge "Use p_acl->remote_addr to do BTA_dm_acl_down"
Treehugger Robot [Wed, 11 Nov 2020 01:01:02 +0000 (01:01 +0000)]
Merge "Use p_acl->remote_addr to do BTA_dm_acl_down"

3 years agoMerge changes from topics "btaa-jni-1", "btaa-jni-2"
Michael Sun [Wed, 11 Nov 2020 00:00:11 +0000 (00:00 +0000)]
Merge changes from topics "btaa-jni-1", "btaa-jni-2"

* changes:
  btaa: introduce btif interface for btaa
  btaa: new include files in bt stack for BTAA interface

3 years agogd: Use ExtendedAdvertising as main advertising function
Chienyuan [Tue, 10 Nov 2020 11:27:54 +0000 (19:27 +0800)]
gd: Use ExtendedAdvertising as main advertising function

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

3 years agobtaa: subscribe to bt_snoop to receive HCI data
Michael Sun [Fri, 6 Nov 2020 19:53:59 +0000 (19:53 +0000)]
btaa: subscribe to bt_snoop to receive HCI data

Subscribe to the btsnoop_mem to receive HCI data when captured.

Tag: #feature
Bug: 170315554
Test: verified BTAA module receives specified HCI packets

Change-Id: Ida69a204f11cb13aca6eda28a5850b8b576e5f17

3 years agobtaa: subscribe to SystemSuspend for wakelock notification
Michael Sun [Fri, 6 Nov 2020 08:18:19 +0000 (08:18 +0000)]
btaa: subscribe to SystemSuspend for wakelock notification

Subscribe to the SystemSuspend provided wakelock information by the
Bluetooth wakelock name.

Tag: #feature
Bug: 170315554
Test: verified BTAA module receives specified wakelock notification

Change-Id: Iad4dbf36690aea2ba9b1f151f0d0d118e6015781

3 years agobtaa: subscribe to SystemSuspend for wakeup notification
Michael Sun [Fri, 6 Nov 2020 01:19:16 +0000 (01:19 +0000)]
btaa: subscribe to SystemSuspend for wakeup notification

This change initialize the SystemSuspend client at BTAA module and have
it subscribed to wakeup notification with wakeup reasons.

Tag: #feature
Bug: 170315554
Test: verified BTAA module receives wakeup notification
Change-Id: I6749a539f9a59f1893f4159cec6b7c9f517ead9d

3 years agobtaa: introduce Bluetooth Activity Attribution skeleton
Michael Sun [Thu, 5 Nov 2020 06:33:48 +0000 (06:33 +0000)]
btaa: introduce Bluetooth Activity Attribution skeleton

This change added skeleton implementation of Bluetooth Activity
Attribution (BTAA) into the Bluetooth stack.

Tag: #feature
Bug: 170315554
Test: verified locally BTAA module get initialized

Change-Id: Iab3b976370e4d1866e9a308d4e6f9a11cdff037c

3 years agoUse p_acl->remote_addr to do BTA_dm_acl_down
weichinweng [Tue, 10 Nov 2020 07:06:30 +0000 (15:06 +0800)]
Use p_acl->remote_addr to do BTA_dm_acl_down

Use p_acl->remote_addr to do BTA_dm_acl_down, not p_acl->conn_addr.

Bug: 171669750
Tag: #feature
Test: compile & forget BLE/Hearingaids device while connected.
Change-Id: Ie44e818c4bc176df5426996a06a99536c5250077

3 years agobtm_get_dev_class: Create empty record if not found
Hansong Zhang [Mon, 9 Nov 2020 19:38:02 +0000 (11:38 -0800)]
btm_get_dev_class: Create empty record if not found

We may not have a device record at that time, so create one if needed.
This fixes the diff introduces in https://android-review.googlesource.com/c/platform/system/bt/+/1480894/9/stack/acl/btm_acl.cc#b2183

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Test: pair to a speaker
Change-Id: I0149ecb7a11ed33f6cb6344f74c08746d948c513