OSDN Git Service

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

4 years agop_auth_complete_callback is no-op for HCI_SUCCESS case am: 31ecf7784a
Hansong Zhang [Thu, 20 Aug 2020 17:16:48 +0000 (17:16 +0000)]
p_auth_complete_callback is no-op for HCI_SUCCESS case am: 31ecf7784a

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

Change-Id: I734ca7cd44d3b63edc70c31e937625a41778a265

4 years agoMerge "Ensure IO Cap Response received before processing UserConfirmationRequest...
Treehugger Robot [Thu, 20 Aug 2020 17:16:37 +0000 (17:16 +0000)]
Merge "Ensure IO Cap Response received before processing UserConfirmationRequest" am: a63b1eef93

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

Change-Id: I95e24d14e9ecf6fe1f2e869dcb685335cffdac2c

4 years agop_auth_complete_callback is no-op for HCI_SUCCESS case
Hansong Zhang [Thu, 20 Aug 2020 07:56:47 +0000 (00:56 -0700)]
p_auth_complete_callback is no-op for HCI_SUCCESS case

Remove.

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

4 years agoMerge "Ensure IO Cap Response received before processing UserConfirmationRequest"
Treehugger Robot [Thu, 20 Aug 2020 17:09:36 +0000 (17:09 +0000)]
Merge "Ensure IO Cap Response received before processing UserConfirmationRequest"

4 years agoMerge changes I83637165,I4af96edd,I8e0ef282,I6bd6f659,I25e6810c, ... am: 7b5c5cba7d
Treehugger Robot [Thu, 20 Aug 2020 17:03:37 +0000 (17:03 +0000)]
Merge changes I83637165,I4af96edd,I8e0ef282,I6bd6f659,I25e6810c, ... am: 7b5c5cba7d

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

Change-Id: Icf865fd9bff51b9a20c358624c1190664a2ae951

4 years agoMerge changes I83637165,I4af96edd,I8e0ef282,I6bd6f659,I25e6810c, ...
Treehugger Robot [Thu, 20 Aug 2020 16:40:08 +0000 (16:40 +0000)]
Merge changes I83637165,I4af96edd,I8e0ef282,I6bd6f659,I25e6810c, ...

* changes:
  Wrap l2c::IsBonding in API
  Streamline includes stack/l2cap/l2c_link
  Move l2cu_get_next_buffer_to_send
  Move stack/l2cap/::l2cu_get_next_channel_in_rr
  Remove def L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
  Remove def L2CAP_NUM_FIXED_CHNLS Optimization

4 years agostack/btm: Support Reading Peer SCA am: b59379b6ca
Jakub Tyszkowski [Thu, 20 Aug 2020 15:54:31 +0000 (15:54 +0000)]
stack/btm: Support Reading Peer SCA am: b59379b6ca

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

Change-Id: I006399ccfb41410ecd7af32502ee2fa230894c2e

4 years agohci: Add Broadcast Isochronous Sets related commands
Grzegorz Kołodziejczyk [Tue, 11 Aug 2020 12:59:41 +0000 (14:59 +0200)]
hci: Add Broadcast Isochronous Sets related commands

This is required for audio broadcaster functionality.

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: compilation
Change-Id: I1aa0ab271e188f70eda579f212e6870557cef7e5

4 years agohci: Add additional iso related commands
Grzegorz Kołodziejczyk [Tue, 11 Aug 2020 13:07:19 +0000 (15:07 +0200)]
hci: Add additional iso related commands

These are not necessary for the upcoming le audio implementation
but may become useful in near future.

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: compilation
Change-Id: Ice003a604da44d5430b6b356e6f16d0fcbdf1873

4 years agoWrap l2c::IsBonding in API
Chris Manton [Thu, 20 Aug 2020 06:04:53 +0000 (23:04 -0700)]
Wrap l2c::IsBonding in API

Towards proper interfaces

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

4 years agoStreamline includes stack/l2cap/l2c_link
Chris Manton [Thu, 20 Aug 2020 00:50:06 +0000 (17:50 -0700)]
Streamline includes stack/l2cap/l2c_link

Towards proper interfaces

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

4 years agoMove l2cu_get_next_buffer_to_send
Chris Manton [Thu, 20 Aug 2020 00:23:45 +0000 (17:23 -0700)]
Move l2cu_get_next_buffer_to_send

From: stack/l2cap/l2c_utils
Into: stack/l2cap/l2c_link

Towards proper interfaces

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

Change-Id: I8e0ef282d5bae9a0deb0e465b326d7889d67d5e8

4 years agoMove stack/l2cap/::l2cu_get_next_channel_in_rr
Chris Manton [Thu, 20 Aug 2020 00:27:41 +0000 (17:27 -0700)]
Move stack/l2cap/::l2cu_get_next_channel_in_rr

From: stack/l2cap/l2c_utils
Into: stack/l2cap/l2c_link

Towards proper interfaces

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

4 years agoRemove def L2CAP_ROUND_ROBIN_CHANNEL_SERVICE
Chris Manton [Wed, 19 Aug 2020 23:40:24 +0000 (16:40 -0700)]
Remove def L2CAP_ROUND_ROBIN_CHANNEL_SERVICE

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

4 years agoRemove def L2CAP_NUM_FIXED_CHNLS Optimization
Chris Manton [Wed, 19 Aug 2020 23:10:27 +0000 (16:10 -0700)]
Remove def L2CAP_NUM_FIXED_CHNLS Optimization

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

4 years agoMerge "btm: Initial Iso Manager implementation" am: c55a0e8f0e
Jakub Pawlowski [Thu, 20 Aug 2020 12:42:35 +0000 (12:42 +0000)]
Merge "btm: Initial Iso Manager implementation" am: c55a0e8f0e

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

Change-Id: I0976ea5973aedda82619ee3bdd942e052322f069

4 years agostack/btm: Support Reading Peer SCA
Jakub Tyszkowski [Tue, 18 Aug 2020 11:15:55 +0000 (13:15 +0200)]
stack/btm: Support Reading Peer SCA

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: compilation
Change-Id: Ia65d8aea66850a780909c240291934ea668cb6ea

4 years agoMerge "btm: Initial Iso Manager implementation"
Jakub Pawlowski [Thu, 20 Aug 2020 12:33:38 +0000 (12:33 +0000)]
Merge "btm: Initial Iso Manager implementation"

4 years agoMerge "GD-HCI: Flush snoop log to kernel buffer on every write" am: e3a5239a92
Treehugger Robot [Thu, 20 Aug 2020 11:49:21 +0000 (11:49 +0000)]
Merge "GD-HCI: Flush snoop log to kernel buffer on every write" am: e3a5239a92

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

Change-Id: Ib24868326ffa039734944a90f91d212f1501d3e2

4 years agoMerge changes Ic895dce8,I80b661d6,I108d89b0,Ia0963f5e,I63d2703c, ... am: b5c8af6af8
Zach Johnson [Thu, 20 Aug 2020 11:49:15 +0000 (11:49 +0000)]
Merge changes Ic895dce8,I80b661d6,I108d89b0,Ia0963f5e,I63d2703c, ... am: b5c8af6af8

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

Change-Id: I9c464a042061bb0813bb3fcfea6775b9699472d7

4 years agoMerge "GD-HCI: Flush snoop log to kernel buffer on every write"
Treehugger Robot [Thu, 20 Aug 2020 11:36:19 +0000 (11:36 +0000)]
Merge "GD-HCI: Flush snoop log to kernel buffer on every write"

4 years agoMerge changes Ic895dce8,I80b661d6,I108d89b0,Ia0963f5e,I63d2703c, ...
Zach Johnson [Thu, 20 Aug 2020 11:34:35 +0000 (11:34 +0000)]
Merge changes Ic895dce8,I80b661d6,I108d89b0,Ia0963f5e,I63d2703c, ...

* changes:
  More security flag hidings
  More security flag hiding
  More security flag hiding
  Flatten BTA_JvIsEncrypted
  Simplify BTA_JvIsEncrypted
  Start hiding security flags
  We don't do AMP
  Remove p_authorize_callback, it's never used
  btm_sec_are_all_trusted is never called
  trusted_mask is self refrential and always 0
  Remove trusted_mask from BTM_SecBond
  Remove trusted mask from BTM_SecAddDevice
  BTM_SEC_IS_SERVICE_TRUSTED is never used
  BTM_SecClrTempAuthService does nothing
  last_author_service_id is never meaningfully set
  Remove BTM_SEC_AUTHORIZED, it's only removed or checked

4 years agobtm: Initial Iso Manager implementation
Jakub Tyszkowski [Thu, 20 Aug 2020 10:58:19 +0000 (10:58 +0000)]
btm: Initial Iso Manager implementation

This adds the ISO Manager used to manage the CIG/CIS and
in future patches also BIG/BIS channels. It defines an API
for the user to call and callback interfaces that the user
has to implement and register in the ISO Manager to use it.

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

4 years agoMerge changes Ifad48ac1,Iec6e7550,I68ff2112,Ibb875781,Iae859fcc, ... am: 7a729122b1
Zach Johnson [Thu, 20 Aug 2020 10:28:58 +0000 (10:28 +0000)]
Merge changes Ifad48ac1,Iec6e7550,I68ff2112,Ibb875781,Iae859fcc, ... am: 7a729122b1

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

Change-Id: I6b43faab0f5cf67e6f60e14dc9047eed1fd4a273

4 years agoMerge changes Ifad48ac1,Iec6e7550,I68ff2112,Ibb875781,Iae859fcc, ...
Zach Johnson [Thu, 20 Aug 2020 10:20:38 +0000 (10:20 +0000)]
Merge changes Ifad48ac1,Iec6e7550,I68ff2112,Ibb875781,Iae859fcc, ...

* changes:
  BTM_SEC_OUT_FLAGS used to include authorized
  this used to check for authorized
  Remove always false expressions
  This expression is also never true
  This condition is never true
  Simpify boolean expression
  Remove useless redefinition BTM_SEC_FLAG_AUTHORIZED
  BTM_SEC_OUT_AUTHENTICATE is never set, only checked or removed
  BTM_SEC_IN_AUTHORIZE is never set, only checked or removed
  Remove BTA_AV_WITH_AVCTP_AUTHORIZATION
  BTA_SEC_AUTHENTICATE does not include authorization
  Flatten bta_av_cb.sec_mask
  The security mask is always BTA_SEC_AUTHENTICATE
  Internalize BTA_AvEnable's security mask
  Flatten BTA_SEC_AUTHORIZE

4 years agoMerge "Add boolean flag for indicating IO Cap Response received" am: 5dd4773ef3
Treehugger Robot [Thu, 20 Aug 2020 09:47:02 +0000 (09:47 +0000)]
Merge "Add boolean flag for indicating IO Cap Response received" am: 5dd4773ef3

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

Change-Id: I8b5e1174683b88084c7e1887d003df5af54d1c9f

4 years agoMerge "Add boolean flag for indicating IO Cap Response received"
Treehugger Robot [Thu, 20 Aug 2020 09:27:23 +0000 (09:27 +0000)]
Merge "Add boolean flag for indicating IO Cap Response received"

4 years agoMerge "Ensure we delete the link key from the controller." am: 3523729335
Treehugger Robot [Thu, 20 Aug 2020 08:59:18 +0000 (08:59 +0000)]
Merge "Ensure we delete the link key from the controller." am: 3523729335

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

Change-Id: I2c22c6b2017088e5e5903204de6d944b50ec2a0d

4 years agoMerge "Ensure we delete the link key from the controller."
Treehugger Robot [Thu, 20 Aug 2020 08:44:21 +0000 (08:44 +0000)]
Merge "Ensure we delete the link key from the controller."

4 years agoGD-HCI: Flush snoop log to kernel buffer on every write
Jack He [Thu, 20 Aug 2020 08:29:24 +0000 (01:29 -0700)]
GD-HCI: Flush snoop log to kernel buffer on every write

* std::ofstream::flush() pushes user data into kernel memory. The data
  will be written even if this process crashes. However, data will be lost
  if there is a kernel panic, which is out of scope of BT snoop log.
* std::ofstream::write() followed by std::ofstream::flush() has similar
  effect as UNIX write(fd, data, len) as write() syscall dumps data into
  kernel memory directly
* Before this change, btsnoop log data might be partially stored in
  memory when bluetooth stack crashes, causing broken log entries
  or missing packets

Bug: 164973960
Test: make, flash phone, and test pairing
Tag: #gd-refactor
Change-Id: I611e0b9480511b569dadbb023775b0db8159f39d

4 years agoSimplify stack/l2cap/::l2c_link_check_send_pkts am: 1f098dd15b
Chris Manton [Thu, 20 Aug 2020 08:27:27 +0000 (08:27 +0000)]
Simplify stack/l2cap/::l2c_link_check_send_pkts am: 1f098dd15b

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

Change-Id: I21c8e9b76584acc45ce85111a910277c0f78e155

4 years agoCheck for MITM required.
Martin Brabham [Fri, 14 Aug 2020 21:24:22 +0000 (14:24 -0700)]
Check for MITM required.

Per specification; if MITM is required then AUTO is NOT ALLOWED!

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

4 years agoEnsure IO Cap Response received before processing UserConfirmationRequest
Martin Brabham [Thu, 20 Aug 2020 06:03:03 +0000 (23:03 -0700)]
Ensure IO Cap Response received before processing UserConfirmationRequest

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

4 years agoFall back to local AuthenticationRequirements to set values
Martin Brabham [Thu, 20 Aug 2020 06:06:18 +0000 (23:06 -0700)]
Fall back to local AuthenticationRequirements to set values

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

4 years agoMore security flag hidings
Zach Johnson [Thu, 20 Aug 2020 01:34:16 +0000 (18:34 -0700)]
More security flag hidings

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

4 years agoMore security flag hiding
Zach Johnson [Thu, 20 Aug 2020 01:13:55 +0000 (18:13 -0700)]
More security flag hiding

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

4 years agoMore security flag hiding
Zach Johnson [Thu, 20 Aug 2020 01:08:34 +0000 (18:08 -0700)]
More security flag hiding

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

4 years agoFlatten BTA_JvIsEncrypted
Zach Johnson [Thu, 20 Aug 2020 00:56:27 +0000 (17:56 -0700)]
Flatten BTA_JvIsEncrypted

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

4 years agoSimplify BTA_JvIsEncrypted
Zach Johnson [Thu, 20 Aug 2020 00:54:21 +0000 (17:54 -0700)]
Simplify BTA_JvIsEncrypted

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

4 years agoStart hiding security flags
Zach Johnson [Thu, 20 Aug 2020 00:50:41 +0000 (17:50 -0700)]
Start hiding security flags

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

4 years agoWe don't do AMP
Zach Johnson [Thu, 20 Aug 2020 00:14:58 +0000 (17:14 -0700)]
We don't do AMP

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

4 years agoRemove p_authorize_callback, it's never used
Zach Johnson [Thu, 20 Aug 2020 00:10:35 +0000 (17:10 -0700)]
Remove p_authorize_callback, it's never used

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

4 years agobtm_sec_are_all_trusted is never called
Zach Johnson [Wed, 19 Aug 2020 23:16:16 +0000 (16:16 -0700)]
btm_sec_are_all_trusted is never called

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

4 years agotrusted_mask is self refrential and always 0
Zach Johnson [Wed, 19 Aug 2020 23:08:43 +0000 (16:08 -0700)]
trusted_mask is self refrential and always 0

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

4 years agoRemove trusted_mask from BTM_SecBond
Zach Johnson [Wed, 19 Aug 2020 22:33:32 +0000 (15:33 -0700)]
Remove trusted_mask from BTM_SecBond

it's always zero, does nothing, is useless

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

4 years agoRemove trusted mask from BTM_SecAddDevice
Zach Johnson [Wed, 19 Aug 2020 22:08:31 +0000 (15:08 -0700)]
Remove trusted mask from BTM_SecAddDevice

It's just zeroed out, internalize it

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

4 years agoBTM_SEC_IS_SERVICE_TRUSTED is never used
Zach Johnson [Wed, 19 Aug 2020 22:00:21 +0000 (15:00 -0700)]
BTM_SEC_IS_SERVICE_TRUSTED is never used

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

4 years agoBTM_SecClrTempAuthService does nothing
Zach Johnson [Wed, 19 Aug 2020 21:57:56 +0000 (14:57 -0700)]
BTM_SecClrTempAuthService does nothing

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

4 years agolast_author_service_id is never meaningfully set
Zach Johnson [Wed, 19 Aug 2020 21:56:47 +0000 (14:56 -0700)]
last_author_service_id is never meaningfully set

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

4 years agoBTM_SEC_OUT_FLAGS used to include authorized
Zach Johnson [Wed, 19 Aug 2020 21:47:06 +0000 (14:47 -0700)]
BTM_SEC_OUT_FLAGS used to include authorized

but now it doesn't so we only need the condition
above this one

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

4 years agoRemove BTM_SEC_AUTHORIZED, it's only removed or checked
Zach Johnson [Wed, 19 Aug 2020 21:51:27 +0000 (14:51 -0700)]
Remove BTM_SEC_AUTHORIZED, it's only removed or checked

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

4 years agothis used to check for authorized
Zach Johnson [Wed, 19 Aug 2020 21:43:35 +0000 (14:43 -0700)]
this used to check for authorized

BTM_SEC_IN_FLAGS was BTM_SEC_IN_AUTHENTICATE | BTM_SEC_IN_ENCRYPT |
BTM_SEC_IN_AUTHORIZE

authorized is gone now, so we only need the condition just above this
one

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

4 years agoRemove always false expressions
Zach Johnson [Wed, 19 Aug 2020 21:39:18 +0000 (14:39 -0700)]
Remove always false expressions

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

4 years agoThis expression is also never true
Zach Johnson [Wed, 19 Aug 2020 21:33:14 +0000 (14:33 -0700)]
This expression is also never true

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

4 years agoThis condition is never true
Zach Johnson [Wed, 19 Aug 2020 21:23:00 +0000 (14:23 -0700)]
This condition is never true

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

4 years agoSimpify boolean expression
Zach Johnson [Wed, 19 Aug 2020 21:22:07 +0000 (14:22 -0700)]
Simpify boolean expression

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

4 years agoRemove useless redefinition BTM_SEC_FLAG_AUTHORIZED
Zach Johnson [Wed, 19 Aug 2020 21:19:31 +0000 (14:19 -0700)]
Remove useless redefinition BTM_SEC_FLAG_AUTHORIZED

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

4 years agoBTM_SEC_OUT_AUTHENTICATE is never set, only checked or removed
Zach Johnson [Wed, 19 Aug 2020 21:15:50 +0000 (14:15 -0700)]
BTM_SEC_OUT_AUTHENTICATE is never set, only checked or removed

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

4 years agoBTM_SEC_IN_AUTHORIZE is never set, only checked or removed
Zach Johnson [Wed, 19 Aug 2020 21:09:43 +0000 (14:09 -0700)]
BTM_SEC_IN_AUTHORIZE is never set, only checked or removed

For clarity, falsed out these expressions in these
super complicated conditionals.

A future patch set will remove them.

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

4 years agoRemove BTA_AV_WITH_AVCTP_AUTHORIZATION
Zach Johnson [Wed, 19 Aug 2020 20:49:36 +0000 (13:49 -0700)]
Remove BTA_AV_WITH_AVCTP_AUTHORIZATION

It's always false.

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

4 years agoBTA_SEC_AUTHENTICATE does not include authorization
Zach Johnson [Wed, 19 Aug 2020 20:45:08 +0000 (13:45 -0700)]
BTA_SEC_AUTHENTICATE does not include authorization

this expression can be simplified

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

4 years agoFlatten bta_av_cb.sec_mask
Zach Johnson [Wed, 19 Aug 2020 20:14:25 +0000 (13:14 -0700)]
Flatten bta_av_cb.sec_mask

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

4 years agoThe security mask is always BTA_SEC_AUTHENTICATE
Zach Johnson [Wed, 19 Aug 2020 19:50:31 +0000 (12:50 -0700)]
The security mask is always BTA_SEC_AUTHENTICATE

don't pass in the message

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

4 years agoInternalize BTA_AvEnable's security mask
Zach Johnson [Wed, 19 Aug 2020 19:46:47 +0000 (12:46 -0700)]
Internalize BTA_AvEnable's security mask

it's always BTA_SEC_AUTHENTICATE

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

4 years agoFlatten BTA_SEC_AUTHORIZE
Zach Johnson [Wed, 19 Aug 2020 19:41:20 +0000 (12:41 -0700)]
Flatten BTA_SEC_AUTHORIZE

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

4 years agoAdd boolean flag for indicating IO Cap Response received
Martin Brabham [Thu, 20 Aug 2020 05:58:58 +0000 (22:58 -0700)]
Add boolean flag for indicating IO Cap Response received

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

4 years agoEnsure we delete the link key from the controller.
Martin Brabham [Thu, 20 Aug 2020 05:55:40 +0000 (22:55 -0700)]
Ensure we delete the link key from the controller.

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

4 years agoSimplify stack/l2cap/::l2c_link_check_send_pkts
Chris Manton [Wed, 19 Aug 2020 22:08:50 +0000 (15:08 -0700)]
Simplify stack/l2cap/::l2c_link_check_send_pkts

Towards proper interfaces

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

4 years agoMerge changes I283667e2,Ibc685b5d,I54537140,Ic11c5809 am: 789939514f
Treehugger Robot [Wed, 19 Aug 2020 22:40:44 +0000 (22:40 +0000)]
Merge changes I283667e2,Ibc685b5d,I54537140,Ic11c5809 am: 789939514f

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

Change-Id: Ic1db1158c0194e44c7bd4e9fe38d3cdb3d71442b

4 years agoMerge changes I14a0dc1d,If34b5018,Icdba6206 am: af886e8cbe
Treehugger Robot [Wed, 19 Aug 2020 22:40:15 +0000 (22:40 +0000)]
Merge changes I14a0dc1d,If34b5018,Icdba6206 am: af886e8cbe

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

Change-Id: Ie306002144c20e1608636881c527726a60c9fb70

4 years agoMerge changes I283667e2,Ibc685b5d,I54537140,Ic11c5809
Treehugger Robot [Wed, 19 Aug 2020 22:15:02 +0000 (22:15 +0000)]
Merge changes I283667e2,Ibc685b5d,I54537140,Ic11c5809

* changes:
  Move create_classic_conn from l2c to acl
  Add API stack/acl/btm_acl::acl_create_classic_connection
  Simplify stack/l2cap/l2c_utils::l2cu_create_conn_after_switch
  Move stack/l2cap/l2c_link::btm_acl_connected

4 years agoMerge changes I14a0dc1d,If34b5018,Icdba6206
Treehugger Robot [Wed, 19 Aug 2020 21:55:06 +0000 (21:55 +0000)]
Merge changes I14a0dc1d,If34b5018,Icdba6206

* changes:
  This if is always true
  Remove useless line
  Remove unused parameter in btif_dm_proc_io_req

4 years agoMerge changes I1f6a908f,I96781ecd,I4de2d029,Ib3e5580a,I5b615bb3 am: 17f018f516
Treehugger Robot [Wed, 19 Aug 2020 21:16:06 +0000 (21:16 +0000)]
Merge changes I1f6a908f,I96781ecd,I4de2d029,Ib3e5580a,I5b615bb3 am: 17f018f516

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

Change-Id: I15b5a2ad2e14b70ec5833ce1b3856a65c5836247

4 years agoMerge changes I1f6a908f,I96781ecd,I4de2d029,Ib3e5580a,I5b615bb3
Treehugger Robot [Wed, 19 Aug 2020 21:10:46 +0000 (21:10 +0000)]
Merge changes I1f6a908f,I96781ecd,I4de2d029,Ib3e5580a,I5b615bb3

* changes:
  BTM_ReadConnectability is never used now
  BTM_ReadDiscoverability is never used now
  Simplify BTM_SetDiscoverability
  Simplify BTM_SetConnectability
  Inline always 0 parameters

4 years agoMerge changes I8fd02d8f,Ia21eeb73 am: c5fc120586
Treehugger Robot [Wed, 19 Aug 2020 21:10:38 +0000 (21:10 +0000)]
Merge changes I8fd02d8f,Ia21eeb73 am: c5fc120586

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

Change-Id: I0e2a635e39b1a68ba3561685a5bfdc3164f438bc

4 years agoMerge changes I8fd02d8f,Ia21eeb73
Treehugger Robot [Wed, 19 Aug 2020 20:57:37 +0000 (20:57 +0000)]
Merge changes I8fd02d8f,Ia21eeb73

* changes:
  Remove unnecessary definition
  GD SecurityRecord: Explicitly set IsEncrypted to false upon loading

4 years agoMerge changes I51c3b864,I2af0f2c2,Ifaec802b,I9ea573cb,I87154d64, ... am: 6bc1dc3c14
Zach Johnson [Wed, 19 Aug 2020 20:49:00 +0000 (20:49 +0000)]
Merge changes I51c3b864,I2af0f2c2,Ifaec802b,I9ea573cb,I87154d64, ... am: 6bc1dc3c14

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

Change-Id: Ibcd8d7a51931af14a8d966747a45c60b300c2af7

4 years agoMerge changes I51c3b864,I2af0f2c2,Ifaec802b,I9ea573cb,I87154d64, ...
Zach Johnson [Wed, 19 Aug 2020 20:30:34 +0000 (20:30 +0000)]
Merge changes I51c3b864,I2af0f2c2,Ifaec802b,I9ea573cb,I87154d64, ...

* changes:
  what on earth
  if you pass 0, these are the values used
  These were never set
  The params are never ignore, they're set in this function
  Fold bt_scan_mode_t into BTA_DmSetVisibility
  Flatten BTA_DmSetVisibility

4 years agoMerge changes I5f284c8c,I5f1afa5e,I5e7478e9,I9c717be1,Ie8d7e20a, ... am: 5bf7cae01b
Zach Johnson [Wed, 19 Aug 2020 20:25:28 +0000 (20:25 +0000)]
Merge changes I5f284c8c,I5f1afa5e,I5e7478e9,I9c717be1,Ie8d7e20a, ... am: 5bf7cae01b

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

Change-Id: I8ab7f9ad1466cb28625dd94fd711a2ff26a96947

4 years agoMerge changes I5f284c8c,I5f1afa5e,I5e7478e9,I9c717be1,Ie8d7e20a, ...
Zach Johnson [Wed, 19 Aug 2020 20:10:47 +0000 (20:10 +0000)]
Merge changes I5f284c8c,I5f1afa5e,I5e7478e9,I9c717be1,Ie8d7e20a, ...

* changes:
  read_inq_tx_power_timer is never used
  p_inq_tx_power_cmpl_cb is always null
  Remove dead code
  btm_process_remote_name does nothing interesting if remote name not active
  btm_inq_vars.scan_type is not useful
  Remove useless variable
  Status is set but not used
  Replace with equivalent expression
  Remove unnecessary variable
  state is already set to this value higher in this function
  Flatten btm_initiate_inquiry
  BTM_BLE_LIMITED_INQUIRY is never used
  BTM_LIMITED_INQUIRY is never set
  Delete BTM_CancelPeriodicInquiry, it's unused and does nothing
  BTM_PERIODIC_INQUIRY_ACTIVE is never set
  This condition will never be met
  Replace equivalent expression
  Don't report illegal value for something uncontrollable
  reduce duplicate mask setting
  p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK is always true