OSDN Git Service

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

3 years agorusty-gd: convert hci facade to rust_grpcio build targets
Zach Johnson [Mon, 9 Nov 2020 00:54:29 +0000 (16:54 -0800)]
rusty-gd: convert hci facade to rust_grpcio build targets

also, cleans up some of the temp hacks

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

3 years agorusty-gd: add stubs for hci hal facade
Zach Johnson [Thu, 5 Nov 2020 02:17:48 +0000 (18:17 -0800)]
rusty-gd: add stubs for hci hal facade

no implementation quite yet

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

3 years agoMerge changes Ibd11c0a8,I11fe6201,I63049dbb,I97ef3f26,I11cbffde, ...
Zach Johnson [Mon, 9 Nov 2020 00:55:52 +0000 (00:55 +0000)]
Merge changes Ibd11c0a8,I11fe6201,I63049dbb,I97ef3f26,I11cbffde, ...

* changes:
  rusty-gd: clean up imports & pub exports
  rusty-gd: remove one level of indirection for hci facade proto
  rusty-gd: collapse facade implementation into facade.rs
  rusty-gd: move hci facade client contents to root server
  Start integration with gd rust & cert tests
  GD: signal on signal port when server is ready
  Catch sigint to shut down BT testing process

3 years agoenum-ify stack/include/smp_api_types::SMP_OPCODE
Chris Manton [Sun, 11 Oct 2020 23:14:17 +0000 (16:14 -0700)]
enum-ify stack/include/smp_api_types::SMP_OPCODE

Toward readable code

Bug: 163134718
Tag: #refactor
Test: Paired phones on le link

Change-Id: Ia125cf73a67b8244d45d83959fd3ac7cff41b76e

3 years agogd_acl_shim: Wrap remote version check
Chris Manton [Sat, 7 Nov 2020 19:13:35 +0000 (11:13 -0800)]
gd_acl_shim: Wrap remote version check

With gd the remote version information may not yet
be complete when smp calculates pairing
authentication requirements.

Bug: 166280067
Tag: #refactor
Test: Paired phones on le link

Change-Id: I4755b1f8475383fbced6fd3c7c4c3871d2c9e3b8

3 years agoAdd shim btm_read_remote_version_complete
Chris Manton [Sat, 7 Nov 2020 19:03:45 +0000 (11:03 -0800)]
Add shim btm_read_remote_version_complete

Plumb through remote version info for shim classic and le

Bug: 166280067
Tag: #refactor
Test: Paired phones on le link

Change-Id: I48f2436c655b7818e7812ae70ceb4f24250edc70

3 years agoRestore ability to send read remote version information on le links
Chris Manton [Sat, 7 Nov 2020 18:11:22 +0000 (10:11 -0800)]
Restore ability to send read remote version information on le links

Currently unable to send command via gd

Bug: 171568335
Tag: #refactor
Test: Paired phones on le link
Change-Id: I923030e9378e95786e0a6ae6275c68120cc3d504

3 years agogd: Add le read_remote_version_info
Chris Manton [Sat, 7 Nov 2020 17:19:04 +0000 (09:19 -0800)]
gd: Add le read_remote_version_info

This command may be executed on both le and classic links

Bug: 171568335
Test: Paired phones on le link
Tag: #refactor

Change-Id: I573ec222ff96761704a080148b06fada37afc835

3 years agosmp: Log if remote lmp_version is invalid
Chris Manton [Sat, 7 Nov 2020 06:06:24 +0000 (22:06 -0800)]
smp: Log if remote lmp_version is invalid

Unread, missing or late remote version info will force
drop from secure into legacy security mode

Bug: 163134718
Tag: #refactor
Test: Paired 2 phones using LE/nRF

Change-Id: I1e52ac96354981b6abbfc1d46e4323becf25b388

3 years agoUse tACL_CB::tACL_CONN::remote_version_info
Chris Manton [Wed, 4 Nov 2020 16:27:13 +0000 (08:27 -0800)]
Use tACL_CB::tACL_CONN::remote_version_info

Toward readable code

Bug: 163134718
Tag: #refactor
Test: Paired 2 phones using LE/nRF

Change-Id: I0421cea1528b907e9b479e6b9d6489705cea0b22

3 years agoAdd tACL_CB::tACL_CONN::remote_version_info
Chris Manton [Wed, 4 Nov 2020 16:22:03 +0000 (08:22 -0800)]
Add tACL_CB::tACL_CONN::remote_version_info

Group related data

Bug: 163134718
Tag: #refactor
Test: Paired 2 phones using LE/nRF

Change-Id: I3382d00ae31114fca5a6292514b83c8ef1f5b44c

3 years agoAdd le transport to BTM_ReadRemoteVersion
Chris Manton [Sat, 7 Nov 2020 04:31:37 +0000 (20:31 -0800)]
Add le transport to BTM_ReadRemoteVersion

Both classic/br_edr and le can use this command

Bug: 171568335
Tag: #refactor
Test: Paired 2 phones using LE/nRF

Change-Id: Ib644fa9cf21cbfac28e940b0dc5701637199496c

3 years agoReplace return tBTM_STATUS=>bool BTM_ReadRemoteVersion
Chris Manton [Sat, 7 Nov 2020 05:23:59 +0000 (21:23 -0800)]
Replace return tBTM_STATUS=>bool BTM_ReadRemoteVersion

Toward readable code

Bug: 163134718
Tag: #refactor
Test: Paired 2 phones using LE/nRF

Change-Id: I5a1cd8ee552e6277a77fa3eef52becbe5a4a7401

3 years agorusty-gd: clean up imports & pub exports
Zach Johnson [Thu, 5 Nov 2020 01:31:15 +0000 (17:31 -0800)]
rusty-gd: clean up imports & pub exports

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

3 years agorusty-gd: remove one level of indirection for hci facade proto
Zach Johnson [Thu, 5 Nov 2020 01:22:31 +0000 (17:22 -0800)]
rusty-gd: remove one level of indirection for hci facade proto

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

3 years agorusty-gd: collapse facade implementation into facade.rs
Zach Johnson [Thu, 5 Nov 2020 00:57:09 +0000 (16:57 -0800)]
rusty-gd: collapse facade implementation into facade.rs

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

3 years agorusty-gd: move hci facade client contents to root server
Zach Johnson [Thu, 5 Nov 2020 00:41:23 +0000 (16:41 -0800)]
rusty-gd: move hci facade client contents to root server

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

3 years agoStart integration with gd rust & cert tests
Zach Johnson [Wed, 4 Nov 2020 23:24:55 +0000 (15:24 -0800)]
Start integration with gd rust & cert tests

two additional flags for gd/cert/run

--rust (rust on device)
--rhost (rust on host)

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

3 years agoGD: signal on signal port when server is ready
Zach Johnson [Tue, 3 Nov 2020 19:11:26 +0000 (11:11 -0800)]
GD: signal on signal port when server is ready

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

3 years agoCatch sigint to shut down BT testing process
Zach Johnson [Tue, 3 Nov 2020 18:47:39 +0000 (10:47 -0800)]
Catch sigint to shut down BT testing process

Temporary nix-based hack until we have tokio signal support.

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

3 years agoL2cap: Route some functions to shim
Hansong Zhang [Wed, 28 Oct 2020 20:00:12 +0000 (13:00 -0700)]
L2cap: Route some functions to shim

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

3 years agoIntroduce L2cap security shim
Hansong Zhang [Wed, 28 Oct 2020 23:46:15 +0000 (16:46 -0700)]
Introduce L2cap security shim

L2cap security shim lets GD L2cap wants to enforce security requirements
on legacy security module.

Implementing the GD security interface.

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

3 years agoRe-log BTM_AcceptlistAdd
Chris Manton [Wed, 28 Oct 2020 01:42:41 +0000 (18:42 -0700)]
Re-log BTM_AcceptlistAdd

Toward readable code

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

Change-Id: I8837ee84d898a1f996b4594846af9c3c5ef39bf7

3 years agoReturn bool=>void stack/btm/btm_ble::BTM_SecAddBleKey
Chris Manton [Tue, 3 Nov 2020 23:36:43 +0000 (15:36 -0800)]
Return bool=>void stack/btm/btm_ble::BTM_SecAddBleKey

Toward readable code

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

Change-Id: Iee8f8c0981c3084945365974ea77e91c38d57dbf

3 years agoRemove return value stack/btm/btm_ble_gap::btm_ble_start_scan
Chris Manton [Tue, 3 Nov 2020 23:44:41 +0000 (15:44 -0800)]
Remove return value stack/btm/btm_ble_gap::btm_ble_start_scan

Toward readable code

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

Change-Id: I02c553cd9b31897bf91d27107e8bc1b2c0758658

3 years agoReturn bool=>void stack/btm/btm_ble::BTM_SecAddBleDevice
Chris Manton [Tue, 3 Nov 2020 23:29:21 +0000 (15:29 -0800)]
Return bool=>void stack/btm/btm_ble::BTM_SecAddBleDevice

Unnecessary level of error checking

Toward readable code

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

Change-Id: Ia6a8ddcc4f6cc2ee2d7094a61e4818ba94989954

3 years agoClean up btm_acl_update_conn_addr
Chris Manton [Wed, 4 Nov 2020 16:05:33 +0000 (08:05 -0800)]
Clean up btm_acl_update_conn_addr

Toward readable code

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

Change-Id: I9f9fb06cc11e89256c03e7a1e50e03a9a893697d

3 years agobtaa: introduce btif interface for btaa
Michael Sun [Mon, 2 Nov 2020 07:17:47 +0000 (07:17 +0000)]
btaa: introduce btif interface for btaa

Add a new btif interface for Activity Attribution to help communicate
between JNI and BTAA core module

Tag: #feature
Bug: 172501038
Test: m

Change-Id: Idc7fbb126040bc0b2757b871e9ff6ef8ae889dcf

3 years agobtaa: new include files in bt stack for BTAA interface
Michael Sun [Mon, 2 Nov 2020 07:17:15 +0000 (07:17 +0000)]
btaa: new include files in bt stack for BTAA interface

Add new includes files for JNI and btif interfaces development of
activity attribution (BTAA). This change only defines the skeleton of
BTAA interface and its callback structures, more implementation will
follow.

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

3 years agoMerge "Read set data length support flag from peer_le_features"
Weichin Weng [Fri, 6 Nov 2020 02:54:39 +0000 (02:54 +0000)]
Merge "Read set data length support flag from peer_le_features"

3 years agoRead set data length support flag from peer_le_features
weichinweng [Thu, 5 Nov 2020 08:19:13 +0000 (16:19 +0800)]
Read set data length support flag from peer_le_features

Read set data length support flag from peer_le_features.

Bug: 167153759
Tag: #feature
Test: compile & verify basic functions and Hearing Aid profile working
Change-Id: I131634d413c20f973e8a8a4b7bfdeb7ee82a67a1

3 years agoSimplify bta_dm_rm_cfg
Hansong Zhang [Wed, 4 Nov 2020 23:21:54 +0000 (15:21 -0800)]
Simplify bta_dm_rm_cfg

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

3 years agoBTA_AV_FEAT_CENTRAL is never used.
Hansong Zhang [Wed, 4 Nov 2020 23:10:49 +0000 (15:10 -0800)]
BTA_AV_FEAT_CENTRAL is never used.

Features can be traced down to BTA_AvEnable().

BTA_AV_FEAT_CENTRAL is never set.

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

3 years agoWe always want to switch role to central
Hansong Zhang [Wed, 4 Nov 2020 22:55:45 +0000 (14:55 -0800)]
We always want to switch role to central

When we continue role switch from mode change or encryption change, we
always want to switch to central, as we only made requests to change to
central.

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

3 years agoRefactor BTM_SwitchRole
Hansong Zhang [Wed, 4 Nov 2020 22:46:14 +0000 (14:46 -0800)]
Refactor BTM_SwitchRole

We always want to switch to central.

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

3 years agoMove btm_ble_get_acl_remote_addr
Hansong Zhang [Fri, 30 Oct 2020 04:50:46 +0000 (21:50 -0700)]
Move btm_ble_get_acl_remote_addr

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

3 years agoIntroduce btm_get_dev_class
Hansong Zhang [Fri, 30 Oct 2020 04:43:55 +0000 (21:43 -0700)]
Introduce btm_get_dev_class

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

3 years agoACL: Refactor btm_ble_get_acl_remote_addr
Hansong Zhang [Fri, 30 Oct 2020 04:28:47 +0000 (21:28 -0700)]
ACL: Refactor btm_ble_get_acl_remote_addr

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

3 years agoMerge "libstatslog (libbinder) users disable on darwin"
Steven Moreland [Thu, 5 Nov 2020 19:33:54 +0000 (19:33 +0000)]
Merge "libstatslog (libbinder) users disable on darwin"

3 years agoMerge "isomanager: Add callback to create cis command"
Jakub Pawlowski [Thu, 5 Nov 2020 18:41:43 +0000 (18:41 +0000)]
Merge "isomanager: Add callback to create cis command"

3 years agoMerge "gd: Refactor LE advertising config"
Myles Watson [Thu, 5 Nov 2020 17:18:44 +0000 (17:18 +0000)]
Merge "gd: Refactor LE advertising config"

3 years agolibstatslog (libbinder) users disable on darwin
Steven Moreland [Thu, 5 Nov 2020 16:16:45 +0000 (16:16 +0000)]
libstatslog (libbinder) users disable on darwin

libbinder doesn't support mac.

Bug: 172023026
Test: N/A
Change-Id: Ib39fa195b9313d9d75ce903f2a871a5110abde68

3 years agogd: Refactor LE advertising config
Chienyuan [Tue, 3 Nov 2020 12:56:56 +0000 (20:56 +0800)]
gd: Refactor LE advertising config

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

3 years agoSimplify btm_remove_acl
Hansong Zhang [Fri, 30 Oct 2020 04:16:20 +0000 (21:16 -0700)]
Simplify btm_remove_acl

If btm_sec already sent HCI disconnect, and we send it again, we get bad
handle error, but it's ok.  Other users are sending disconnect without
checking btm_sec.

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

3 years agoRefactor acl_refresh_remote_address
Hansong Zhang [Fri, 30 Oct 2020 04:06:32 +0000 (21:06 -0700)]
Refactor acl_refresh_remote_address

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

3 years agoClean up check_sdp_bl
Hansong Zhang [Fri, 30 Oct 2020 03:58:53 +0000 (20:58 -0700)]
Clean up check_sdp_bl

Some variables are unused or overriden

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

3 years agoMinor refactor on remote version comparison
Hansong Zhang [Fri, 30 Oct 2020 03:48:03 +0000 (20:48 -0700)]
Minor refactor on remote version comparison

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