OSDN Git Service

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

4 years agoThis if is always true
Hansong Zhang [Wed, 19 Aug 2020 19:54:11 +0000 (12:54 -0700)]
This if is always true

In previous line, if p_dev_rec->sm4 & BTM_SM4_UPGRADE is true, then we
still have BTM_SUCCESS; if we invoke btm_cb.api.p_sp_callback, then OOB
data status is set in btif_dm_set_oob_for_io_req, unless the stack is
not running.

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

4 years agoMove create_classic_conn from l2c to acl
Chris Manton [Wed, 19 Aug 2020 19:23:40 +0000 (12:23 -0700)]
Move create_classic_conn from l2c to acl

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

4 years agoAdd API stack/acl/btm_acl::acl_create_classic_connection
Chris Manton [Wed, 19 Aug 2020 19:22:23 +0000 (12:22 -0700)]
Add API stack/acl/btm_acl::acl_create_classic_connection

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

4 years agoSimplify stack/l2cap/l2c_utils::l2cu_create_conn_after_switch
Chris Manton [Tue, 18 Aug 2020 05:03:41 +0000 (22:03 -0700)]
Simplify stack/l2cap/l2c_utils::l2cu_create_conn_after_switch

Towards proper interfaces

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

4 years agoRemove useless line
Hansong Zhang [Wed, 19 Aug 2020 19:42:53 +0000 (12:42 -0700)]
Remove useless line

auth_req is either BTM_AUTH_AP_NO (2) or BTM_AUTH_AP_YES (3).
BTM_AUTH_DD_BOND is 2.  Useless or.

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

4 years agoMove stack/l2cap/l2c_link::btm_acl_connected
Chris Manton [Wed, 19 Aug 2020 19:30:04 +0000 (12:30 -0700)]
Move stack/l2cap/l2c_link::btm_acl_connected

Into: stack/acl/btm_acl

Towards proper interfaces

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

4 years agoRemove unused parameter in btif_dm_proc_io_req
Hansong Zhang [Wed, 19 Aug 2020 19:34:00 +0000 (12:34 -0700)]
Remove unused parameter in btif_dm_proc_io_req

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

4 years agoRemove unnecessary definition
Hansong Zhang [Wed, 19 Aug 2020 19:13:02 +0000 (12:13 -0700)]
Remove unnecessary definition

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

4 years agoGD SecurityRecord: Explicitly set IsEncrypted to false upon loading
Hansong Zhang [Wed, 19 Aug 2020 19:04:48 +0000 (12:04 -0700)]
GD SecurityRecord: Explicitly set IsEncrypted to false upon loading

IsEncrypted is set to true only after Encryption Change event.

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

4 years agoBTM_ReadConnectability is never used now
Zach Johnson [Wed, 19 Aug 2020 18:53:25 +0000 (11:53 -0700)]
BTM_ReadConnectability is never used now

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

4 years agoBTM_ReadDiscoverability is never used now
Zach Johnson [Wed, 19 Aug 2020 18:51:57 +0000 (11:51 -0700)]
BTM_ReadDiscoverability is never used now

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

4 years agoSimplify BTM_SetDiscoverability
Zach Johnson [Wed, 19 Aug 2020 18:45:11 +0000 (11:45 -0700)]
Simplify BTM_SetDiscoverability

window & interval are fixed, and need no validation

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

4 years agoSimplify BTM_SetConnectability
Zach Johnson [Wed, 19 Aug 2020 18:43:39 +0000 (11:43 -0700)]
Simplify BTM_SetConnectability

The windows are fixed defaults, and need no validation.

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

4 years agoInline always 0 parameters
Zach Johnson [Wed, 19 Aug 2020 18:41:15 +0000 (11:41 -0700)]
Inline always 0 parameters

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

4 years agoMerge changes If3136d44,I7a3ee025,I734ece7f
Zach Johnson [Wed, 19 Aug 2020 18:40:27 +0000 (18:40 +0000)]
Merge changes If3136d44,I7a3ee025,I734ece7f

* changes:
  Remove inquiry filtering from shim
  Remove unused filter_cond
  max_resps is always 0: unlimited

4 years agowhat on earth
Zach Johnson [Wed, 19 Aug 2020 18:25:04 +0000 (11:25 -0700)]
what on earth

this has been here since this code was put into AOSP

"oh hey, PAN_Register changes discoverable and connectable, let's work
around it by saving the initial values and then restoring them after."

anyways, I checked PAN_Register only sets initial state & registers with
l2cap.

this looks like a vestige of early PAN, probably from BTA days when this
was on feature phones they needed a way to make your phone discoverable
so you could use PAN.

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

Change-Id: I51c3b864b5c7c4847bcc2dfb84e55b6191146778

4 years agoMerge "SecurityManagerChannel: AuthenticationRequest not always needed"
Treehugger Robot [Wed, 19 Aug 2020 18:25:38 +0000 (18:25 +0000)]
Merge "SecurityManagerChannel: AuthenticationRequest not always needed"

4 years agoif you pass 0, these are the values used
Zach Johnson [Wed, 19 Aug 2020 18:16:07 +0000 (11:16 -0700)]
if you pass 0, these are the values used

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

4 years agoThese were never set
Zach Johnson [Wed, 19 Aug 2020 18:10:01 +0000 (11:10 -0700)]
These were never set

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

4 years agoThe params are never ignore, they're set in this function
Zach Johnson [Wed, 19 Aug 2020 18:00:11 +0000 (11:00 -0700)]
The params are never ignore, they're set in this function

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

4 years agoFold bt_scan_mode_t into BTA_DmSetVisibility
Zach Johnson [Wed, 19 Aug 2020 17:53:29 +0000 (10:53 -0700)]
Fold bt_scan_mode_t into BTA_DmSetVisibility

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

4 years agoFlatten BTA_DmSetVisibility
Zach Johnson [Wed, 19 Aug 2020 17:42:07 +0000 (10:42 -0700)]
Flatten BTA_DmSetVisibility

is called from main thread

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

4 years agogatt: Allow services to indicate eatt support
Łukasz Rymanowski [Wed, 19 Aug 2020 12:29:37 +0000 (14:29 +0200)]
gatt: Allow services to indicate eatt support

With this patch eatch client/server can decide if EATT support
should be enabled or not.
If eatt_support is set to true, and EATT is available, it will be used for services added.
If eatt_support is set to false, that means only ATT (CID 4) is used for services added.

Tag: #feature
Bug: 159786353
Sponsor: jpawlowski@
Test: compilation
Change-Id: I584172800ce32a4a11df465841d2bc49ab224939

4 years agoread_inq_tx_power_timer is never used
Zach Johnson [Wed, 19 Aug 2020 17:27:25 +0000 (10:27 -0700)]
read_inq_tx_power_timer is never used

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

4 years agop_inq_tx_power_cmpl_cb is always null
Zach Johnson [Wed, 19 Aug 2020 17:25:48 +0000 (10:25 -0700)]
p_inq_tx_power_cmpl_cb is always null

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

4 years agoRemove dead code
Zach Johnson [Wed, 19 Aug 2020 17:02:19 +0000 (10:02 -0700)]
Remove dead code

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

4 years agobtm_process_remote_name does nothing interesting if remote name not
Zach Johnson [Wed, 19 Aug 2020 16:59:12 +0000 (09:59 -0700)]
btm_process_remote_name does nothing interesting if remote name not
active

this function call does nothing

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

4 years agobtm_inq_vars.scan_type is not useful
Zach Johnson [Wed, 19 Aug 2020 16:47:34 +0000 (09:47 -0700)]
btm_inq_vars.scan_type is not useful

was never checked to do anything interesting, was always general or none

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

4 years agoRemove useless variable
Zach Johnson [Wed, 19 Aug 2020 16:28:59 +0000 (09:28 -0700)]
Remove useless variable

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

4 years agoStatus is set but not used
Zach Johnson [Wed, 19 Aug 2020 16:27:38 +0000 (09:27 -0700)]
Status is set but not used

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

4 years agoReplace with equivalent expression
Zach Johnson [Wed, 19 Aug 2020 16:24:23 +0000 (09:24 -0700)]
Replace with equivalent expression

mode is always general

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

4 years agoRemove unnecessary variable
Zach Johnson [Wed, 19 Aug 2020 16:23:17 +0000 (09:23 -0700)]
Remove unnecessary variable

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

4 years agostate is already set to this value higher in this function
Zach Johnson [Wed, 19 Aug 2020 16:22:27 +0000 (09:22 -0700)]
state is already set to this value higher in this function

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

4 years agoFlatten btm_initiate_inquiry
Zach Johnson [Wed, 19 Aug 2020 16:20:04 +0000 (09:20 -0700)]
Flatten btm_initiate_inquiry

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

4 years agoBTM_BLE_LIMITED_INQUIRY is never used
Zach Johnson [Wed, 19 Aug 2020 16:03:42 +0000 (09:03 -0700)]
BTM_BLE_LIMITED_INQUIRY is never used

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

4 years agoBTM_LIMITED_INQUIRY is never set
Zach Johnson [Wed, 19 Aug 2020 01:26:13 +0000 (18:26 -0700)]
BTM_LIMITED_INQUIRY is never set

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

4 years agoRemove inquiry filtering from shim
Zach Johnson [Wed, 19 Aug 2020 00:51:36 +0000 (17:51 -0700)]
Remove inquiry filtering from shim

not used in the legacy after all

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

4 years agoDelete BTM_CancelPeriodicInquiry, it's unused and does nothing
Zach Johnson [Wed, 19 Aug 2020 01:19:38 +0000 (18:19 -0700)]
Delete BTM_CancelPeriodicInquiry, it's unused and does nothing

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

4 years agoRemove unused filter_cond
Zach Johnson [Wed, 19 Aug 2020 00:49:11 +0000 (17:49 -0700)]
Remove unused filter_cond

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

4 years agoBTM_PERIODIC_INQUIRY_ACTIVE is never set
Zach Johnson [Wed, 19 Aug 2020 01:10:18 +0000 (18:10 -0700)]
BTM_PERIODIC_INQUIRY_ACTIVE is never set

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

4 years agomax_resps is always 0: unlimited
Zach Johnson [Wed, 19 Aug 2020 00:30:24 +0000 (17:30 -0700)]
max_resps is always 0: unlimited

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

4 years agoThis condition will never be met
Zach Johnson [Wed, 19 Aug 2020 01:01:20 +0000 (18:01 -0700)]
This condition will never be met

It's always BTM_GENERAL_INQUIRY, so it will never be true.

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

4 years agoReplace equivalent expression
Zach Johnson [Wed, 19 Aug 2020 00:59:19 +0000 (17:59 -0700)]
Replace equivalent expression

The function sets the mode to include BTM_BLE_GENERAL_INQUIRY, the mask
would only return this value.

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

4 years agoDon't report illegal value for something uncontrollable
Zach Johnson [Wed, 19 Aug 2020 00:57:14 +0000 (17:57 -0700)]
Don't report illegal value for something uncontrollable

used to be in a param, but now it's not, just ignore

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

4 years agoreduce duplicate mask setting
Zach Johnson [Wed, 19 Aug 2020 00:55:53 +0000 (17:55 -0700)]
reduce duplicate mask setting

p_inq->inqparms.mode &= ~BTM_BLE_INQUIRY_MASK happens anyways at the end
of the function

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

4 years agop_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK is always true
Zach Johnson [Wed, 19 Aug 2020 00:54:57 +0000 (17:54 -0700)]
p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK is always true

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

4 years agoMerge changes Idcd959b1,I33b14207,I44e72828,I8a29a276,I5fe0f362
Treehugger Robot [Wed, 19 Aug 2020 17:12:55 +0000 (17:12 +0000)]
Merge changes Idcd959b1,I33b14207,I44e72828,I8a29a276,I5fe0f362

* changes:
  Make stack/acl/acl.h more inclusive
  Add proper inclusion ordering
  Remove unused defs stack/include/btm_api
  Use security interface stack/include/sec_hci_link_interface
  Add security interface stack/include/sec_hci_link_interface

4 years agoMerge "GD L2cap: Fix OnEncryptionChange"
Treehugger Robot [Wed, 19 Aug 2020 16:39:48 +0000 (16:39 +0000)]
Merge "GD L2cap: Fix OnEncryptionChange"

4 years agoMerge "btif: remove dead code"
Treehugger Robot [Wed, 19 Aug 2020 16:39:05 +0000 (16:39 +0000)]
Merge "btif: remove dead code"

4 years agoMake stack/acl/acl.h more inclusive
Chris Manton [Tue, 18 Aug 2020 23:17:07 +0000 (16:17 -0700)]
Make stack/acl/acl.h more inclusive

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

4 years agoAdd proper inclusion ordering
Chris Manton [Tue, 18 Aug 2020 20:40:14 +0000 (13:40 -0700)]
Add proper inclusion ordering

Towards proper interfaces

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

4 years agoRemove unused defs stack/include/btm_api
Chris Manton [Sun, 16 Aug 2020 22:17:15 +0000 (15:17 -0700)]
Remove unused defs stack/include/btm_api

BTM_FEATURE_BYTES_PER_PAGE
BTM_EXT_FEATURES_PAGE_MAX

Towards proper interfaces

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

Change-Id: I44e728287f3656244d97b4bf126e07676050bd63

4 years agoUse security interface stack/include/sec_hci_link_interface
Chris Manton [Sun, 16 Aug 2020 17:47:42 +0000 (10:47 -0700)]
Use security interface stack/include/sec_hci_link_interface

Towards proper interfaces

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

4 years agoAdd security interface stack/include/sec_hci_link_interface
Chris Manton [Sun, 16 Aug 2020 17:45:56 +0000 (10:45 -0700)]
Add security interface stack/include/sec_hci_link_interface

Towards proper interfaces

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

4 years agoMerge "GD-HCI: Write empty value to storage instead of nullptr"
Treehugger Robot [Wed, 19 Aug 2020 12:51:55 +0000 (12:51 +0000)]
Merge "GD-HCI: Write empty value to storage instead of nullptr"

4 years agoMerge "Robust Caching - server hash calculation"
Treehugger Robot [Wed, 19 Aug 2020 12:37:42 +0000 (12:37 +0000)]
Merge "Robust Caching - server hash calculation"

4 years agostack/gatt: Store gatt client supported features
Łukasz Rymanowski [Tue, 18 Aug 2020 21:20:40 +0000 (23:20 +0200)]
stack/gatt: Store gatt client supported features

Tag: #feature
Bug: 159786353
Sponsor: jpawlowski@
Test: manual
Change-Id: I8cde2d62599d4d46a4e10babd0bf2f9d53886d5d

4 years agoRobust Caching - server hash calculation
HsingYuan Lo [Wed, 19 Aug 2020 07:49:08 +0000 (15:49 +0800)]
Robust Caching - server hash calculation

Bug: 154056389
Test: atest net_test_stack_gatt_sr_hash_native
Tag: #feature
Change-Id: I6cf888a8733dfaf9fb0d4b96de454450610ebcff

4 years agoSecurityManagerChannel: AuthenticationRequest not always needed
Hansong Zhang [Wed, 19 Aug 2020 07:09:23 +0000 (00:09 -0700)]
SecurityManagerChannel: AuthenticationRequest not always needed

Just needed when we initiate pairing

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

4 years agoGD L2cap: Fix OnEncryptionChange
Hansong Zhang [Wed, 19 Aug 2020 07:00:18 +0000 (00:00 -0700)]
GD L2cap: Fix OnEncryptionChange

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

4 years agobtif: remove dead code
Hansong Zhang [Wed, 19 Aug 2020 05:43:04 +0000 (22:43 -0700)]
btif: remove dead code

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

4 years agoSimplify BTM_SecAddDevice
Hansong Zhang [Wed, 19 Aug 2020 02:18:57 +0000 (19:18 -0700)]
Simplify BTM_SecAddDevice

Ah 0 is BTM_IO_CAP_OUT.  When we load a device from storage, we always
it's display only.

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

4 years agoSimplify bta_dm_add_device
Hansong Zhang [Wed, 19 Aug 2020 02:17:12 +0000 (19:17 -0700)]
Simplify bta_dm_add_device

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

4 years agoBTA_DmAddDevice: is_trusted, tm, io_cap are 0
Hansong Zhang [Wed, 19 Aug 2020 02:14:48 +0000 (19:14 -0700)]
BTA_DmAddDevice: is_trusted, tm, io_cap are 0

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

4 years agoMerge changes I228ee25f,I85914c62,I3a5c970d,I5f54b858,I6a885f21, ...
Zach Johnson [Wed, 19 Aug 2020 04:01:25 +0000 (04:01 +0000)]
Merge changes I228ee25f,I85914c62,I3a5c970d,I5f54b858,I6a885f21, ...

* changes:
  report_dup is always true
  Remove useless states
  Flatten btm_set_inq_event_filter
  pending_filt_complete_event is always zero
  inqfilt_active is always false
  Setting inqfilt_active to true has no effect
  p_inq->state is always BTM_INQ_SET_FILT_STATE when calling
  inqfilt_active is always true inside btm_set_inq_event_filter
  Status is always success
  p_inqfilter_cmpl_cb is never set
  hci_status is always success
  We never set the inquiry filter
  btm_set_inq_event_filter always returns CMD_STARTED

4 years agoMerge "GD Hack: Start service discovery on bonded"
Treehugger Robot [Wed, 19 Aug 2020 02:21:35 +0000 (02:21 +0000)]
Merge "GD Hack: Start service discovery on bonded"

4 years agoreport_dup is always true
Zach Johnson [Wed, 19 Aug 2020 00:15:20 +0000 (17:15 -0700)]
report_dup is always true

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

4 years agoMerge "GD-HCI Shim: Add missing cmds that do not generate cmd complete"
Treehugger Robot [Wed, 19 Aug 2020 00:13:54 +0000 (00:13 +0000)]
Merge "GD-HCI Shim: Add missing cmds that do not generate cmd complete"

4 years agoRemove useless states
Zach Johnson [Wed, 19 Aug 2020 00:09:49 +0000 (17:09 -0700)]
Remove useless states

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

4 years agoFlatten btm_set_inq_event_filter
Zach Johnson [Wed, 19 Aug 2020 00:08:31 +0000 (17:08 -0700)]
Flatten btm_set_inq_event_filter

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

4 years agopending_filt_complete_event is always zero
Zach Johnson [Wed, 19 Aug 2020 00:00:25 +0000 (17:00 -0700)]
pending_filt_complete_event is always zero

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

4 years agoinqfilt_active is always false
Zach Johnson [Tue, 18 Aug 2020 23:48:38 +0000 (16:48 -0700)]
inqfilt_active is always false

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

4 years agoSetting inqfilt_active to true has no effect
Zach Johnson [Tue, 18 Aug 2020 23:44:59 +0000 (16:44 -0700)]
Setting inqfilt_active to true has no effect

nothing meaningful happens between when it's set
and when it's set to false.

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

4 years agop_inq->state is always BTM_INQ_SET_FILT_STATE when calling
Zach Johnson [Tue, 18 Aug 2020 23:43:15 +0000 (16:43 -0700)]
p_inq->state is always BTM_INQ_SET_FILT_STATE when calling

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

4 years agoinqfilt_active is always true inside btm_set_inq_event_filter
Zach Johnson [Tue, 18 Aug 2020 23:41:17 +0000 (16:41 -0700)]
inqfilt_active is always true inside btm_set_inq_event_filter

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

4 years agoStatus is always success
Zach Johnson [Tue, 18 Aug 2020 23:39:01 +0000 (16:39 -0700)]
Status is always success

thank you for coming to my ted talk

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

4 years agop_inqfilter_cmpl_cb is never set
Zach Johnson [Tue, 18 Aug 2020 23:37:39 +0000 (16:37 -0700)]
p_inqfilter_cmpl_cb is never set

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

4 years agohci_status is always success
Zach Johnson [Tue, 18 Aug 2020 21:30:18 +0000 (14:30 -0700)]
hci_status is always success

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

4 years agoWe never set the inquiry filter
Zach Johnson [Tue, 18 Aug 2020 21:26:57 +0000 (14:26 -0700)]
We never set the inquiry filter

skip going to HCI, and merge the callback function into the call

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

4 years agobtm_set_inq_event_filter always returns CMD_STARTED
Zach Johnson [Tue, 18 Aug 2020 21:12:57 +0000 (14:12 -0700)]
btm_set_inq_event_filter always returns CMD_STARTED

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

4 years agoGD Hack: Start service discovery on bonded
Hansong Zhang [Tue, 18 Aug 2020 23:46:44 +0000 (16:46 -0700)]
GD Hack: Start service discovery on bonded

We haven't unified the callback path from BTM or GD shim to BTA/BTIF
yet.  We have to start service discovery specifically for GD at the
moment.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Test: connect to a speaker
Change-Id: I958c99b6943be36469096e8039ff95fda0026a0b

4 years agoMerge changes I7d5090ac,I74507676,I14148e2b,I2ca84a80
Zach Johnson [Tue, 18 Aug 2020 23:16:56 +0000 (23:16 +0000)]
Merge changes I7d5090ac,I74507676,I14148e2b,I2ca84a80

* changes:
  Simplify btm_set_inq_event_filter
  filter_cond_type is always BTM_CLR_INQUIRY_FILTER
  Don't use redefinition - BTM_FILTER_COND_BD_ADDR
  don't use the redefinition - BTM_FILTER_COND_DEVICE_CLASS

4 years agoGD-HCI: Write empty value to storage instead of nullptr
Jack He [Tue, 18 Aug 2020 22:28:40 +0000 (15:28 -0700)]
GD-HCI: Write empty value to storage instead of nullptr

* GD storage layer forbids writing nullptr
* Fix the instance in legacy stack that writes a nullptr when it
  wants to write an empty value

Bug: 164979578
Tag: #gd-refactor
Test: pair with hearing aid devices
Change-Id: I8280c66f6862f92a9fbcb87b1a1216d59ad2983d

4 years agoMerge changes I42c7ccd3,I4982180d
Treehugger Robot [Tue, 18 Aug 2020 22:04:52 +0000 (22:04 +0000)]
Merge changes I42c7ccd3,I4982180d

* changes:
  GD Security: Improve link encryption storage
  GD L2cap: Pass some security callback to Security Module

4 years agoMerge changes I672c778a,I8fd857d8,I214e42ab,I4be78209
Treehugger Robot [Tue, 18 Aug 2020 21:19:23 +0000 (21:19 +0000)]
Merge changes I672c778a,I8fd857d8,I214e42ab,I4be78209

* changes:
  Remove declarations stack/acl/btm_acl
  Use btif_acl and bta_dm_acl in btm_acl
  Add btif/include/btif_acl.h
  Add bta/include/bta_dm_acl.h

4 years agoSimplify btm_set_inq_event_filter
Zach Johnson [Tue, 18 Aug 2020 18:00:59 +0000 (11:00 -0700)]
Simplify btm_set_inq_event_filter

it only has one mode now

next step will be to see if we can remove entirely

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

4 years agoRemove unused API
Martin Brabham [Tue, 11 Aug 2020 23:20:01 +0000 (16:20 -0700)]
Remove unused API

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

4 years agoMerge "Add Disconnect Complete Matcher"
Treehugger Robot [Tue, 18 Aug 2020 20:09:08 +0000 (20:09 +0000)]
Merge "Add Disconnect Complete Matcher"

4 years agoGD Security: Improve link encryption storage
Hansong Zhang [Mon, 17 Aug 2020 22:05:38 +0000 (15:05 -0700)]
GD Security: Improve link encryption storage

Encryption is a property of link.  We update it when we receive
encryption change event, and then continue L2cap security Enforce()
workflow.

For RFCOMM and OPP, we just need encryption (remote device is paired),
without authenticated link key or MITM.

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

4 years agoGD-HCI Shim: Add missing cmds that do not generate cmd complete
Jack He [Tue, 18 Aug 2020 07:41:15 +0000 (00:41 -0700)]
GD-HCI Shim: Add missing cmds that do not generate cmd complete

* When sending those events over GD HCI shim, we should not expect
  command complete events

Bug: 164980031
Tag: #gd-refactor
Test: manually pair with LE devices after enabling HCI shim
Change-Id: I0b9aac7a038d64197795db5b03098d8587a6ef6f

4 years agoRemove declarations stack/acl/btm_acl
Chris Manton [Sun, 16 Aug 2020 16:59:13 +0000 (09:59 -0700)]
Remove declarations stack/acl/btm_acl

Towards proper interfaces

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