OSDN Git Service

android-x86/system-bt.git
4 years agoUse time units stack/l2cap/l2c_api::flush_tout am: 2d1b26ef62
Chris Manton [Mon, 24 Aug 2020 19:32:33 +0000 (19:32 +0000)]
Use time units stack/l2cap/l2c_api::flush_tout am: 2d1b26ef62

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407890

Change-Id: I354821d3d2fe6e1bdf472facc78b54f1736df8bf

4 years agoAdd ConvertMillisecondsToBasebandSlots am: ed5bd65775
Chris Manton [Mon, 24 Aug 2020 19:32:32 +0000 (19:32 +0000)]
Add ConvertMillisecondsToBasebandSlots am: ed5bd65775

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1406655

Change-Id: I88669035e50d58fa52e33476ee79ce888e1084e7

4 years agoUse Api stack/acl/btm_acl::acl_disconnect am: bc8c16c412
Chris Manton [Mon, 24 Aug 2020 19:32:30 +0000 (19:32 +0000)]
Use Api stack/acl/btm_acl::acl_disconnect am: bc8c16c412

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407889

Change-Id: Ic5b795bb20c9c2203227ca55994b6c355ec956e0

4 years agoAdd Api stack/acl/btm_acl::acl_disconnect am: 26c76241e3
Chris Manton [Mon, 24 Aug 2020 19:32:29 +0000 (19:32 +0000)]
Add Api stack/acl/btm_acl::acl_disconnect am: 26c76241e3

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407887

Change-Id: I4e3447f3c66e05ffb7008b51818e738ac0d8b53f

4 years agoRe-include stack/btm/btm_dev.h am: e11b6bb724
Chris Manton [Mon, 24 Aug 2020 19:32:27 +0000 (19:32 +0000)]
Re-include stack/btm/btm_dev.h am: e11b6bb724

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407405

Change-Id: Ic0696ba05ba072759d91aff782c19739240c8d51

4 years agoRemove def BLE_PRIVACY_SPT am: b9403bab4d
Chris Manton [Mon, 24 Aug 2020 19:32:27 +0000 (19:32 +0000)]
Remove def BLE_PRIVACY_SPT am: b9403bab4d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407404

Change-Id: I3ed633e438fca62d4f9cdc72c673c72a0b2db138

4 years agoRemove def BTM_DISC_DURING_RS am: da637852af
Chris Manton [Mon, 24 Aug 2020 19:32:22 +0000 (19:32 +0000)]
Remove def BTM_DISC_DURING_RS am: da637852af

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407403

Change-Id: I912567fc34ec52e514d735328d8dd23ff44ae38b

4 years agoRemove tL2C_CB::tL2C_LCB::p_hcit_rcv_acl am: d6f7bcf85f
Chris Manton [Mon, 24 Aug 2020 19:32:17 +0000 (19:32 +0000)]
Remove tL2C_CB::tL2C_LCB::p_hcit_rcv_acl am: d6f7bcf85f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407402

Change-Id: I4fed0bd9d94f182dba8fe52adc9dbc975a0de929

4 years agoProperly process the LE Long Term Key Request am: 178f8e5946
Jakub Pawlowski [Mon, 24 Aug 2020 16:03:47 +0000 (16:03 +0000)]
Properly process the LE Long Term Key Request am: 178f8e5946

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1406070

Change-Id: If5def9c75ecdc350ac93d80303b5f4ddcc2b04e1

4 years agoRootCanal: Request Le LongTermKey am: 3ce975cfd8
Myles Watson [Mon, 24 Aug 2020 16:03:43 +0000 (16:03 +0000)]
RootCanal: Request Le LongTermKey am: 3ce975cfd8

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407202

Change-Id: Ifc6f936cefb3e5998c124f9ec1ddcc36dab6995b

4 years agoUse time units stack/l2cap/l2c_api::flush_tout
Chris Manton [Sun, 23 Aug 2020 21:39:52 +0000 (14:39 -0700)]
Use time units stack/l2cap/l2c_api::flush_tout

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I55a59404c83ed5b36c160332cdf1d7ba3db8cc9f

4 years agoAdd ConvertMillisecondsToBasebandSlots
Chris Manton [Thu, 20 Aug 2020 22:06:43 +0000 (15:06 -0700)]
Add ConvertMillisecondsToBasebandSlots

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I3fec52556049d6832db59dd89096217d224b792a

4 years agoUse Api stack/acl/btm_acl::acl_disconnect
Chris Manton [Sun, 23 Aug 2020 20:47:51 +0000 (13:47 -0700)]
Use Api stack/acl/btm_acl::acl_disconnect

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ied740cc7d39d6b4a6492afe962b54e17da327607

4 years agoAdd Api stack/acl/btm_acl::acl_disconnect
Chris Manton [Sun, 23 Aug 2020 20:47:11 +0000 (13:47 -0700)]
Add Api stack/acl/btm_acl::acl_disconnect

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I69ee9674a65a1b9b67235b0ca8eea3dc3bcc21a0

4 years agoRe-include stack/btm/btm_dev.h
Chris Manton [Sat, 22 Aug 2020 19:33:58 +0000 (12:33 -0700)]
Re-include stack/btm/btm_dev.h

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I2228f2ab4d938ef3c94db34bfa2d508654a33826

4 years agoRemove def BLE_PRIVACY_SPT
Chris Manton [Sat, 22 Aug 2020 23:30:34 +0000 (16:30 -0700)]
Remove def BLE_PRIVACY_SPT

Always TRUE; untested and unsupported when false

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I88e5466db12dfafbe9ed4ef66459b0c9da7f4fc1

4 years agoRemove def BTM_DISC_DURING_RS
Chris Manton [Sat, 22 Aug 2020 23:23:40 +0000 (16:23 -0700)]
Remove def BTM_DISC_DURING_RS

Always TRUE; untested and unsupported when false

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I9873649ca7fc52d2081e4d0c8a505c5794fd5b91

4 years agoRemove tL2C_CB::tL2C_LCB::p_hcit_rcv_acl
Chris Manton [Sun, 23 Aug 2020 18:55:19 +0000 (11:55 -0700)]
Remove tL2C_CB::tL2C_LCB::p_hcit_rcv_acl

Never allocated, but always freed buffer

Luckily it's always null

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0a5a6ea2178b1478b9a992028f5f181ed5344367

4 years agoProperly process the LE Long Term Key Request
Jakub Pawlowski [Fri, 21 Aug 2020 15:39:11 +0000 (17:39 +0200)]
Properly process the LE Long Term Key Request

Stack in peripheral should properly accept and pass the LTK request.

Bug: 155399771
Test: cert/run --host LeSecurityTest
Tag: #gd-refactor
Change-Id: I7fcce47310480a435386975756900734239e4203

4 years agoRootCanal: Request Le LongTermKey
Myles Watson [Fri, 21 Aug 2020 16:06:45 +0000 (09:06 -0700)]
RootCanal: Request Le LongTermKey

Use OwnAddressType for scanning and connections.

Make Random (for LE security) be an 8-byte array.

Bug: 155399771
Test: cert/run --host LeSecurityTest
Tag: #gd-refactor
Change-Id: I5d6044769dfdeb51dd247ce69ee3b5e357b70497

4 years agoEliminate useless stack vars l2c_link_send_to_lower_ am: d76d774ea2
Chris Manton [Sun, 23 Aug 2020 16:34:49 +0000 (16:34 +0000)]
Eliminate useless stack vars l2c_link_send_to_lower_ am: d76d774ea2

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407468

Change-Id: Idfc7352f387c5a63b03da11b51b5ba908f887339

4 years agoUse acl data passing API am: ee555f6ded
Chris Manton [Sun, 23 Aug 2020 16:34:34 +0000 (16:34 +0000)]
Use acl data passing API am: ee555f6ded

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407397

Change-Id: If386d3a6e521ec533fd3626935b0fb7f48ebb322

4 years agoadd acl data passing API am: 98cb1c46e0
Chris Manton [Sun, 23 Aug 2020 16:34:32 +0000 (16:34 +0000)]
add acl data passing API am: 98cb1c46e0

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407396

Change-Id: I10d628f8a1e9aadd40606bc06d0552b7568c3869

4 years agoSmooth l2c_link_send_to_lower/br_edr and ble am: 438bbe6f6e
Chris Manton [Sun, 23 Aug 2020 16:34:31 +0000 (16:34 +0000)]
Smooth l2c_link_send_to_lower/br_edr and ble am: 438bbe6f6e

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407395

Change-Id: Ied18d747c2718db3b53eb9cdbadeba82b17e0e26

4 years agoStreamline l2c_link_send_to_lower/br_edr and ble am: 5f843c24f5
Chris Manton [Sun, 23 Aug 2020 16:34:30 +0000 (16:34 +0000)]
Streamline l2c_link_send_to_lower/br_edr and ble am: 5f843c24f5

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407394

Change-Id: I93a027333be6dc4ee614759c6be126e1ec7e5ce4

4 years agoBreak out l2c_link_send_to_lower into br_edr and ble am: f0c7c82eba
Chris Manton [Sun, 23 Aug 2020 16:34:28 +0000 (16:34 +0000)]
Break out l2c_link_send_to_lower into br_edr and ble am: f0c7c82eba

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407393

Change-Id: I39f6532327a909edeb936421e4f047e44e950605

4 years agoAdd const stack/l2cap/l2c_link::l2c_link_send_to_lower am: 4edcd50c43
Chris Manton [Sun, 23 Aug 2020 16:34:26 +0000 (16:34 +0000)]
Add const stack/l2cap/l2c_link::l2c_link_send_to_lower am: 4edcd50c43

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407392

Change-Id: Ib4f2583d095abda871fb1d931fb386a65400927e

4 years agoRemove def L2CAP_HCI_FLOW_CONTROL_DEBUG am: 49743f152b
Chris Manton [Sun, 23 Aug 2020 16:34:23 +0000 (16:34 +0000)]
Remove def L2CAP_HCI_FLOW_CONTROL_DEBUG am: 49743f152b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407391

Change-Id: If85ebf7ee398b1a809177bef3b9c40a055d42846

4 years agoBreak out data passing events am: 67c21c423b
Chris Manton [Sun, 23 Aug 2020 16:34:22 +0000 (16:34 +0000)]
Break out data passing events am: 67c21c423b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407390

Change-Id: I5866b5a90d7a0cc7f844268edb2f488117028b84

4 years agoRe-order conditional stack/l2cap/l2c_link::l2c_link_send_to_lower am: bdb4bc4d69
Chris Manton [Sun, 23 Aug 2020 16:34:19 +0000 (16:34 +0000)]
Re-order conditional stack/l2cap/l2c_link::l2c_link_send_to_lower am: bdb4bc4d69

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407389

Change-Id: Ib97b5dd762aa2aa4ab6e9ac4ac936b0e6447bff4

4 years agoGroup controller acccess stack/l2cap/l2c_link::l2c_link_send_to_lower am: 1c3bc9cc69
Chris Manton [Sun, 23 Aug 2020 16:34:16 +0000 (16:34 +0000)]
Group controller acccess stack/l2cap/l2c_link::l2c_link_send_to_lower am: 1c3bc9cc69

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407388

Change-Id: Iad28310f46f52e943d83407778d2879ae4834a95

4 years agoColocate dec/def stack/l2cap/l2c_link::l2c_link_send_to_lower am: bd07b7ee83
Chris Manton [Sun, 23 Aug 2020 16:34:14 +0000 (16:34 +0000)]
Colocate dec/def stack/l2cap/l2c_link::l2c_link_send_to_lower am: bd07b7ee83

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407387

Change-Id: I6fb94921500c84c23d11e4ffdb8e92bf10e1822f

4 years agoEliminate useless stack vars l2c_link_send_to_lower_
Chris Manton [Sun, 23 Aug 2020 01:29:55 +0000 (18:29 -0700)]
Eliminate useless stack vars l2c_link_send_to_lower_

xmit_window
acl_data_size

Towards readability

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I649b9d0fbcf16cacdbfac74cac0a414e50109202

4 years agoUse acl data passing API
Chris Manton [Sat, 22 Aug 2020 16:30:34 +0000 (09:30 -0700)]
Use acl data passing API

stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0a31c891be3b1042d90fc17c3662d4e69b530648

4 years agoadd acl data passing API
Chris Manton [Sat, 22 Aug 2020 15:46:16 +0000 (08:46 -0700)]
add acl data passing API

stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards proper interfaces

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

Change-Id: I48d067c679715e2fc6987347b92b8177fca9d512

4 years agoSmooth l2c_link_send_to_lower/br_edr and ble
Chris Manton [Sat, 22 Aug 2020 15:41:54 +0000 (08:41 -0700)]
Smooth l2c_link_send_to_lower/br_edr and ble

stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards proper interfaces

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

Change-Id: Ia464ddf48f403d542f361b872c7c8a68c5de50af

4 years agoStreamline l2c_link_send_to_lower/br_edr and ble
Chris Manton [Sat, 22 Aug 2020 15:38:07 +0000 (08:38 -0700)]
Streamline l2c_link_send_to_lower/br_edr and ble

stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards proper interfaces

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

Change-Id: I075af46d4f194fe44c5389b1ab5aa8341a3356ef

4 years agoBreak out l2c_link_send_to_lower into br_edr and ble
Chris Manton [Sat, 22 Aug 2020 15:31:48 +0000 (08:31 -0700)]
Break out l2c_link_send_to_lower into br_edr and ble

stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards proper interfaces

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

Change-Id: Ia8c833a0ab806429743bd974d595cc102b738c5c

4 years agoAdd const stack/l2cap/l2c_link::l2c_link_send_to_lower
Chris Manton [Sat, 22 Aug 2020 15:26:49 +0000 (08:26 -0700)]
Add const stack/l2cap/l2c_link::l2c_link_send_to_lower

Pull out fit-in-buffer conditions

Towards proper interfaces

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

Change-Id: I861f7dc5eef2ee032a8e08c681ee5f18c7b5d277

4 years agoRemove def L2CAP_HCI_FLOW_CONTROL_DEBUG
Chris Manton [Fri, 21 Aug 2020 22:35:08 +0000 (15:35 -0700)]
Remove def L2CAP_HCI_FLOW_CONTROL_DEBUG

Towards readability

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I43cc934c5b0aabf5c1d05bf906277af3b52db5d0

4 years agoBreak out data passing events
Chris Manton [Fri, 21 Aug 2020 22:23:58 +0000 (15:23 -0700)]
Break out data passing events

Towards readability

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I2fe1987d46c660d7c9407a896c25961649533b6b

4 years agoRe-order conditional stack/l2cap/l2c_link::l2c_link_send_to_lower
Chris Manton [Fri, 21 Aug 2020 20:49:26 +0000 (13:49 -0700)]
Re-order conditional stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards readability

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I5f893d86c383c871051aa550d75f17ead8143585

4 years agoGroup controller acccess stack/l2cap/l2c_link::l2c_link_send_to_lower
Chris Manton [Fri, 21 Aug 2020 17:17:44 +0000 (10:17 -0700)]
Group controller acccess stack/l2cap/l2c_link::l2c_link_send_to_lower

Also add transport and link_xmit_quota

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Idcb98de26e07174dbe1732ce048cf96cefaa60c5

4 years agoColocate dec/def stack/l2cap/l2c_link::l2c_link_send_to_lower
Chris Manton [Fri, 21 Aug 2020 17:08:52 +0000 (10:08 -0700)]
Colocate dec/def stack/l2cap/l2c_link::l2c_link_send_to_lower

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I63693185bf9450ef94de4863d90bda1ef6315ee8

4 years agoMerge "GD-Cert: Override parameters during cert test" am: e1aad0ff93
Treehugger Robot [Sat, 22 Aug 2020 02:01:31 +0000 (02:01 +0000)]
Merge "GD-Cert: Override parameters during cert test" am: e1aad0ff93

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407204

Change-Id: I862ec8fd973be68dd8f468d49745f4808530c9fa

4 years agoMerge "GD-Cert: Override parameters during cert test"
Treehugger Robot [Sat, 22 Aug 2020 01:35:39 +0000 (01:35 +0000)]
Merge "GD-Cert: Override parameters during cert test"

4 years agoRefactor: Fix BT device name length issue am: 624c787a77
xiaoshun.xu [Sat, 22 Aug 2020 01:15:00 +0000 (01:15 +0000)]
Refactor: Fix BT device name length issue am: 624c787a77

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1387118

Change-Id: Id27936b443e58edc6878de983494741ecb9c8d75

4 years agoGD-Cert: Override parameters during cert test
Jack He [Fri, 21 Aug 2020 23:46:19 +0000 (16:46 -0700)]
GD-Cert: Override parameters during cert test

* Allow overriding system properties and paramters
  at runtime
* Override them into right values during cert testing to
  allow output collection

Bug: 165828962
Test: gd/cert/run --host
Tag: #gd-refactor
Change-Id: I1ebc8058cdb57eaa5442278f535e3750eec9dbad

4 years agoRefactor: Fix BT device name length issue
xiaoshun.xu [Tue, 18 Aug 2020 17:57:09 +0000 (01:57 +0800)]
Refactor: Fix BT device name length issue

BT device name only show 247bytes on settings, it supposed to show
248bytes if local device and remote device have 248bytes' name.
Increasing the argument passed to function strlcpy&memcpy bt 1
will resolve the issue.

Tag: #refactor
Bug: 162480697
Sponsor: mylesgw
Test: cert/run --host
Change-Id: Ib3fa7d78e39f0a9330658f9ce2b4a67003d7114d

4 years agoMerge changes Iddb20c40,Iddc3cd02 am: b5fc1d92bb
Treehugger Robot [Fri, 21 Aug 2020 22:31:14 +0000 (22:31 +0000)]
Merge changes Iddb20c40,Iddc3cd02 am: b5fc1d92bb

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1407192

Change-Id: I088919d1f00151d7e787a6d92412d267e4fbc573

4 years agoMerge changes Iddb20c40,Iddc3cd02
Treehugger Robot [Fri, 21 Aug 2020 22:06:38 +0000 (22:06 +0000)]
Merge changes Iddb20c40,Iddc3cd02

* changes:
  GD-HCI: Send original command instead of status packet upwards
  BTM-PM: Get rid of BTM_PM_DEBUG flag

4 years agoGD-HCI: Send original command instead of status packet upwards
Jack He [Fri, 21 Aug 2020 20:29:20 +0000 (13:29 -0700)]
GD-HCI: Send original command instead of status packet upwards

* Legacy stack expects original command when command status is available
* Add verbose logging for command complete and command status
* Wrap pending command in OsiObject so that it can be auto-freed by
  C++ unique_ptr

Bug: 165181021
Test: make, flash, test A2DP and HFP
Tag: #gd-refactor
Change-Id: Iddb20c405dc2f0326de53d3531464cbba65d6076

4 years agoBTM-PM: Get rid of BTM_PM_DEBUG flag
Jack He [Fri, 21 Aug 2020 06:18:18 +0000 (23:18 -0700)]
BTM-PM: Get rid of BTM_PM_DEBUG flag

* Instead of using a build time flag, use a LOG_VERBOSE
  to control the verbosity of BTM power manager logs
* Add more logging on error paths

Bug: 165181021
Test: make
Tag: #refactor
Change-Id: Iddc3cd025c2078ade4d7dd9d608a8e64b0987034

4 years agoMerge "InternalEnforceSecurityPolicy: Check if record is temporary" am: abfca966cc
Treehugger Robot [Fri, 21 Aug 2020 20:05:18 +0000 (20:05 +0000)]
Merge "InternalEnforceSecurityPolicy: Check if record is temporary" am: abfca966cc

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1404972

Change-Id: I607f3274440886b1082a0bc7c71ad5bdf52fda82

4 years agoMerge "InternalEnforceSecurityPolicy: Check if record is temporary"
Treehugger Robot [Fri, 21 Aug 2020 19:58:22 +0000 (19:58 +0000)]
Merge "InternalEnforceSecurityPolicy: Check if record is temporary"

4 years agoMerge changes I7eb89883,I93295962,I3ffe28ef,Ice072495,Iba166d9a, ... am: f37124363b
Treehugger Robot [Fri, 21 Aug 2020 19:48:07 +0000 (19:48 +0000)]
Merge changes I7eb89883,I93295962,I3ffe28ef,Ice072495,Iba166d9a, ... am: f37124363b

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1403155

Change-Id: I3c8ccca4915df7d78f506ee037ebaf156760cbd9

4 years agoMerge changes I7eb89883,I93295962,I3ffe28ef,Ice072495,Iba166d9a, ...
Treehugger Robot [Fri, 21 Aug 2020 19:33:10 +0000 (19:33 +0000)]
Merge changes I7eb89883,I93295962,I3ffe28ef,Ice072495,Iba166d9a, ...

* changes:
  Simplify stack/l2cap/l2c_utils::l2cu_create_conn_br_edr
  Simplify stack/l2cap/l2c_link::l2c_link_role_changed
  Remove poor placement for SCN from tACL_CB
  add stack/btm/btm_scn
  Add tBTM_CB::btm_scn[BTM_MAX_SCN_]
  Simplify stack/l2cap/l2c_utils::l2cu_adj_id
  Precisely name tL2C_CB::tL2C_LCB::id
  Remove tL2C_CB::tL2C_LCB::info_rx_bits
  Encapsulate tL2C_CB::tL2C_LCB::link_flush_tout_
  Precisely name tL2C_CB::num_used_lcbs
  Encapsulate tL2C_CB::tL2C_LCB::disc_reason
  Remove set-once-never-execute l2cb.is_flush_active

4 years agoMerge "Clear advertising cache if bad advertisement is received" am: 9ee4839847
Treehugger Robot [Fri, 21 Aug 2020 18:46:56 +0000 (18:46 +0000)]
Merge "Clear advertising cache if bad advertisement is received" am: 9ee4839847

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1406069

Change-Id: I913dbe7a39c45cb33bef3e5490f765230f4b79a9

4 years agoInternalEnforceSecurityPolicy: Check if record is temporary
Hansong Zhang [Wed, 19 Aug 2020 23:41:21 +0000 (16:41 -0700)]
InternalEnforceSecurityPolicy: Check if record is temporary

If we want AUTHENTICATED_ENCRYPTED_TRANSPORT, temporary link key is not
sufficient.  Pair again.

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

4 years agoMerge "Clear advertising cache if bad advertisement is received"
Treehugger Robot [Fri, 21 Aug 2020 18:14:10 +0000 (18:14 +0000)]
Merge "Clear advertising cache if bad advertisement is received"

4 years agoClear advertising cache if bad advertisement is received
Henrik Davidsen [Thu, 20 Aug 2020 11:23:01 +0000 (12:23 +0100)]
Clear advertising cache if bad advertisement is received

Cache of advertisements from a device was not cleared if a bad
extended advertisement was received which caused that new
advertisements from same device address was rejected as invalid.

Tag: #stability
Test: receive malformed advertisement
Signed-off-by: Henrik Davidsen <h.davidsen@samsung.com>
Change-Id: If07010954fef235b696c8a120026934a7aeadcb5

4 years agoMerge "GD Security: Improve Enforce() workflow" am: cd7786f840
Treehugger Robot [Fri, 21 Aug 2020 17:31:25 +0000 (17:31 +0000)]
Merge "GD Security: Improve Enforce() workflow" am: cd7786f840

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1404971

Change-Id: Ia7864cf1ed6c0bb07cb76d9f4a3f1ca2a8059e8b

4 years agoMerge "GD Security: Improve Enforce() workflow"
Treehugger Robot [Fri, 21 Aug 2020 17:15:26 +0000 (17:15 +0000)]
Merge "GD Security: Improve Enforce() workflow"

4 years agoSimplify stack/l2cap/l2c_utils::l2cu_create_conn_br_edr
Chris Manton [Tue, 18 Aug 2020 03:50:27 +0000 (20:50 -0700)]
Simplify stack/l2cap/l2c_utils::l2cu_create_conn_br_edr

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I7eb89883f5289bc89692e26c6f290f42f609009c

4 years agoSimplify stack/l2cap/l2c_link::l2c_link_role_changed
Chris Manton [Tue, 18 Aug 2020 04:38:01 +0000 (21:38 -0700)]
Simplify stack/l2cap/l2c_link::l2c_link_role_changed

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I93295962cedb99ce46fb23489649eec445fc540a

4 years agoRemove poor placement for SCN from tACL_CB
Chris Manton [Tue, 18 Aug 2020 23:06:34 +0000 (16:06 -0700)]
Remove poor placement for SCN from tACL_CB

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I3ffe28efe945cfc8a9abc3c96d790827625b0281

4 years agoadd stack/btm/btm_scn
Chris Manton [Tue, 18 Aug 2020 22:57:04 +0000 (15:57 -0700)]
add stack/btm/btm_scn

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

Change-Id: Ice072495e981d02bfc5cbd6dce18436165b28f0d

4 years agoAdd tBTM_CB::btm_scn[BTM_MAX_SCN_]
Chris Manton [Tue, 18 Aug 2020 22:42:53 +0000 (15:42 -0700)]
Add tBTM_CB::btm_scn[BTM_MAX_SCN_]

To be moved out of tACL_CB

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Iba166d9a8576f910a8406864a5d5d0e9faffce72

4 years agoSimplify stack/l2cap/l2c_utils::l2cu_adj_id
Chris Manton [Fri, 21 Aug 2020 15:42:35 +0000 (08:42 -0700)]
Simplify stack/l2cap/l2c_utils::l2cu_adj_id

The first term in the condition is always true

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib96d78cbaef78450eee30b1aa8291506d4161c5c

4 years agoPrecisely name tL2C_CB::tL2C_LCB::id
Chris Manton [Fri, 21 Aug 2020 15:38:58 +0000 (08:38 -0700)]
Precisely name tL2C_CB::tL2C_LCB::id

Signalling id

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0233757a9a74479f8b5d6b34c558a257b70977bd

4 years agoRemove tL2C_CB::tL2C_LCB::info_rx_bits
Chris Manton [Fri, 21 Aug 2020 15:17:21 +0000 (08:17 -0700)]
Remove tL2C_CB::tL2C_LCB::info_rx_bits

Write once; read never

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I53690a990985b7aaeb7570326f9726cb644a66e0

4 years agoEncapsulate tL2C_CB::tL2C_LCB::link_flush_tout_
Chris Manton [Fri, 21 Aug 2020 15:09:43 +0000 (08:09 -0700)]
Encapsulate tL2C_CB::tL2C_LCB::link_flush_tout_

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic8d6f5712129031bd16510d7ba745ae19afbce77

4 years agoPrecisely name tL2C_CB::num_used_lcbs
Chris Manton [Fri, 21 Aug 2020 04:56:23 +0000 (21:56 -0700)]
Precisely name tL2C_CB::num_used_lcbs

From: tL2C_CB::tL2C_LCB::num_links_active

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I053469981e035493bc37de98fb44123622618859

4 years agoEncapsulate tL2C_CB::tL2C_LCB::disc_reason
Chris Manton [Fri, 21 Aug 2020 04:29:48 +0000 (21:29 -0700)]
Encapsulate tL2C_CB::tL2C_LCB::disc_reason

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I475eb9127e50dc58b7a0bc8f6f269db9ab63a94a

4 years agoRemove set-once-never-execute l2cb.is_flush_active
Chris Manton [Fri, 21 Aug 2020 04:46:54 +0000 (21:46 -0700)]
Remove set-once-never-execute l2cb.is_flush_active

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I8a5d32e2d190fd11bba2f8b70020730681ca881f

4 years agoFix address passing when we accept incoming connection am: 4354abb3ed
Jakub Pawlowski [Fri, 21 Aug 2020 07:27:09 +0000 (07:27 +0000)]
Fix address passing when we accept incoming connection am: 4354abb3ed

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1372437

Change-Id: I40de75420e7df4499ec6341869d31c3dea2ccd7d

4 years agoFix address passing when we accept incoming connection
Jakub Pawlowski [Fri, 24 Jul 2020 10:58:56 +0000 (12:58 +0200)]
Fix address passing when we accept incoming connection

Tag: #gd-refactor
Bug: 155399771
Test: gd/cert/run --host LeSecurityTest
Change-Id: I21ceb49fe1b69e447e3d2e282db5d02b7a0c1bfe

4 years agoGD Security: Improve Enforce() workflow
Hansong Zhang [Wed, 19 Aug 2020 21:52:53 +0000 (14:52 -0700)]
GD Security: Improve Enforce() workflow

InternalEnforceSecurityPolicy establishes the requirement
- ENCRYPTED_TRANSPORT: If paired but not encrypted, just wait for
  encryption change; if unpaired, pair with NO_BOND_NO_MITM
- AUTHENTICATED_ENCRYPTED_TRANSPORT: Similar as above, but we need to
  pair again if existing LK is not authenticated. Exception: If no MITM
  is needed during pairing, we assume authenticated LK is not possible,
  so we allow connection. In the future, use IO cap to check.

When link is encrypted, or new pairing is complete, we invoke
UpdateLinkSecurityCondition.

Test: cert/run --host
Test: CtsVerifier Insecure RFCOMM client
Tag: #gd-refactor
Bug: 141555841
Change-Id: Ic5792c8e967cd068e08df4702393ae3188c6d4e8

4 years agoMerge "AclManager: Handle default data length" am: 3eeb3f9a47
Treehugger Robot [Thu, 20 Aug 2020 22:35:04 +0000 (22:35 +0000)]
Merge "AclManager: Handle default data length" am: 3eeb3f9a47

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1405187

Change-Id: Ibe08664b9b564811d097fc9254bfbd78460216b2

4 years agoMerge "Remove unused API" am: 321029a933
Treehugger Robot [Thu, 20 Aug 2020 22:34:58 +0000 (22:34 +0000)]
Merge "Remove unused API" am: 321029a933

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1405178

Change-Id: I45b93527625fce65cde9f9e97a5b19fa2eb8a417

4 years agoMerge changes I4b15d054,Id53d86f3,Icc604d09,Ib19ee20d,I550d96d1, ... am: 6c68f8edaa
Treehugger Robot [Thu, 20 Aug 2020 22:34:52 +0000 (22:34 +0000)]
Merge changes I4b15d054,Id53d86f3,Icc604d09,Ib19ee20d,I550d96d1, ... am: 6c68f8edaa

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1405177

Change-Id: I57b3e63ea7dbd90fd9e457e391c2a6425ff439a1

4 years agoMerge "AclManager: Handle default data length"
Treehugger Robot [Thu, 20 Aug 2020 22:20:44 +0000 (22:20 +0000)]
Merge "AclManager: Handle default data length"

4 years agoMerge "Remove unused API"
Treehugger Robot [Thu, 20 Aug 2020 22:18:42 +0000 (22:18 +0000)]
Merge "Remove unused API"

4 years agoMerge changes I4b15d054,Id53d86f3,Icc604d09,Ib19ee20d,I550d96d1, ...
Treehugger Robot [Thu, 20 Aug 2020 21:08:21 +0000 (21:08 +0000)]
Merge changes I4b15d054,Id53d86f3,Icc604d09,Ib19ee20d,I550d96d1, ...

* changes:
  Unify def tBTM_SEC_CBACK=>tBTM_SEC_CALLBACK
  Simplify stack/acl/btm_acl::btm_acl_created()
  Removed unused tACL_CONN fields
  Use API stack/acl/btm_acl
  Add APIs to stack/acl/btm_acl
  Use API stack/acl/btm_acl::btm_acl_connection_request
  Add API stack/acl/btm_acl::btm_acl_connection_request
  Wrap tL2C_LCB::link_role in API
  Rename btm_dev_support_switch
  Streamline stack/btm/btm_dev::btm_dev_support_switch
  Replace BTM_ACL_PKT_TYPES_MASK_

4 years agoMerge changes I1aa0ab27,Ice003a60 am: 05a62c110f
Jakub Pawlowski [Thu, 20 Aug 2020 20:25:50 +0000 (20:25 +0000)]
Merge changes I1aa0ab27,Ice003a60 am: 05a62c110f

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1398109

Change-Id: I84ededccd9010746a66c47ba17f67dc1b434b950

4 years agoRemove unused API
Hansong Zhang [Thu, 20 Aug 2020 18:31:07 +0000 (11:31 -0700)]
Remove unused API

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

4 years agoMerge changes I1aa0ab27,Ice003a60
Jakub Pawlowski [Thu, 20 Aug 2020 20:16:20 +0000 (20:16 +0000)]
Merge changes I1aa0ab27,Ice003a60

* changes:
  hci: Add Broadcast Isochronous Sets related commands
  hci: Add additional iso related commands

4 years agoUnify def tBTM_SEC_CBACK=>tBTM_SEC_CALLBACK
Chris Manton [Thu, 20 Aug 2020 17:39:23 +0000 (10:39 -0700)]
Unify def tBTM_SEC_CBACK=>tBTM_SEC_CALLBACK

The names were aliases to each other

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4b15d054adc53b0e13f916fc08dcaf17c91d6008

4 years agoSimplify stack/acl/btm_acl::btm_acl_created()
Chris Manton [Tue, 18 Aug 2020 17:34:35 +0000 (10:34 -0700)]
Simplify stack/acl/btm_acl::btm_acl_created()

Remove copy once/read never fields:
DEV_CLASS
BD_NAME

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id53d86f370777cc999c4a060aa99a87edd2eb08c

4 years agoRemoved unused tACL_CONN fields
Chris Manton [Tue, 18 Aug 2020 17:25:30 +0000 (10:25 -0700)]
Removed unused tACL_CONN fields

tACL_CONN::BD_NAME
tACL_CONN::DEV_CLASS

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Icc604d09c9ca5e5ca30d6af622214f2580437f3a

4 years agoUse API stack/acl/btm_acl
Chris Manton [Thu, 20 Aug 2020 16:54:12 +0000 (09:54 -0700)]
Use API stack/acl/btm_acl

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ib19ee20ddf598ba0bf1d74a12a5686d7558f2fce

4 years agoAdd APIs to stack/acl/btm_acl
Chris Manton [Thu, 20 Aug 2020 16:35:52 +0000 (09:35 -0700)]
Add APIs to stack/acl/btm_acl

acl_accept_connection_request
acl_reject_connection_request

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I550d96d1dc04b5576996db919def6580c9a947d1

4 years agoUse API stack/acl/btm_acl::btm_acl_connection_request
Chris Manton [Thu, 20 Aug 2020 16:17:37 +0000 (09:17 -0700)]
Use API stack/acl/btm_acl::btm_acl_connection_request

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ie02b35f15f6e773b6f6a793c33b675f2208865fe

4 years agoAdd API stack/acl/btm_acl::btm_acl_connection_request
Chris Manton [Thu, 20 Aug 2020 15:59:29 +0000 (08:59 -0700)]
Add API stack/acl/btm_acl::btm_acl_connection_request

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Iaa2bc3870b87b1394ed7363afa0827b93a9bb2ca

4 years agoWrap tL2C_LCB::link_role in API
Chris Manton [Thu, 20 Aug 2020 15:48:32 +0000 (08:48 -0700)]
Wrap tL2C_LCB::link_role in API

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4a10763a8107f0a9dbc0ddf62d0671fe9b41a63f

4 years agoRename btm_dev_support_switch
Chris Manton [Mon, 17 Aug 2020 22:00:19 +0000 (15:00 -0700)]
Rename btm_dev_support_switch

=>btm_dev_support_role_switch

Streamline stack/btm/btm_dev::btm_dev_support_switch

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

4 years agoStreamline stack/btm/btm_dev::btm_dev_support_switch
Chris Manton [Mon, 17 Aug 2020 21:32:08 +0000 (14:32 -0700)]
Streamline stack/btm/btm_dev::btm_dev_support_switch

Bug: 162984360
Tag: #refactor
Test: compiles and devices pair and work

Change-Id: I838a258471b484c29dc3828e1c940065451a10b0

4 years agoReplace BTM_ACL_PKT_TYPES_MASK_
Chris Manton [Sun, 16 Aug 2020 18:27:01 +0000 (11:27 -0700)]
Replace BTM_ACL_PKT_TYPES_MASK_

BTM_ACL_PKT_TYPES_MASK_DM1=>HCI_PKT_TYPES_MASK_DM1
BTM_ACL_PKT_TYPES_MASK_DH1=>HCI_PKT_TYPES_MASK_DH1
BTM_ACL_PKT_TYPES_MASK_DM3=>HCI_PKT_TYPES_MASK_DM3
BTM_ACL_PKT_TYPES_MASK_DH3=>HCI_PKT_TYPES_MASK_DH3
BTM_ACL_PKT_TYPES_MASK_DM5=>HCI_PKT_TYPES_MASK_DM5
BTM_ACL_PKT_TYPES_MASK_DH5=>HCI_PKT_TYPES_MASK_DH5
BTM_ACL_PKT_TYPES_MASK_NO_2_DH1=>HCI_PKT_TYPES_MASK_NO_2_DH1
BTM_ACL_PKT_TYPES_MASK_NO_3_DH1=>HCI_PKT_TYPES_MASK_NO_3_DH1
BTM_ACL_PKT_TYPES_MASK_NO_2_DH3=>HCI_PKT_TYPES_MASK_NO_2_DH3
BTM_ACL_PKT_TYPES_MASK_NO_3_DH3=>HCI_PKT_TYPES_MASK_NO_3_DH3
BTM_ACL_PKT_TYPES_MASK_NO_2_DH5=>HCI_PKT_TYPES_MASK_NO_2_DH5
BTM_ACL_PKT_TYPES_MASK_NO_3_DH5=>HCI_PKT_TYPES_MASK_NO_3_DH5

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6c1420266afdb584612cf96cbfae32d437a83a90

4 years agoMerge changes Icedbc393,I396b7959 am: 180041861a
Treehugger Robot [Thu, 20 Aug 2020 18:27:34 +0000 (18:27 +0000)]
Merge changes Icedbc393,I396b7959 am: 180041861a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1401334

Change-Id: I4a71138fb8424378a0ba9a4189588208ce0c9466

4 years agoMerge changes Icedbc393,I396b7959
Treehugger Robot [Thu, 20 Aug 2020 18:19:52 +0000 (18:19 +0000)]
Merge changes Icedbc393,I396b7959

* changes:
  Check for MITM required.
  Fall back to local AuthenticationRequirements to set values