OSDN Git Service

android-x86/system-bt.git
4 years agoAdd stack/btm/btm_dev header
Chris Manton [Sat, 15 Aug 2020 06:13:59 +0000 (23:13 -0700)]
Add stack/btm/btm_dev header

From:stack/btm/btm_int

Provides device information

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

4 years agoSimplify stack/acl/btm_acl::btm_acl_role_changed
Chris Manton [Sat, 15 Aug 2020 02:10:25 +0000 (19:10 -0700)]
Simplify stack/acl/btm_acl::btm_acl_role_changed

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

4 years agoEncapsulate stack/acl/btm_acl::tBTM_ROLE_SWITCH_CMPL
Chris Manton [Sat, 15 Aug 2020 00:03:22 +0000 (17:03 -0700)]
Encapsulate stack/acl/btm_acl::tBTM_ROLE_SWITCH_CMPL

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

Change-Id: I7f8316c237bdca0bfa8ac39bde915a24113c7e32

4 years agoClean up stack/acl/acl.h
Chris Manton [Fri, 14 Aug 2020 23:47:11 +0000 (16:47 -0700)]
Clean up stack/acl/acl.h

Bug: 164357702
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I6def2d058c36bf39a2b10f0ba4fe8e0c307a7daa

4 years agoSimplify stack/btm/btm_ble::BTM_UseLeLink
Chris Manton [Fri, 14 Aug 2020 22:06:36 +0000 (15:06 -0700)]
Simplify stack/btm/btm_ble::BTM_UseLeLink

Bug: 164357702
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I617bdfc358ef851d21e928e311a14da30f6f4f1b

4 years agoMerge "Fix le transport selection"
Treehugger Robot [Fri, 14 Aug 2020 23:32:13 +0000 (23:32 +0000)]
Merge "Fix le transport selection"

4 years agoMerge "Add parameters to DispatchPairingHandler"
Treehugger Robot [Fri, 14 Aug 2020 23:10:11 +0000 (23:10 +0000)]
Merge "Add parameters to DispatchPairingHandler"

4 years agoMerge "Consolidate evt data initialization"
Treehugger Robot [Fri, 14 Aug 2020 23:02:02 +0000 (23:02 +0000)]
Merge "Consolidate evt data initialization"

4 years agoMerge "Fail fast"
Treehugger Robot [Fri, 14 Aug 2020 22:31:20 +0000 (22:31 +0000)]
Merge "Fail fast"

4 years agoFix le transport selection
Chris Manton [Fri, 14 Aug 2020 21:31:43 +0000 (14:31 -0700)]
Fix le transport selection

Bug: 164357702
Test: LE pairing dialog using nRF
Tag:#refactor

Change-Id: I3b0ce75435e91b409329dcae61e69a2c09e90b4b

4 years agoMerge "GD-Storage: Move constructor to protected"
Treehugger Robot [Fri, 14 Aug 2020 21:55:13 +0000 (21:55 +0000)]
Merge "GD-Storage: Move constructor to protected"

4 years agoMerge "Logging: Rename buf and now to avoid collisions"
Treehugger Robot [Fri, 14 Aug 2020 21:22:52 +0000 (21:22 +0000)]
Merge "Logging: Rename buf and now to avoid collisions"

4 years agoAdd parameters to DispatchPairingHandler
Martin Brabham [Thu, 13 Aug 2020 15:22:45 +0000 (08:22 -0700)]
Add parameters to DispatchPairingHandler

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

4 years agoMerge "Directly use parameter to create p_dev_rec"
Treehugger Robot [Fri, 14 Aug 2020 21:11:43 +0000 (21:11 +0000)]
Merge "Directly use parameter to create p_dev_rec"

4 years agoMerge changes I7876611d,I9f640034,Ia9b4f580,I881c1c82,I302e27b7, ...
Zach Johnson [Fri, 14 Aug 2020 20:33:12 +0000 (20:33 +0000)]
Merge changes I7876611d,I9f640034,Ia9b4f580,I881c1c82,I302e27b7, ...

* changes:
  Flatten BTIF_CORE_STORAGE_ADAPTER_READ
  Simplify btif_get_adapter_property
  Flatten BTIF_CORE_STORAGE_ADAPTER_READ_ALL
  Simplify btif_get_adapter_properties
  Flatten BTIF_DM_CB_LE_TEST_END and remove btif_dm_generic_evt
  Flatten BTIF_DM_CB_LE_(TX|RX)_TEST
  Flatten BTIF_DM_CB_BOND_STATE_BONDING
  Flatten BTIF_DM_CB_REMOVE_BOND

4 years agoMerge "gd HCI: assign client_handler_ before execute queued callbacks"
Treehugger Robot [Fri, 14 Aug 2020 18:55:25 +0000 (18:55 +0000)]
Merge "gd HCI: assign client_handler_ before execute queued callbacks"

4 years agoMerge "gd HCI: Remove on_le_set_random_address_complete"
Treehugger Robot [Fri, 14 Aug 2020 18:53:16 +0000 (18:53 +0000)]
Merge "gd HCI: Remove on_le_set_random_address_complete"

4 years agoGD-Storage: Move constructor to protected
Jack He [Thu, 13 Aug 2020 08:29:55 +0000 (01:29 -0700)]
GD-Storage: Move constructor to protected

Bug: 162269750
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Change-Id: I17488c3717511dcb3f2929cdbe39565944bc76f0

4 years agoMerge "Implementation of OOB PTS cert test cases"
Treehugger Robot [Fri, 14 Aug 2020 18:23:55 +0000 (18:23 +0000)]
Merge "Implementation of OOB PTS cert test cases"

4 years agoMerge "If a LINK_KEY_REQUEST comes in without us calling CreateBond then it isn't...
Treehugger Robot [Fri, 14 Aug 2020 18:03:04 +0000 (18:03 +0000)]
Merge "If a LINK_KEY_REQUEST comes in without us calling CreateBond then it isn't explicitly triggered by the local stack."

4 years agoLogging: Rename buf and now to avoid collisions
Myles Watson [Thu, 13 Aug 2020 18:07:20 +0000 (11:07 -0700)]
Logging: Rename buf and now to avoid collisions

Test: cert/run --host
Bug: 163818400
Tag: #gd-refactor
Change-Id: I97e2c3ac912131033e128b4b788e460c8e6397cb

4 years agoConsolidate evt data initialization
Martin Brabham [Tue, 11 Aug 2020 19:43:42 +0000 (12:43 -0700)]
Consolidate evt data initialization

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

4 years agoFail fast
Martin Brabham [Tue, 11 Aug 2020 19:41:01 +0000 (12:41 -0700)]
Fail fast

When this function is called, it will set a bool true.
Later the ACL connection calls a function that checks
the bool and calls this function again now that the
remote features have been fetched.

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

4 years agoDirectly use parameter to create p_dev_rec
Martin Brabham [Tue, 11 Aug 2020 19:27:10 +0000 (12:27 -0700)]
Directly use parameter to create p_dev_rec

Bug: 162984360
Tag: #refactor
Test: compiles and devices pair and work
Change-Id: I9a777cd7a2d12c97640e22b64f77c534d4c86e28
Merged-In: I9a777cd7a2d12c97640e22b64f77c534d4c86e28

4 years agoFlatten BTIF_CORE_STORAGE_ADAPTER_READ
Zach Johnson [Fri, 14 Aug 2020 17:27:18 +0000 (10:27 -0700)]
Flatten BTIF_CORE_STORAGE_ADAPTER_READ

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

4 years agoSimplify btif_get_adapter_property
Zach Johnson [Fri, 14 Aug 2020 17:23:10 +0000 (10:23 -0700)]
Simplify btif_get_adapter_property

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

4 years agoFlatten BTIF_CORE_STORAGE_ADAPTER_READ_ALL
Zach Johnson [Fri, 14 Aug 2020 17:13:23 +0000 (10:13 -0700)]
Flatten BTIF_CORE_STORAGE_ADAPTER_READ_ALL

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

4 years agoSimplify btif_get_adapter_properties
Zach Johnson [Fri, 14 Aug 2020 17:11:14 +0000 (10:11 -0700)]
Simplify btif_get_adapter_properties

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

4 years agoFlatten BTIF_DM_CB_LE_TEST_END and remove btif_dm_generic_evt
Zach Johnson [Fri, 14 Aug 2020 16:26:45 +0000 (09:26 -0700)]
Flatten BTIF_DM_CB_LE_TEST_END and remove btif_dm_generic_evt

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

4 years agoFlatten BTIF_DM_CB_LE_(TX|RX)_TEST
Zach Johnson [Fri, 14 Aug 2020 16:20:59 +0000 (09:20 -0700)]
Flatten BTIF_DM_CB_LE_(TX|RX)_TEST

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

4 years agoFlatten BTIF_DM_CB_BOND_STATE_BONDING
Zach Johnson [Fri, 14 Aug 2020 16:12:47 +0000 (09:12 -0700)]
Flatten BTIF_DM_CB_BOND_STATE_BONDING

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

4 years agoFlatten BTIF_DM_CB_REMOVE_BOND
Zach Johnson [Fri, 14 Aug 2020 16:07:23 +0000 (09:07 -0700)]
Flatten BTIF_DM_CB_REMOVE_BOND

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

4 years agoImplementation of OOB PTS cert test cases
Jakub Pawlowski [Thu, 13 Aug 2020 22:19:34 +0000 (00:19 +0200)]
Implementation of OOB PTS cert test cases

SM/SLA/SCOB/BV-02-C
SM/SLA/SCOB/BV-03-C
SM/MAS/SCOB/BV-04-C

This patch also fixes how we wait for disconnection event. Instead of
using fixed timeout, wait for actual disconnection.

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

4 years agogd HCI: Remove on_le_set_random_address_complete
Chienyuan [Fri, 14 Aug 2020 10:00:58 +0000 (18:00 +0800)]
gd HCI: Remove on_le_set_random_address_complete

Bug: 145832107
Tag: #gd-refactor
Test: cert/run --host; manual
Change-Id: Ib63e457e2e8c882f290837d05fd3bd614ffc8c34

4 years agogd HCI: assign client_handler_ before execute queued callbacks
Chienyuan [Fri, 14 Aug 2020 09:52:42 +0000 (17:52 +0800)]
gd HCI: assign client_handler_ before execute queued callbacks

Tag: #gd-refactor
Bug: 145832107
Test: atest bluetooth_test_gd
Test: ./cert/run --host
Change-Id: Id45980cb1975fd8a893c262099e64f1cf4b65b3e

4 years agoFormalize acl API BTM_ReadPowerMode
Chris Manton [Fri, 14 Aug 2020 05:55:43 +0000 (22:55 -0700)]
Formalize acl API BTM_ReadPowerMode

Creating ACL API

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

4 years agoBecause #defines interleaved with {} is a nightmare
Chris Manton [Fri, 14 Aug 2020 05:31:58 +0000 (22:31 -0700)]
Because #defines interleaved with {} is a nightmare

Creating ACL API

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

4 years agoRemove unused return value in bta_dm_pm_sniff
Chris Manton [Fri, 14 Aug 2020 05:26:39 +0000 (22:26 -0700)]
Remove unused return value in bta_dm_pm_sniff

Unused in locally linked function

bool=>void

Creating ACL API

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

Change-Id: If4748a33567fa3e8b9980ee68d947ee45e56aad2

4 years agoPrivatize tBTM_CB::tACL_CB::btm_scn[]
Chris Manton [Thu, 13 Aug 2020 21:34:42 +0000 (14:34 -0700)]
Privatize tBTM_CB::tACL_CB::btm_scn[]

Creating ACL API

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

4 years agoPrivatize tBTM_CB::tACL_CB::btm_def_link_policy
Chris Manton [Thu, 13 Aug 2020 21:30:26 +0000 (14:30 -0700)]
Privatize tBTM_CB::tACL_CB::btm_def_link_policy

Creating ACL API

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

4 years agoPrivatize tBTM_CB::tACL_CB::pm_pend_link
Chris Manton [Thu, 13 Aug 2020 21:25:53 +0000 (14:25 -0700)]
Privatize tBTM_CB::tACL_CB::pm_pend_link

Creating ACL API

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

4 years agoPrivatize tBTM_CB::tACL_CB::btm_acl_pkt_types_supported
Chris Manton [Thu, 13 Aug 2020 21:23:32 +0000 (14:23 -0700)]
Privatize tBTM_CB::tACL_CB::btm_acl_pkt_types_supported

Creating ACL API

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

Change-Id: I23460e1ec67e68ed907f2476f3d44734ba03d87a

4 years agoPrivatize tBTM_CB::tACL_CB::acl_disc_reason
Chris Manton [Thu, 13 Aug 2020 20:31:16 +0000 (13:31 -0700)]
Privatize tBTM_CB::tACL_CB::acl_disc_reason

Creating ACL API

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

Change-Id: I521c44f45a4d4c296bc2469aac9802ad32841c4c

4 years agoPrivatize tBTM_CB::tACL_CB::tBTM_PM_MCB
Chris Manton [Thu, 13 Aug 2020 20:10:54 +0000 (13:10 -0700)]
Privatize tBTM_CB::tACL_CB::tBTM_PM_MCB

Creating ACL API

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

Change-Id: I5662d3cb641b5c76e3f0770adb2330591055a0a5

4 years agoPrivatize tBTM_CB::tACL_CB:tACL_CONN[]
Chris Manton [Thu, 13 Aug 2020 05:31:44 +0000 (22:31 -0700)]
Privatize tBTM_CB::tACL_CB:tACL_CONN[]

Creating ACL API

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

Change-Id: I1e65fe788158bd6c7a02806385c1fe69b46c7394

4 years agoPrivatize tBTM_CB::tACL_CB::btm_def_link_super_tout
Chris Manton [Thu, 13 Aug 2020 04:30:15 +0000 (21:30 -0700)]
Privatize tBTM_CB::tACL_CB::btm_def_link_super_tout

Creating ACL API

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

4 years agoUse stack/include/acl_hci_link_interface
Chris Manton [Thu, 13 Aug 2020 23:51:50 +0000 (16:51 -0700)]
Use stack/include/acl_hci_link_interface

Also shuffle inclusions from stack/include/btm_int

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

Change-Id: Ib735d920f27652091d4494db9a5a80742103c347

4 years agoAdd stack/include/acl_hci_link_interface.h
Chris Manton [Thu, 13 Aug 2020 23:10:00 +0000 (16:10 -0700)]
Add stack/include/acl_hci_link_interface.h

Prototypes for hci=>acl functions

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

4 years agoInternalize btm_handle_to_acl_index to stack/acl
Chris Manton [Thu, 13 Aug 2020 23:18:39 +0000 (16:18 -0700)]
Internalize btm_handle_to_acl_index to stack/acl

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

4 years agoMerge changes Ic219f578,Ib63dc45a
Zach Johnson [Fri, 14 Aug 2020 04:10:23 +0000 (04:10 +0000)]
Merge changes Ic219f578,Ib63dc45a

* changes:
  Remove BTIF_DM_CB_CREATE_BOND
  Remove BTIF_DM_CB_HID_REMOTE_NAME, it's never used

4 years agoMerge changes If1f09f06,Ic49bbdf4,I40d30944
Zach Johnson [Fri, 14 Aug 2020 02:03:28 +0000 (02:03 +0000)]
Merge changes If1f09f06,Ic49bbdf4,I40d30944

* changes:
  Remove BTIF_DM_CB_CREATE_BOND, it's never used
  Remove unused lines from bte_main
  l2c_link_send_to_lower always returns true

4 years agoMerge "HAL: Add ISO packet callbacks"
Treehugger Robot [Fri, 14 Aug 2020 00:52:49 +0000 (00:52 +0000)]
Merge "HAL: Add ISO packet callbacks"

4 years agoMerge "Inline stack/acl/btm_acl::btm_pm_sm_alloc"
Treehugger Robot [Fri, 14 Aug 2020 00:04:18 +0000 (00:04 +0000)]
Merge "Inline stack/acl/btm_acl::btm_pm_sm_alloc"

4 years agoMerge "Inline stack/acl/btm_acl::btm_pm_check_stored"
Treehugger Robot [Fri, 14 Aug 2020 00:01:56 +0000 (00:01 +0000)]
Merge "Inline stack/acl/btm_acl::btm_pm_check_stored"

4 years agoRemove BTIF_DM_CB_CREATE_BOND
Zach Johnson [Thu, 13 Aug 2020 23:51:53 +0000 (16:51 -0700)]
Remove BTIF_DM_CB_CREATE_BOND

go to the jni thread directly instead of
going through all the manual ceremony of
a manually defined event type & struct

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

4 years agoRemove BTIF_DM_CB_HID_REMOTE_NAME, it's never used
Zach Johnson [Thu, 13 Aug 2020 23:39:18 +0000 (16:39 -0700)]
Remove BTIF_DM_CB_HID_REMOTE_NAME, it's never used

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

4 years agoRemove BTIF_DM_CB_CREATE_BOND, it's never used
Zach Johnson [Thu, 13 Aug 2020 23:34:36 +0000 (16:34 -0700)]
Remove BTIF_DM_CB_CREATE_BOND, it's never used

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

4 years agoMerge changes I660901a4,I73ef9a97,Iccfb31fe,If8adec40,Ie379258b, ...
Zach Johnson [Thu, 13 Aug 2020 23:04:02 +0000 (23:04 +0000)]
Merge changes I660901a4,I73ef9a97,Iccfb31fe,If8adec40,Ie379258b, ...

* changes:
  Remove functions orphaned by the removal of BTM_VendorCleanup
  Remove unreachable BT(A|M)_VendorCleanup functions
  This call will never be successful
  Flatten bte_main_cleanup
  Move bte_main_cleanup call to stack_manager
  Rename bte_main_boot_entry, and pull out irrelevant module inits

4 years agoMerge changes I19bc0daf,I9e93cf4e
Zach Johnson [Thu, 13 Aug 2020 22:51:21 +0000 (22:51 +0000)]
Merge changes I19bc0daf,I9e93cf4e

* changes:
  Pull bte_main_boot_entry out of btif_init_bluetooth
  Flatten btu_free_core and remove btu_init.cc

4 years agoRemove unused lines from bte_main
Zach Johnson [Thu, 13 Aug 2020 22:46:06 +0000 (15:46 -0700)]
Remove unused lines from bte_main

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

4 years agol2c_link_send_to_lower always returns true
Zach Johnson [Thu, 13 Aug 2020 22:41:31 +0000 (15:41 -0700)]
l2c_link_send_to_lower always returns true

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

4 years agoMerge "Define appl_trace_level needed for coverage instrumentation"
Treehugger Robot [Thu, 13 Aug 2020 22:48:53 +0000 (22:48 +0000)]
Merge "Define appl_trace_level needed for coverage instrumentation"

4 years agoInline stack/acl/btm_acl::btm_pm_sm_alloc
Chris Manton [Thu, 13 Aug 2020 20:40:25 +0000 (13:40 -0700)]
Inline stack/acl/btm_acl::btm_pm_sm_alloc

Unnecessary internally linked function

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

4 years agoInline stack/acl/btm_acl::btm_pm_check_stored
Chris Manton [Thu, 13 Aug 2020 20:14:29 +0000 (13:14 -0700)]
Inline stack/acl/btm_acl::btm_pm_check_stored

Unnecessary internally linked function

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

4 years agoRemove functions orphaned by the removal of BTM_VendorCleanup
Zach Johnson [Thu, 13 Aug 2020 21:54:59 +0000 (14:54 -0700)]
Remove functions orphaned by the removal of BTM_VendorCleanup

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

4 years agoDefine appl_trace_level needed for coverage instrumentation
Pirama Arumuga Nainar [Thu, 13 Aug 2020 21:20:53 +0000 (14:20 -0700)]
Define appl_trace_level needed for coverage instrumentation

Bug: 163819563

Define appl_trace_level even though LogMsg is trivial.  This is required
when coverage is enabled because the compiler is unable to eliminate the
`if` checks against appl_trace_level in APPL_TRACE_* macros.

Test: m CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS='system/bt' \
          net_test_hf_client_add_record
Change-Id: I0455d1f95146551f77ded662da1f5d85fb245c4e

4 years agoRemove unreachable BT(A|M)_VendorCleanup functions
Zach Johnson [Thu, 13 Aug 2020 21:48:54 +0000 (14:48 -0700)]
Remove unreachable BT(A|M)_VendorCleanup functions

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

4 years agoMerge "Add stack/acl/btm_acl::acl_ble_is_role_master"
Treehugger Robot [Thu, 13 Aug 2020 21:48:29 +0000 (21:48 +0000)]
Merge "Add stack/acl/btm_acl::acl_ble_is_role_master"

4 years agoThis call will never be successful
Zach Johnson [Thu, 13 Aug 2020 21:44:37 +0000 (14:44 -0700)]
This call will never be successful

The main thread lifetime is tied to start/stop, this call is part of
cleanup which happens after stop. So this call has no effect.

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

4 years agoFlatten bte_main_cleanup
Zach Johnson [Thu, 13 Aug 2020 21:38:23 +0000 (14:38 -0700)]
Flatten bte_main_cleanup

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

4 years agoMove bte_main_cleanup call to stack_manager
Zach Johnson [Thu, 13 Aug 2020 21:35:45 +0000 (14:35 -0700)]
Move bte_main_cleanup call to stack_manager

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

4 years agoPull bte_main_boot_entry out of btif_init_bluetooth
Zach Johnson [Thu, 13 Aug 2020 21:12:07 +0000 (14:12 -0700)]
Pull bte_main_boot_entry out of btif_init_bluetooth

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

4 years agoRename bte_main_boot_entry, and pull out irrelevant module inits
Zach Johnson [Thu, 13 Aug 2020 21:16:40 +0000 (14:16 -0700)]
Rename bte_main_boot_entry, and pull out irrelevant module inits

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

4 years agoFlatten btu_free_core and remove btu_init.cc
Zach Johnson [Thu, 13 Aug 2020 20:38:10 +0000 (13:38 -0700)]
Flatten btu_free_core and remove btu_init.cc

bye

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

4 years agoMerge changes I4c3ad4ff,I798bca68,Iaeb7b227,I30f310f6
Zach Johnson [Thu, 13 Aug 2020 21:20:15 +0000 (21:20 +0000)]
Merge changes I4c3ad4ff,I798bca68,Iaeb7b227,I30f310f6

* changes:
  btu_task_shut_down -> main_thread_shut_down
  Flatten BTU_ShutDown
  Flatten bte_main_disable
  Remove btif_disable_bluetooth_evt

4 years agoMerge "gd HCI: Do not start rotate address if policy not set"
Treehugger Robot [Thu, 13 Aug 2020 20:30:11 +0000 (20:30 +0000)]
Merge "gd HCI: Do not start rotate address if policy not set"

4 years agoAdd stack/acl/btm_acl::acl_ble_is_role_master
Chris Manton [Thu, 13 Aug 2020 19:40:01 +0000 (12:40 -0700)]
Add stack/acl/btm_acl::acl_ble_is_role_master

Offending code enabled with this flag:
stack/gatt/gatt_db::BLE_DELAY_REQUEST_ENC

Bug: 164152547
Tag: #refactor
Test: Builds
Change-Id: Ib8ab9ccb1aae909d8ebd9afe39ac1e40a545731f

4 years agobtu_task_shut_down -> main_thread_shut_down
Zach Johnson [Thu, 13 Aug 2020 18:00:11 +0000 (11:00 -0700)]
btu_task_shut_down -> main_thread_shut_down

pull out unrelated code into stack manager

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

4 years agoFlatten BTU_ShutDown
Zach Johnson [Thu, 13 Aug 2020 17:55:39 +0000 (10:55 -0700)]
Flatten BTU_ShutDown

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

4 years agoFlatten bte_main_disable
Zach Johnson [Thu, 13 Aug 2020 17:45:02 +0000 (10:45 -0700)]
Flatten bte_main_disable

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

4 years agoRemove btif_disable_bluetooth_evt
Zach Johnson [Thu, 13 Aug 2020 17:38:07 +0000 (10:38 -0700)]
Remove btif_disable_bluetooth_evt

signal future where it would have been called,

and move contents into stack manager

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

4 years agoRemove some unused stuff from bta_sys.h
Zach Johnson [Thu, 13 Aug 2020 17:20:11 +0000 (10:20 -0700)]
Remove some unused stuff from bta_sys.h

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

4 years agoHAL: Add ISO packet callbacks
Myles Watson [Tue, 11 Aug 2020 12:47:40 +0000 (05:47 -0700)]
HAL: Add ISO packet callbacks

Tag: #feature
Test: cert/run --host
Bug: 163818400
Change-Id: Iec2f432f2bff35bb74f3891eb3bcd8656c4f7f16

4 years agoMerge "Revert "HAL: Add ISO packet callbacks""
Myles Watson [Thu, 13 Aug 2020 17:19:22 +0000 (17:19 +0000)]
Merge "Revert "HAL: Add ISO packet callbacks""

4 years agoRevert "HAL: Add ISO packet callbacks"
Myles Watson [Thu, 13 Aug 2020 17:15:12 +0000 (17:15 +0000)]
Revert "HAL: Add ISO packet callbacks"

This reverts commit f2d98a69c9e727807ea79a43e8b88e7a61382847.

Reason for revert: Broke the build

Bug: 164110653
Change-Id: I478509f1c51eebfc1c676594125ccbe91772ad0b

4 years agoMerge "RootCanal: Add ISO LinkLayer packets"
Treehugger Robot [Thu, 13 Aug 2020 16:24:16 +0000 (16:24 +0000)]
Merge "RootCanal: Add ISO LinkLayer packets"

4 years agoMerge "Rename acl_is_role_master to acl_br_edr_is_role_master"
Treehugger Robot [Thu, 13 Aug 2020 16:11:03 +0000 (16:11 +0000)]
Merge "Rename acl_is_role_master to acl_br_edr_is_role_master"

4 years agoMerge "GD-HCI: Implement snoop rotation and options parsing"
Treehugger Robot [Thu, 13 Aug 2020 16:08:44 +0000 (16:08 +0000)]
Merge "GD-HCI: Implement snoop rotation and options parsing"

4 years agogd HCI: Do not start rotate address if policy not set
Chienyuan [Thu, 13 Aug 2020 15:51:16 +0000 (23:51 +0800)]
gd HCI: Do not start rotate address if policy not set

Bug: 145832107
Tag: #gd-refactor
Test: cert/run --host; manual
Change-Id: I38311a43998baf464181533fbf04a4bec1f34e71

4 years agoHAL: Add ISO packet callbacks
Myles Watson [Tue, 11 Aug 2020 12:47:40 +0000 (05:47 -0700)]
HAL: Add ISO packet callbacks

Tag: #feature
Test: cert/run --host
Bug: 163818400
Change-Id: I8b446e34b0e778d4bc7e0fbf4d490705e1b561f0

4 years agoRootCanal: Add ISO LinkLayer packets
Myles Watson [Tue, 11 Aug 2020 14:50:34 +0000 (07:50 -0700)]
RootCanal: Add ISO LinkLayer packets

Tag: #feature
Test: cert/run --host
Bug: 163818400
Change-Id: I6372032ca30dabd2215173c987a8deb0f8d4ff8d

4 years agoRootCanal: Add ISO to H4 packetizer
Myles Watson [Tue, 11 Aug 2020 05:44:32 +0000 (22:44 -0700)]
RootCanal: Add ISO to H4 packetizer

Tag: #feature
Test: cert/run --host
Bug: 163818400
Change-Id: Ib818aa7cc17346b68d6d5ec895cd260e3b6537da

4 years agoRootCanal: Remove dead code
Myles Watson [Tue, 11 Aug 2020 04:40:59 +0000 (21:40 -0700)]
RootCanal: Remove dead code

Tag: #feature
Test: cert/run --host
Bug: 163818400
Change-Id: I26a1a44961865f7356663c5a0087289a3601ef8c

4 years agoGD-HCI: Implement snoop rotation and options parsing
Jack He [Wed, 12 Aug 2020 09:19:14 +0000 (02:19 -0700)]
GD-HCI: Implement snoop rotation and options parsing

* Implement btsnoop log rotation that creates a new log
  after logging 0xFFFF (65535) packets
* Implement btsnoop log mode parsing from system properties

Bug: 163733538
Test: atest bluetooth_test_gd
Tag: #gd-refactor
Change-Id: I577339bc5a6cd9f814a00916cb85099bda7b06da

4 years agoRename acl_is_role_master to acl_br_edr_is_role_master
Hansong Zhang [Thu, 13 Aug 2020 03:20:02 +0000 (20:20 -0700)]
Rename acl_is_role_master to acl_br_edr_is_role_master

Transport has to be BR_EDR

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

4 years agoBTM: Remove a dead code path
Hansong Zhang [Wed, 12 Aug 2020 23:05:05 +0000 (16:05 -0700)]
BTM: Remove a dead code path

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

4 years agoIf a LINK_KEY_REQUEST comes in without us calling CreateBond then
Martin Brabham [Thu, 13 Aug 2020 02:42:13 +0000 (19:42 -0700)]
If a LINK_KEY_REQUEST comes in without us calling CreateBond then
it isn't explicitly triggered by the local stack.

Link verification happens over EnforceSecurityPolicy and will trigger pairing locally.

So Assume LINK_KEY_REQUEST without CreateBond or EnforceSecurityPolicy to be triggered by remote

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

4 years agoHide stack/acl/acl.h
Chris Manton [Wed, 12 Aug 2020 20:42:47 +0000 (13:42 -0700)]
Hide stack/acl/acl.h

This is effectively an internal structure not to be
exposed

Working towards encapsulation of tACL_CONN

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

4 years agoUse API stack/acl/btm_acl::acl_set_peer_le_features_from_handle
Chris Manton [Wed, 12 Aug 2020 20:30:16 +0000 (13:30 -0700)]
Use API stack/acl/btm_acl::acl_set_peer_le_features_from_handle

Working towards encapsulation of tACL_CONN

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

4 years agoAdd API stack/acl/btm_acl::acl_set_peer_le_features_from_handle
Chris Manton [Wed, 12 Aug 2020 20:29:29 +0000 (13:29 -0700)]
Add API stack/acl/btm_acl::acl_set_peer_le_features_from_handle

Working towards encapsulation of tACL_CONN

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