OSDN Git Service

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

3 years agoMove btm_sec_set_peer_sec_caps to btm_sec
Hansong Zhang [Fri, 30 Oct 2020 03:37:13 +0000 (20:37 -0700)]
Move btm_sec_set_peer_sec_caps to btm_sec

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

3 years agoMerge "Merge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE"
Bill Yi [Thu, 5 Nov 2020 01:06:51 +0000 (01:06 +0000)]
Merge "Merge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE"

3 years agoMerge "Fix cert test crashes when running on remote machine"
Myles Watson [Wed, 4 Nov 2020 23:46:28 +0000 (23:46 +0000)]
Merge "Fix cert test crashes when running on remote machine"

3 years agoMerge changes Ie8b8e8a1,I5e1713f1,I0cabfa9c,I6235c954,I85dab865, ...
Chris Manton [Wed, 4 Nov 2020 23:41:30 +0000 (23:41 +0000)]
Merge changes Ie8b8e8a1,I5e1713f1,I0cabfa9c,I6235c954,I85dab865, ...

* changes:
  gd_acl_shim: Start schedule address rotation on first client registration
  Add stack/gatt/gatt_main::gatt_find_in_device_record
  gd_acl: Resolve address after connection
  gd: Present zeroed peer addr with type when using connect list
  gd: Store the address when using resolving privacy policy
  gd: gd/hci/le_address_manager_test::ASSERT_LOG when command queue is empty
  gd: Reset le address rotation timer
  gd: Remove unneeded client check when setting privacy
  gd: Unwind futures and promises in reverse time

3 years agoMerge changes I112bb45c,I302e80fa
Zach Johnson [Wed, 4 Nov 2020 23:14:33 +0000 (23:14 +0000)]
Merge changes I112bb45c,I302e80fa

* changes:
  Start the BT testing root service
  Import rootservice facades, for BT testing

3 years agoMerge changes I122f110d,If7820cec
Zach Johnson [Wed, 4 Nov 2020 23:14:22 +0000 (23:14 +0000)]
Merge changes I122f110d,If7820cec

* changes:
  Add stub for rusty-gd facade service
  A few minor cleanups to hci facades

3 years agoMerge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE
Bill Yi [Wed, 4 Nov 2020 22:04:05 +0000 (14:04 -0800)]
Merge rvc-release RP1A.201105.002 to aosp-master - DO NOT MERGE

Merged-In: Iac492777e490713bb8f2c3dd88a5de23dd6f613e
Change-Id: I7e2cdc736852f6e99466665e1120cc79b5b4009c

3 years agoFix cert test crashes when running on remote machine
Jakub Pawlowski [Wed, 4 Nov 2020 12:47:25 +0000 (13:47 +0100)]
Fix cert test crashes when running on remote machine

When cert test is executed on a remote machine, against locally
connected devices with ports forwarded to remote machine,
crashes are observed during cleanup that happens in setup.

This is for cleanup of forwarded ports, when no forwarding is setup, or
for removal of btsnoop.log when it's not present.

After this patch, non-fatal errors would print error message rather than
crash the whole test.

Tag: #gd-refactor
Test: gd/cert/run LeSecurityTest
Change-Id: I68df152ba83a416cb81b26f31ae9ebe3698e3f02

3 years agogd_acl_shim: Start schedule address rotation on first client registration
Chris Manton [Sat, 31 Oct 2020 18:16:34 +0000 (11:16 -0700)]
gd_acl_shim: Start schedule address rotation on first client registration

Set random address when privacy policy is registered.
Do not rotate address on every registration.

Bug: 171568335
Test: CtsVerifier
Test: gd/cert/run --host
Test: atest --host bluetooth_test_gd
Tag: #refactor
Change-Id: Ie8b8e8a111763dc62a0be9a38eac4b211fe50e17

3 years agoisomanager: Add callback to create cis command
Łukasz Rymanowski [Mon, 2 Nov 2020 14:13:14 +0000 (14:13 +0000)]
isomanager: Add callback to create cis command

This is in order to handle errors in Command Status:

< HCI Command: LE Create Connected Isochronous Stream (0x08|0x0064) plen 5
        Number of CIS: 1
        CIS Handle: 96
        ACL Handle: 65
> HCI Event: Command Status (0x0f) plen 4
      LE Create Connected Isochronous Stream (0x08|0x0064) ncmd 1
        Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)

With this patch, IsoManager can notify upper layer about error in creating
CIS

Bug: 150670922
Tag: #feature
Test: atest --host net_test_btm_iso
Sponsor: jpawlowski@

Change-Id: Ie90fcaea5df070ddf9441f7b6de24a1282995857

3 years agoAdd stack/gatt/gatt_main::gatt_find_in_device_record
Chris Manton [Thu, 29 Oct 2020 23:10:23 +0000 (16:10 -0700)]
Add stack/gatt/gatt_main::gatt_find_in_device_record

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

Change-Id: I5e1713f1a7cb00559448148d2275e8eeefb414dd

3 years agogd_acl: Resolve address after connection
Chris Manton [Wed, 28 Oct 2020 15:53:29 +0000 (08:53 -0700)]
gd_acl: Resolve address after connection

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

Change-Id: I0cabfa9cbe894d754269591c64292d6ed412d7a3

3 years agogd: Present zeroed peer addr with type when using connect list
Chris Manton [Sat, 31 Oct 2020 17:56:45 +0000 (10:56 -0700)]
gd: Present zeroed peer addr with type when using connect list

The fields are ignored but zeroed out for correctness.
Preserves original stack behavior

Bug: 171568335
Test: CtsVerifier
Test: atest --host bluetooth_test_gd
Tag: #refactor

Change-Id: I6235c9545115a247d4f4b3a7f31dfa97ce3d06b2

3 years agogd: Store the address when using resolving privacy policy
Chris Manton [Sat, 31 Oct 2020 18:19:11 +0000 (11:19 -0700)]
gd: Store the address when using resolving privacy policy

This address may change with updated, but seed the
initial address properly.

Bug: 171568335
Test: CtsVerifier
Test: gd/cert/run --host
Test: atest --host bluetooth_test_gd

Tag: #refactor
Change-Id: I85dab865ec9c7aa083cab3d6594d6eca4df925ac

3 years agogd: gd/hci/le_address_manager_test::ASSERT_LOG when command queue is empty
Chris Manton [Tue, 3 Nov 2020 18:53:33 +0000 (10:53 -0800)]
gd: gd/hci/le_address_manager_test::ASSERT_LOG when command queue is empty

Returning an empty vector causes debug headaches

Bug: 171568335
Test: CtsVerifier
Test: gd/cert/run --host
Test: atest --host bluetooth_test_gd
Tag: #refactor
Change-Id: I9d5f2ecacfe2bbcea7a333d3701523a6d9cfcaae

3 years agogd: Reset le address rotation timer
Chris Manton [Tue, 3 Nov 2020 18:28:02 +0000 (10:28 -0800)]
gd: Reset le address rotation timer

Bug: 171568335
Test: CtsVerifier
Test: gd/cert/run --host
Test: atest --host bluetooth_test_gd
Tag: #refactor

Change-Id: I1e9e998fdb45642d4708abeb68c5f07f7704ff8a

3 years agogd: Remove unneeded client check when setting privacy
Chris Manton [Sat, 31 Oct 2020 16:08:14 +0000 (09:08 -0700)]
gd: Remove unneeded client check when setting privacy

The check for registered clients can never succeed.

Privacy can only be set once per stack initialization.
No clients may be registered before setting privacy.
Entry ASSERTs ensure the above conditions are validated and true.

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

3 years agogd: Unwind futures and promises in reverse time
Chris Manton [Tue, 3 Nov 2020 00:37:28 +0000 (16:37 -0800)]
gd: Unwind futures and promises in reverse time

Bug: 171568335
Tag: #refactor
Test: atest --host bluetooth_test_gd
Change-Id: I3ff1deb2c23388b8c2114b09689ddea7380f7365

3 years agoUse btm_sec_set_peer_sec_caps to store features
Hansong Zhang [Fri, 30 Oct 2020 03:29:14 +0000 (20:29 -0700)]
Use btm_sec_set_peer_sec_caps to store features

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

3 years agonum_read_pages is unused
Hansong Zhang [Fri, 30 Oct 2020 03:18:11 +0000 (20:18 -0700)]
num_read_pages is unused

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

3 years agoMove some parts of btm_process_remote_ext_features
Hansong Zhang [Fri, 30 Oct 2020 03:24:41 +0000 (20:24 -0700)]
Move some parts of btm_process_remote_ext_features

into btm_sec_set_peer_sec_caps

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

3 years agoRefactor btm_sec_set_peer_sec_caps
Hansong Zhang [Fri, 30 Oct 2020 03:21:54 +0000 (20:21 -0700)]
Refactor btm_sec_set_peer_sec_caps

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

3 years agoRevert "Disable EATT as does not pass all tests"
Jakub Pawlowski [Wed, 28 Oct 2020 17:46:26 +0000 (17:46 +0000)]
Revert "Disable EATT as does not pass all tests"

This reverts commit c80071dd8f78c78f9ed7782d8d83c93abe9d8eec.

Reason for revert: no longer needed, issue fixed in https://android-review.googlesource.com/c/platform/system/bt/+/1477785

Change-Id: I97a3476fb292734e2a5ec6d0481bb18d2ef0fe5a

3 years agoStart the BT testing root service
Zach Johnson [Tue, 3 Nov 2020 00:34:14 +0000 (16:34 -0800)]
Start the BT testing root service

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

3 years agoImport rootservice facades, for BT testing
Zach Johnson [Mon, 2 Nov 2020 23:30:56 +0000 (15:30 -0800)]
Import rootservice facades, for BT testing

Not integrated into the main binary yet.

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

3 years agoAdd stub for rusty-gd facade service
Zach Johnson [Sat, 31 Oct 2020 19:58:49 +0000 (12:58 -0700)]
Add stub for rusty-gd facade service

Only parses command line args for now, but will
be expanded gradually in future patches.

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

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 agoA few minor cleanups to hci facades
Zach Johnson [Thu, 29 Oct 2020 23:16:53 +0000 (16:16 -0700)]
A few minor cleanups to hci facades

* Bury the grpc service construction inside the facade service
* no need to keep the rootcanal config around, pass it along without
cloning

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

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