OSDN Git Service

android-x86/system-bt.git
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 agoMerge "gd: Rename ApiType for LE advertising/scanning"
Chienyuan Huang [Tue, 3 Nov 2020 05:09:26 +0000 (05:09 +0000)]
Merge "gd: Rename ApiType for LE advertising/scanning"

3 years agoDev rec: Optimize HCI role switch supported logic
Hansong Zhang [Fri, 30 Oct 2020 03:13:56 +0000 (20:13 -0700)]
Dev rec: Optimize HCI role switch supported logic

We don't need to copy the entire supported feature pages.

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

3 years agoIntroduce dev_rec->remote_feature_received
Hansong Zhang [Fri, 30 Oct 2020 03:09:37 +0000 (20:09 -0700)]
Introduce dev_rec->remote_feature_received

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

3 years agobtm_sec: Clean up log spam
Hansong Zhang [Fri, 30 Oct 2020 03:00:44 +0000 (20:00 -0700)]
btm_sec: Clean up log spam

You can use btsnoop.

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

3 years agoCleanup/organize variable initialization
Martin Brabham [Tue, 11 Aug 2020 19:45:27 +0000 (12:45 -0700)]
Cleanup/organize variable initialization

Bug: 162984360
Tag: #refactor
Test: compiles and devices pair and work
Change-Id: Idf2a2c270a4633d9104f6f8c85dbea1584c2ba51

3 years agoFlatten btm_cont_rswitch_from_handle
Hansong Zhang [Fri, 30 Oct 2020 02:56:41 +0000 (19:56 -0700)]
Flatten btm_cont_rswitch_from_handle

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

3 years agoACL: btm_cont_rswitch no longer needs dev rec
Hansong Zhang [Fri, 30 Oct 2020 02:54:46 +0000 (19:54 -0700)]
ACL: btm_cont_rswitch no longer needs dev rec

We know is_encrypted.

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

3 years agoGD Security Pass local IRK and Address around
Jakub Pawlowski [Wed, 21 Oct 2020 21:11:50 +0000 (23:11 +0200)]
GD Security Pass local IRK and Address around

Bug: 142341141
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Change-Id: I55e4c4f9b2e778d2960b98783715d1bc278bfa9a

3 years agogd: Rename ApiType for LE advertising/scanning
Chienyuan [Mon, 2 Nov 2020 10:03:47 +0000 (18:03 +0800)]
gd: Rename ApiType for LE advertising/scanning

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

3 years agoMerge "gd: implement APIs of AdvertisingSet for LE 5.0"
Treehugger Robot [Mon, 2 Nov 2020 07:06:01 +0000 (07:06 +0000)]
Merge "gd: implement APIs of AdvertisingSet for LE 5.0"

3 years agoBTM_SecAddDevice: features is always nullptr
Hansong Zhang [Fri, 30 Oct 2020 02:45:32 +0000 (19:45 -0700)]
BTM_SecAddDevice: features is always nullptr

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

3 years agomsg->features is always 0 (nullptr)
Hansong Zhang [Fri, 30 Oct 2020 02:44:09 +0000 (19:44 -0700)]
msg->features is always 0 (nullptr)

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

3 years agoIntroduce ACL_CONN is_enceypted
Hansong Zhang [Fri, 30 Oct 2020 02:38:16 +0000 (19:38 -0700)]
Introduce ACL_CONN is_enceypted

Use it as the source of truth for enceyption state in ACL.

No need to check device record then.

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

3 years agoMove rs_disc_pending from security to ACL
Hansong Zhang [Fri, 30 Oct 2020 00:11:40 +0000 (17:11 -0700)]
Move rs_disc_pending from security to ACL

It's used by ACL.

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

3 years agogd: implement APIs of AdvertisingSet for LE 5.0
Chienyuan [Fri, 25 Sep 2020 10:19:10 +0000 (18:19 +0800)]
gd: implement APIs of AdvertisingSet for LE 5.0

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

3 years agoRe-log btif/src/btif_config::btif_get_address_type
Chris Manton [Thu, 29 Oct 2020 05:45:52 +0000 (22:45 -0700)]
Re-log btif/src/btif_config::btif_get_address_type

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: acts/bin/act.py -tp ~/Goog/tools/test/connectivity -tc BleCocTest

Change-Id: I83c78bdb13e808e352ced18f26e27f759b4c638b

3 years agoRe-log stack/gatt/gatt_api::GATT_Connect
Chris Manton [Thu, 29 Oct 2020 05:46:51 +0000 (22:46 -0700)]
Re-log stack/gatt/gatt_api::GATT_Connect

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: acts/bin/act.py -tp ~/Goog/tools/test/connectivity -tc BleCocTest

Change-Id: Ic33a2f3a2c0fb30aa2404186773257b7511eacd3

3 years agoMerge "Add binder interface for the BluetoothConnectionCallback"
Treehugger Robot [Fri, 30 Oct 2020 02:34:25 +0000 (02:34 +0000)]
Merge "Add binder interface for the BluetoothConnectionCallback"

3 years agoACL: Don't re-use known remote feature
Hansong Zhang [Thu, 29 Oct 2020 23:43:00 +0000 (16:43 -0700)]
ACL: Don't re-use known remote feature

Just wait for remote feature request to be done.  There is no use case
of using these features or sending SSP/SC to Security early.

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

3 years agoACL: Don't start l2cap security check on connection
Hansong Zhang [Thu, 29 Oct 2020 23:41:00 +0000 (16:41 -0700)]
ACL: Don't start l2cap security check on connection

It's not possible to have pending L2cap security enforcement request
when link is just established.

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

3 years agoACL: Remove unused field
Hansong Zhang [Thu, 29 Oct 2020 23:23:16 +0000 (16:23 -0700)]
ACL: Remove unused field

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

3 years agobtm_process_remote_ext_features: return if no record
Hansong Zhang [Thu, 29 Oct 2020 23:20:27 +0000 (16:20 -0700)]
btm_process_remote_ext_features: return if no record

It's not possible that we don't have a security when we receive remote
ext features, because we create a record upon ACL connection.  Not
possible for direct bonding as well.

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

3 years agoACL: Move some security flag change to Security
Hansong Zhang [Thu, 29 Oct 2020 23:00:09 +0000 (16:00 -0700)]
ACL: Move some security flag change to Security

Moving BTM_SEC_LE_LINK_KEY_AUTHED and BTM_SEC_ROLE_SWITCHED.

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

3 years agoACL: No need to clear these flags
Hansong Zhang [Thu, 29 Oct 2020 22:55:44 +0000 (15:55 -0700)]
ACL: No need to clear these flags

It's done in btm_sec.cc btm_sec_disconnected:

p_dev_rec->sec_flags &=
        ~(BTM_SEC_AUTHENTICATED | BTM_SEC_ENCRYPTED | BTM_SEC_ROLE_SWITCHED |
          BTM_SEC_16_DIGIT_PIN_AUTHED);

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

3 years agoACL minor clean up
Hansong Zhang [Thu, 29 Oct 2020 20:05:42 +0000 (13:05 -0700)]
ACL minor clean up

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

3 years agoMerge "Kick off Gabeldorsche Rust implementation."
Zach Johnson [Thu, 29 Oct 2020 23:20:30 +0000 (23:20 +0000)]
Merge "Kick off Gabeldorsche Rust implementation."

3 years agoAdd binder interface for the BluetoothConnectionCallback
Rahul Sabnis [Thu, 29 Oct 2020 22:29:08 +0000 (15:29 -0700)]
Add binder interface for the BluetoothConnectionCallback

Tag: #feature
Bug: 171902843
Test: Manual
Change-Id: I2bca5acf7d5ac463668e6a847c851e4a068bf059

3 years agoMerge "Use local_oob_present_"
Treehugger Robot [Thu, 29 Oct 2020 21:45:48 +0000 (21:45 +0000)]
Merge "Use local_oob_present_"

3 years agoSecurity: Send LinkKey reply without std::move
Myles Watson [Wed, 28 Oct 2020 22:56:41 +0000 (15:56 -0700)]
Security: Send LinkKey reply without std::move

Bug: 162984360
Test: ./cert/run --host SecurityTest
Change-Id: Ib39682ff4e02af46396d7c133fb7b4faf72f8c16

3 years agoRootCanal: Support OOB Data
Myles Watson [Thu, 22 Oct 2020 04:36:25 +0000 (21:36 -0700)]
RootCanal: Support OOB Data

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

3 years agoKick off Gabeldorsche Rust implementation.
Qasim Javed [Tue, 20 Oct 2020 20:10:34 +0000 (13:10 -0700)]
Kick off Gabeldorsche Rust implementation.

Details at go/rusty-gd

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

Unit tests will be added in later CLs

Change-Id: I938579e50fdb8b6f425a12b2d8ccc2971a16bbb4

3 years agoAdd types/ble_address_with_type.h
Chris Manton [Thu, 29 Oct 2020 05:40:43 +0000 (22:40 -0700)]
Add types/ble_address_with_type.h

Toward readable code

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

Change-Id: I9028ab92ed646b414f206571ebb031573ab87b82

3 years agoAdd tBLE_BD_ADDR::ToString
Chris Manton [Thu, 29 Oct 2020 05:27:28 +0000 (22:27 -0700)]
Add tBLE_BD_ADDR::ToString

Toward readable code

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

Change-Id: I4874bd9acfcf9cb2b87cd1b98743c566eb5f3963

3 years agoUse bluetooth::shim::legacy::Acl::ConfigureLePrivacy
Chris Manton [Thu, 29 Oct 2020 16:19:24 +0000 (09:19 -0700)]
Use bluetooth::shim::legacy::Acl::ConfigureLePrivacy

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

Change-Id: I46565021d697e531d98a7182c2c1b3ab8d3d6936

3 years agoAdd bluetooth::shim::legacy::Acl::ConfigureLePrivacy
Chris Manton [Thu, 29 Oct 2020 16:19:01 +0000 (09:19 -0700)]
Add bluetooth::shim::legacy::Acl::ConfigureLePrivacy

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

Change-Id: Ie2adc7cff25f4e0784fee9abc52f42ddc0a815ab

3 years agogd_acl: Use address_with_type within API
Chris Manton [Thu, 29 Oct 2020 04:27:20 +0000 (21:27 -0700)]
gd_acl: Use address_with_type within API

Also: Remove extraneous add device to connect list

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

Change-Id: Ifbb3d64c1091d9a6611807b3ec177fcacc6a23df

3 years agoGATT close status is unused
Hansong Zhang [Wed, 28 Oct 2020 22:29:14 +0000 (15:29 -0700)]
GATT close status is unused

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

3 years agoHearing aid: GATT disconnect reason is unused
Hansong Zhang [Wed, 28 Oct 2020 22:27:00 +0000 (15:27 -0700)]
Hearing aid: GATT disconnect reason is unused

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

3 years agoRemoved unused fixed channel disconnect reason
Hansong Zhang [Wed, 28 Oct 2020 21:44:08 +0000 (14:44 -0700)]
Removed unused fixed channel disconnect reason

For debugging, if you want to know the disconnect reason, you can use
btsnoop log as the source of truth.

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

3 years agoLet LinkSecurityInterface know LL role
Hansong Zhang [Wed, 28 Oct 2020 21:13:02 +0000 (14:13 -0700)]
Let LinkSecurityInterface know LL role

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

3 years agoMerge "HCI: Add OobExtendedDataRequestReply"
Treehugger Robot [Thu, 29 Oct 2020 00:52:26 +0000 (00:52 +0000)]
Merge "HCI: Add OobExtendedDataRequestReply"

3 years agoUse local_oob_present_
Martin Brabham [Tue, 27 Oct 2020 21:35:06 +0000 (14:35 -0700)]
Use local_oob_present_

The value is passed into the constructor for the pairing handler

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

3 years agoHCI: Add OobExtendedDataRequestReply
Myles Watson [Wed, 28 Oct 2020 21:34:08 +0000 (14:34 -0700)]
HCI: Add OobExtendedDataRequestReply

Bug: 162984360
Test: ./cert/run --host Security
Change-Id: If95132b07f1c6543098c7570e4ce991a1cd0f32a

3 years agoMerge "Add main/shim/helpers::ToAddressWithTypeFromLegacy"
Treehugger Robot [Wed, 28 Oct 2020 22:12:19 +0000 (22:12 +0000)]
Merge "Add main/shim/helpers::ToAddressWithTypeFromLegacy"

3 years agoLE COC shim: Implement GetMtu()
Hansong Zhang [Wed, 28 Oct 2020 17:37:56 +0000 (10:37 -0700)]
LE COC shim: Implement GetMtu()

So the client knows how to split their SDU.

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

3 years agoMerge "gd: Fix PDL of LeSetPeriodicAdvertisingEnable"
Treehugger Robot [Wed, 28 Oct 2020 21:05:05 +0000 (21:05 +0000)]
Merge "gd: Fix PDL of LeSetPeriodicAdvertisingEnable"

3 years agoAdd main/shim/helpers::ToAddressWithTypeFromLegacy
Chris Manton [Wed, 28 Oct 2020 17:20:56 +0000 (10:20 -0700)]
Add main/shim/helpers::ToAddressWithTypeFromLegacy

Bug: 171568335
Test: CtsVerifier insecure client/server priority
Tag: #refactor

Change-Id: I0832728d579930bf39cda0df4602f661bbfeca2f

3 years agoLE COC shim: Fix outgoing connection callback
Hansong Zhang [Wed, 28 Oct 2020 17:00:36 +0000 (10:00 -0700)]
LE COC shim: Fix outgoing connection callback

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

3 years agoeatt: Fix eatt counter in tcb
Łukasz Rymanowski [Wed, 28 Oct 2020 11:42:15 +0000 (11:42 +0000)]
eatt: Fix eatt counter in tcb

Problem visible in unit tests

Tag: #feature
Bug: 159786353
Sponsor: jpawlowski@
Test: atest --host net_test_eatt
Change-Id: I8ee1985dee87bb73d127ebfee3ca8e5287975914

3 years agoeatt/unit_test: Extend unit test to verify eatt counter
Łukasz Rymanowski [Wed, 28 Oct 2020 11:41:38 +0000 (11:41 +0000)]
eatt/unit_test: Extend unit test to verify eatt counter

This will show the problem fixed in next patch

Tag: #feature
Bug: 159786353
Sponsor: jpawlowski@
Test: atest --host net_test_eatt
Change-Id: I977b1f40a8acb8d6a78db6a9e2f802468444910f

3 years agoeatt/unit_test: Use HCI_ROLE_PERIPHERAL as this is available now
Łukasz Rymanowski [Wed, 28 Oct 2020 13:04:32 +0000 (13:04 +0000)]
eatt/unit_test: Use HCI_ROLE_PERIPHERAL as this is available now

Tag: #feature
Bug: 159786353
Sponsor: jpawlowski@
Test: atest --host net_test_eatt
Change-Id: Ic054ddb4bb66d403f354ce77bcf3173f7daef525

3 years agogd: Fix PDL of LeSetPeriodicAdvertisingEnable
Chienyuan [Wed, 28 Oct 2020 08:56:03 +0000 (16:56 +0800)]
gd: Fix PDL of LeSetPeriodicAdvertisingEnable

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

3 years agoL2cap LE COC shim
Hansong Zhang [Wed, 28 Oct 2020 05:28:02 +0000 (22:28 -0700)]
L2cap LE COC shim

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

3 years agoL2cap: LE specific disconnect and write API
Hansong Zhang [Tue, 27 Oct 2020 23:35:06 +0000 (16:35 -0700)]
L2cap: LE specific disconnect and write API

In shim layer we handle classic and LE separately.

For now, LE API redirects to classic.

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

3 years agoGAP: Simplify gap_sec_check_complete
Hansong Zhang [Tue, 27 Oct 2020 23:36:46 +0000 (16:36 -0700)]
GAP: Simplify gap_sec_check_complete

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

3 years agoWire link_le_on_connection_update into acl shim
Chris Manton [Tue, 27 Oct 2020 21:02:57 +0000 (14:02 -0700)]
Wire link_le_on_connection_update into acl shim

Bug: 171568335
Test: CtsVerifier insecure client/server priority
Tag: #refactor

Change-Id: Ieac3be19c960d00725ee0df7e5919f77464ab98c

3 years agoUse stack/acl/ble_acl::acl_ble_update_event_received
Chris Manton [Tue, 27 Oct 2020 20:49:18 +0000 (13:49 -0700)]
Use stack/acl/ble_acl::acl_ble_update_event_received

Bug: 171568335
Test: CtsVerifier insecure client/server priority
Tag: #refactor

Change-Id: Ifd192ae395177a904a1ed4b482652404b294a167

3 years agoAdd stack/acl/ble_acl::acl_ble_update_event_received
Chris Manton [Tue, 27 Oct 2020 20:38:25 +0000 (13:38 -0700)]
Add stack/acl/ble_acl::acl_ble_update_event_received

Bug: 171568335
Test: CtsVerifier insecure client/server priority
Tag: #refactor

Change-Id: I8bd5c9d93d5f0417da0da8f11edb59e14b01a4e4

3 years agoUse proper gatt_notify_conn_update::status type at corresponding level
Chris Manton [Tue, 27 Oct 2020 20:46:44 +0000 (13:46 -0700)]
Use proper gatt_notify_conn_update::status type at corresponding level

Bug: 171568335
Test: CtsVerifier insecure client/server priority
Tag: #refactor

Change-Id: I9d13cf5607a254c7abcade0df2c402de8a9e0911

3 years agoLE COC: Let L2cap send connect rsp
Hansong Zhang [Tue, 27 Oct 2020 19:27:17 +0000 (12:27 -0700)]
LE COC: Let L2cap send connect rsp

No need to send connect rsp from client

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

3 years agoAdd READ_REMOTE_VERSION_INFORMATION to status list
Chris Manton [Tue, 27 Oct 2020 17:30:43 +0000 (10:30 -0700)]
Add READ_REMOTE_VERSION_INFORMATION to status list

Tag: #refactor
Bug: 171801837
Test: acts/bin/act.py -tp ~/Goog/tools/test/connectivity -tc BleCocTest
Change-Id: I17759c2040bd620f2cbe29b33d5f092079c937f9

3 years agoMerge "GD Security Shim: make required calls to shim"
Treehugger Robot [Tue, 27 Oct 2020 18:20:00 +0000 (18:20 +0000)]
Merge "GD Security Shim: make required calls to shim"

3 years agoLE L2cap: Add COC config to registration
Hansong Zhang [Tue, 27 Oct 2020 00:29:24 +0000 (17:29 -0700)]
LE L2cap: Add COC config to registration

So we can send connect rsp for user.

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

3 years agoDisable EATT as does not pass all tests
Chris Manton [Mon, 26 Oct 2020 23:37:32 +0000 (16:37 -0700)]
Disable EATT as does not pass all tests

Tag: #feature
Bug: 159786353
Test: acts/bin/act.py -tp ~/Goog/tools/test/connectivity -tc BleCocTest

Change-Id: Id8243d9d9473293e2e1fc341b18d7d40cf1da14b

3 years agoMerge "A2DP offload: modify the A2DP offload SCMS-T_Enable with SCMS-T header"
Treehugger Robot [Mon, 26 Oct 2020 23:13:26 +0000 (23:13 +0000)]
Merge "A2DP offload: modify the A2DP offload SCMS-T_Enable with SCMS-T header"

3 years agoGD Security Shim: make required calls to shim
Martin Brabham [Wed, 7 Oct 2020 21:57:07 +0000 (14:57 -0700)]
GD Security Shim: make required calls to shim

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

3 years agoRe-log stack/btm/btm_ble::btm_ble_start_sec_check
Chris Manton [Mon, 26 Oct 2020 16:17:17 +0000 (09:17 -0700)]
Re-log stack/btm/btm_ble::btm_ble_start_sec_check

Toward readable code

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

Change-Id: I083d8a4af4af47b9a78f61d4618342abb76acbec

3 years agoRe-log stack/l2cap/l2c_ble::l2ble_sec_access_req
Chris Manton [Mon, 26 Oct 2020 16:17:29 +0000 (09:17 -0700)]
Re-log  stack/l2cap/l2c_ble::l2ble_sec_access_req

Toward readable code

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

Change-Id: I520a8ce93f1192960425291ed905c9bf3aa1cc26

3 years agobtm_acl_removed: Check for null as acl may have already closed
Chris Manton [Mon, 26 Oct 2020 16:16:50 +0000 (09:16 -0700)]
btm_acl_removed: Check for null as acl may have already closed

Bug:159815595
Tag: #refactor
Test: acts.py BleCocTest

Change-Id: I7a5312d4d929280de73442885100714264cd1457

3 years agoMerge "Properly reset tL2C_CCB::ecoc"
Treehugger Robot [Mon, 26 Oct 2020 00:30:15 +0000 (00:30 +0000)]
Merge "Properly reset tL2C_CCB::ecoc"

3 years agoACL: Refactor remote version/feature response
Hansong Zhang [Sat, 24 Oct 2020 20:46:56 +0000 (13:46 -0700)]
ACL: Refactor remote version/feature response

Separate the packet parsing and handling part, so that we can parse the
packet in GD L2cap and handle it in legacy stack.
When GD L2cap is enabled, don't send these request in legacy stack.

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

3 years agoGD L2cap: Pass more link callbacks to Security
Hansong Zhang [Fri, 23 Oct 2020 23:31:17 +0000 (16:31 -0700)]
GD L2cap: Pass more link callbacks to Security

Send Remote version request and supported feature request upon link
connection.
Security might be interested in LMP version and features, and ACL handle
(for legacy).

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

3 years agoProperly reset tL2C_CCB::ecoc
Chris Manton [Sun, 25 Oct 2020 20:25:18 +0000 (13:25 -0700)]
Properly reset tL2C_CCB::ecoc

Bug: 171657571
Tag: #refactor
Test: act.py -tc BleCocTest
Change-Id: I491a7cba9b28dcc4d02d7de4463a3512e8fce719

3 years agogd: Pull out READ_REMOTE_VERSION shared between classic and le
Chris Manton [Sat, 24 Oct 2020 21:09:07 +0000 (14:09 -0700)]
gd: Pull out READ_REMOTE_VERSION shared between classic and le

Test: atest --host bluetooth_test_gd
Test: acts.py BleCocTest ## With gd_hci=false
Test: acts.py BleCocTest ## With gd_acl=true
Bug: 171634583
Tag: #refactor

Change-Id: I53a49fec950755c13e4786be9aae936c0c2b242a

3 years agoOnly send ReadRemoteVersionRequest in legacy mode
Chris Manton [Sat, 24 Oct 2020 21:43:31 +0000 (14:43 -0700)]
Only send ReadRemoteVersionRequest in legacy mode

gd acl can only accept an event for either classic
or le, but not both.

Bug: 166280067
Tag: #refactor
Test: act.py -tc BleCocTest
Change-Id: I719f09a380e7b75da7c40ffc136038ccaea90812

3 years agoRevert "Should not send classic commands on le link"
Chris Manton [Sat, 24 Oct 2020 21:22:03 +0000 (14:22 -0700)]
Revert "Should not send classic commands on le link"

This reverts commit 25b8b04caa3c2c4b218f8d56f5f72e7ca1e24f8c.

Turns out this is a command that may be run on both le and br_edr links

Bug: 166280067
Tag: #refactor
Test: act.py -tc BleCocTest
Change-Id: Ieb3de7c6046f18b30805b7486441039b591f929b

3 years agoGD ACL: on_read_remote_supported_features_complete
Hansong Zhang [Fri, 23 Oct 2020 23:27:18 +0000 (16:27 -0700)]
GD ACL: on_read_remote_supported_features_complete

Use OnReadRemoteExtendedFeaturesComplete callback to send it to L2cap

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

3 years agoMerge "Cleanup references to system/core/base -> system/libbase"
Baligh Uddin [Sat, 24 Oct 2020 01:40:47 +0000 (01:40 +0000)]
Merge "Cleanup references to system/core/base -> system/libbase"

3 years agoClean up log spam in avrcp and a2dp
Hansong Zhang [Fri, 23 Oct 2020 19:31:12 +0000 (12:31 -0700)]
Clean up log spam in avrcp and a2dp

Now we don't see bugs in avrcp and a2dp sbc encoder often, move them to
verbose logging.

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

3 years agoMerge changes Ic1411faf,I0ef22f28,I645b787d,Ief031db6,I5c494deb, ...
Treehugger Robot [Fri, 23 Oct 2020 18:55:21 +0000 (18:55 +0000)]
Merge changes Ic1411faf,I0ef22f28,I645b787d,Ief031db6,I5c494deb, ...

* changes:
  Remove unused def SMP_DEBUG
  Remove name from BTM_SecAddBleDevice
  Re-log stack/l2cap/l2c_ble::
  enum-ify link stack/acl/btm_acl::policy settings
  Streamline main/shim/acl::_reason
  Streamline stack/btm/btm_ble_addr::btm_ble_addr_resolvable
  Streamline stack/btm/btm_ble_gap::btm_ble_update_adv_flag
  Streamline stack/btm/btm_ble_addr::btm_ble_resolve_random_addr
  enum-ify stack/btm/btm_ble_gap::BTM_BLE_
  Add main/shim/acl_legacy_interface::auth_complete

3 years agoRemove unused def SMP_DEBUG
Chris Manton [Sun, 11 Oct 2020 21:36:53 +0000 (14:36 -0700)]
Remove unused def SMP_DEBUG

Toward readable code

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

Change-Id: Ic1411faf31fd6c4dc66282bfe42a0ec47c969bb1

3 years agoRemove name from BTM_SecAddBleDevice
Chris Manton [Fri, 23 Oct 2020 02:47:49 +0000 (19:47 -0700)]
Remove name from BTM_SecAddBleDevice

bd_name is always nullptr

Toward readable code

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

Change-Id: I0ef22f288425dad0cc08d4e43acc12e5dd51d6dd

3 years agoRe-log stack/l2cap/l2c_ble::
Chris Manton [Thu, 8 Oct 2020 21:25:38 +0000 (14:25 -0700)]
Re-log stack/l2cap/l2c_ble::

Please "don\'t" use apostrophes

Towards grepable code

Bug: 163134718
Tag: #refactor
Test: ble paired 2 phones
Test: act.py -tc BleCocTest
Change-Id: I645b787dffa54d1f1829fca1212a4fa811e1f51e

3 years agoenum-ify link stack/acl/btm_acl::policy settings
Chris Manton [Sun, 11 Oct 2020 03:55:47 +0000 (20:55 -0700)]
enum-ify link stack/acl/btm_acl::policy settings

And also move to only use location
And restrict from header into compilation unit

Toward readable code

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

Change-Id: Ief031db624bf1363ee3ec4043efafcfdc4be1b59

3 years agoStreamline main/shim/acl::_reason
Chris Manton [Tue, 20 Oct 2020 15:06:13 +0000 (08:06 -0700)]
Streamline main/shim/acl::_reason

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

Change-Id: I5c494deb85fbb3101602078dcaeefc98ac695754

3 years agoStreamline stack/btm/btm_ble_addr::btm_ble_addr_resolvable
Chris Manton [Tue, 13 Oct 2020 20:58:56 +0000 (13:58 -0700)]
Streamline stack/btm/btm_ble_addr::btm_ble_addr_resolvable

Toward readable code

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

Change-Id: I6600ac7d3fdc1a9ff099b0ffa8c9b1826c6db456

3 years agoStreamline stack/btm/btm_ble_gap::btm_ble_update_adv_flag
Chris Manton [Tue, 13 Oct 2020 21:19:35 +0000 (14:19 -0700)]
Streamline stack/btm/btm_ble_gap::btm_ble_update_adv_flag

Toward readable code

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

Change-Id: I241cf791f672d0003419c7e8e26b4baf2089d681

3 years agoStreamline stack/btm/btm_ble_addr::btm_ble_resolve_random_addr
Chris Manton [Tue, 13 Oct 2020 20:34:43 +0000 (13:34 -0700)]
Streamline stack/btm/btm_ble_addr::btm_ble_resolve_random_addr

Toward readable code

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

Change-Id: Ifc5c988e6a5dd8540c5465639022a355ee9efcbf

3 years agoenum-ify stack/btm/btm_ble_gap::BTM_BLE_
Chris Manton [Tue, 13 Oct 2020 21:19:08 +0000 (14:19 -0700)]
enum-ify stack/btm/btm_ble_gap::BTM_BLE_

Toward readable code

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

Change-Id: Icb54b5f68c11bcb0a28b1cf25abcaf68c734d6ca

3 years agoAdd main/shim/acl_legacy_interface::auth_complete
Chris Manton [Fri, 16 Oct 2020 01:16:57 +0000 (18:16 -0700)]
Add main/shim/acl_legacy_interface::auth_complete

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

Change-Id: I2ad8753860ec78441a22c7f3e071beb11b9773c6

3 years agoCleanup references to system/core/base -> system/libbase
Baligh Uddin [Fri, 23 Oct 2020 14:33:47 +0000 (14:33 +0000)]
Cleanup references to system/core/base -> system/libbase

BUG: 157656545
Test: TH
Change-Id: I6b04e7340d58215ccf183e4b086023281e0a9951

3 years agoA2DP offload: modify the A2DP offload SCMS-T_Enable with SCMS-T header
Alice Kuo [Wed, 14 Oct 2020 10:31:54 +0000 (18:31 +0800)]
A2DP offload: modify the A2DP offload SCMS-T_Enable with SCMS-T header

Follow the Android HCI requirement for the 'Start A2DP Offload' cmd, it
should bring the SCMS-T header in the 'SCMS-T Enable' field as SCMS-T is
enabled. Get the SCMS-T active status of the peer devices as building
the offload start req cmd, and fill the SCMS-T header based the active
status.

Bug: 170785181
Tag: #feature
Test: connect with Sony WH-1000XM4, check the SCMS-T_Enable correctness
Test: atest --test-mapping system/bt
Change-Id: I6003b50a09f010942b37436497b06e06180b2069

3 years agoRevert "BTM_ACL: Remove unused code"
Jakub Pawlowski [Fri, 23 Oct 2020 11:14:14 +0000 (11:14 +0000)]
Revert "BTM_ACL: Remove unused code"

This reverts commit 85a4ce1ebd16bb20e87edac88ba0cbd71fa92d46.

Reason for revert: This is needed for LE Audio

Change-Id: Iaed065aef5f40e066d08004699c07dea2f48c94a

3 years agoMerge changes from topic "gd_security_shim"
Treehugger Robot [Fri, 23 Oct 2020 07:04:14 +0000 (07:04 +0000)]
Merge changes from topic "gd_security_shim"

* changes:
  GD Security: pipe in determined just_works flag
  GD Security Shim: Make ConfirmationData have strict types

3 years agoRefactor btm_remove_acl
Hansong Zhang [Thu, 22 Oct 2020 20:17:35 +0000 (13:17 -0700)]
Refactor btm_remove_acl

Use ACL handle instead.

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

3 years agoBTM_BLE_GAP: Clean up log spam
Hansong Zhang [Thu, 22 Oct 2020 22:45:50 +0000 (15:45 -0700)]
BTM_BLE_GAP: Clean up log spam

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

3 years agoUse stack/acl/btm_acl::acl_process_extended_features
Chris Manton [Thu, 22 Oct 2020 17:35:56 +0000 (10:35 -0700)]
Use stack/acl/btm_acl::acl_process_extended_features

Bug: 166280067
Tag: #refactor
Test: Pair classic device

Change-Id: I1a87ea23c8b4590a313652dca78b0e51354ecb33

3 years agoAdd stack/acl/btm_acl::acl_process_extended_features
Chris Manton [Thu, 22 Oct 2020 17:35:39 +0000 (10:35 -0700)]
Add stack/acl/btm_acl::acl_process_extended_features

Bug: 166280067
Tag: #refactor
Test: Pair classic device

Change-Id: I1136fae14a3673f6dc76b8d3d08414525690f8b3

3 years agoAdd main/shim/acl_legacy_interface::btm_acl_role_changed
Chris Manton [Thu, 22 Oct 2020 17:32:05 +0000 (10:32 -0700)]
Add main/shim/acl_legacy_interface::btm_acl_role_changed

Bug: 166280067
Tag: #refactor
Test: Pair classic device

Change-Id: Ie4f2c31ed449a5bf9353efb3ab640cbbbfab211f