OSDN Git Service

android-x86/system-bt.git
4 years agoCert: Add name to gd_device
Martin Brabham [Thu, 12 Mar 2020 00:55:46 +0000 (17:55 -0700)]
Cert: Add name to gd_device

Bug: 145638034
Test: ./cert/run --host
Change-Id: Ib4cb22fa582dfe503c6a0e755614291a39196c4a

4 years agoCert: Use setuptools to provision GD cert tests
Jack He [Wed, 18 Mar 2020 09:52:54 +0000 (02:52 -0700)]
Cert: Use setuptools to provision GD cert tests

* Create setup.py that implements setup() from setuptools to
  provision GD cert tests in an enviornment
* Change makefile configuration such that both GD tests and the
  latest ACTS framework is packed in the same file. This helps
  prevent version mismatch between GD cert tests and ACTS framework
* Output a single bluetooth_cert_tests.zip that include above packages
  instead of two separate ZIP archives
* Running "gd/setup.py install" will install both GD tests and ACTS
  framework and it is recommended to do this in virtual environment
* Package target binaries into generic directory name "target/" so that
  GD cert tests do no need to know the name of the product being tested
* Find GD root directory via its relative with cert library directory
  so that we do not rely on os.getcwd()
* Added two more flags to gd/cert/run to allow custom test config,
  and the ability to re-use existing virtualenv
* Generate python file must be in a files sub-directory to avoid
  packing the resultant zip archive in itself

Test: source gd/cert/run --host
Bug: 150321998
Change-Id: I34b05b0ad121c8df35207f437a0326b52a4645e2

4 years agoMerge "LeL2capTest add L2CAP/LE/CFC/BV-21-C"
Treehugger Robot [Thu, 19 Mar 2020 17:23:21 +0000 (17:23 +0000)]
Merge "LeL2capTest add L2CAP/LE/CFC/BV-21-C"

4 years agoMerge "Ignore legacy scan response event if no ADV_IND or ADV_SCAN_IND is received...
Treehugger Robot [Thu, 19 Mar 2020 13:06:40 +0000 (13:06 +0000)]
Merge "Ignore legacy scan response event if no ADV_IND or ADV_SCAN_IND is received before"

4 years agoMerge "SM: Reset fixed channel service pointer so we could continue"
Treehugger Robot [Wed, 18 Mar 2020 22:41:56 +0000 (22:41 +0000)]
Merge "SM: Reset fixed channel service pointer so we could continue"

4 years agoIgnore legacy scan response event if no ADV_IND or ADV_SCAN_IND is received before
Charles Lin [Thu, 13 Feb 2020 08:06:21 +0000 (16:06 +0800)]
Ignore legacy scan response event if no ADV_IND or ADV_SCAN_IND is received before

Test: Above Two devices start LE scan, and one device advertising
Bug: 146474336
Change-Id: I76c22705326db14df527d090151ea7bcd34615a2

4 years agoRandomize the time between rotations of BLE Random Address
Jakub Pawlowski [Tue, 17 Mar 2020 15:37:36 +0000 (16:37 +0100)]
Randomize the time between rotations of BLE Random Address

Bug: 150394435
Bug: 151485516
Change-Id: I342f3e34f12a200db0a5c3aab23efabac5626825

4 years agoAdd helper for converting between legacy and gd Address
Jakub Pawlowski [Mon, 16 Mar 2020 23:03:35 +0000 (00:03 +0100)]
Add helper for converting between legacy and gd Address

This also fixes issue where the byte order in address is reversed

Bug: 149757450
Change-Id: I5c805feb6ca6d6780533c02545c8b548f497ba6b

4 years agoMerge "Notify remote name failed for LE device"
Treehugger Robot [Wed, 18 Mar 2020 03:54:49 +0000 (03:54 +0000)]
Merge "Notify remote name failed for LE device"

4 years agoFix bugprone-use-after-move warnings
Chih-Hung Hsieh [Thu, 5 Mar 2020 23:17:42 +0000 (15:17 -0800)]
Fix bugprone-use-after-move warnings

Bug: 150783499
Test: WITH_TIDY=1 make
Change-Id: I004a4084f2d7ab1a1f2908e930a17527d3b0d0bf

4 years agoLeL2capTest add L2CAP/LE/CFC/BV-21-C
Hansong Zhang [Mon, 16 Mar 2020 19:00:27 +0000 (12:00 -0700)]
LeL2capTest add L2CAP/LE/CFC/BV-21-C

Bug: 145707677
Test: cert/run --host
Change-Id: Idb27c720510e656adffef0e805fb1fb6f3da73ff

4 years agoMerge changes I5c0eea0d,I27dcb047
Treehugger Robot [Mon, 16 Mar 2020 16:53:12 +0000 (16:53 +0000)]
Merge changes I5c0eea0d,I27dcb047

* changes:
  LeL2capTest: Get incoming packet stream for each channel
  LeL2cap Cert: Allow DUT initiate connection request

4 years agoLeL2capTest: Get incoming packet stream for each channel
Hansong Zhang [Sat, 14 Mar 2020 06:54:34 +0000 (23:54 -0700)]
LeL2capTest: Get incoming packet stream for each channel

Bug: 145707677
Test: cert/run --host
Change-Id: I5c0eea0de649609e0b431ef0d30c1e2570e51ab1

4 years agoNotify remote name failed for LE device
More Kuo [Thu, 27 Feb 2020 09:44:02 +0000 (17:44 +0800)]
Notify remote name failed for LE device

When cancel discovery for LE device in BTA_DM_DISCOVER_ACTIVE state,
there is no notification to indicate the remote name request of LE
device is cancelled and change the search state back to
BTA_DM_SEARCH_IDLE state. Call btm_inq_rmt_name_failed_cancelled()
to notify in this situation.

Bug: 146840780
Test: Manual
Change-Id: I1ed7b6ac3044f7ce19fc803f7ed5222f237fdc52

4 years agoMerge "Fix bond list mismatch between Java and native"
Treehugger Robot [Mon, 16 Mar 2020 03:19:15 +0000 (03:19 +0000)]
Merge "Fix bond list mismatch between Java and native"

4 years agoLeL2cap Cert: Allow DUT initiate connection request
Hansong Zhang [Fri, 13 Mar 2020 20:04:50 +0000 (13:04 -0700)]
LeL2cap Cert: Allow DUT initiate connection request

Add test cases for testing DUT to initiate COC connection request. Fix
some bugs with LE signalling manager and link.

Test: cert/run --host
Bug: 145707677
Change-Id: I27dcb047cecee219793ccbba3d735edc5fab4551

4 years agoL2cap Signalling manager: Fix OnCommandReject
Hansong Zhang [Sun, 15 Mar 2020 23:04:08 +0000 (16:04 -0700)]
L2cap Signalling manager: Fix OnCommandReject

Checking command_just_sent_.command_code_ !=
command_reject_view.GetCode() doesn't make sense because
command_just_sent_.command_code_ is never CommandReject, but XyzRequest,
where command_reject_view.GetCode() is always CommandReject. We
shouldn't check it here.

Bug: 145707677
Test: cert/run --host
Change-Id: I424a8f715ef49372762c6df870d9c63de3b8c597

4 years agoAdd nullptr guard to make static analyzer happy
Jakub Pawlowski [Fri, 13 Mar 2020 08:57:24 +0000 (09:57 +0100)]
Add nullptr guard to make static analyzer happy

Change-Id: I95c4954eaea0215f2da00682e4b831eafa6ad506

4 years agoMerge "LeL2cap: Add PTS test cases and allow verify from DUT"
Treehugger Robot [Fri, 13 Mar 2020 19:52:41 +0000 (19:52 +0000)]
Merge "LeL2cap: Add PTS test cases and allow verify from DUT"

4 years agoLeL2cap: Add PTS test cases and allow verify from DUT
Hansong Zhang [Thu, 12 Mar 2020 02:13:53 +0000 (19:13 -0700)]
LeL2cap: Add PTS test cases and allow verify from DUT

Bug: 145707677
Test: cert/run --host
Change-Id: I028566a37491c06bdc89864751e83844a33a894e

4 years agoMerge "Save reversed BR/EDR link key derived from LE LTK"
Treehugger Robot [Fri, 13 Mar 2020 18:04:33 +0000 (18:04 +0000)]
Merge "Save reversed BR/EDR link key derived from LE LTK"

4 years agoMerge "L2capTest ICS 2/27"
Treehugger Robot [Fri, 13 Mar 2020 17:31:22 +0000 (17:31 +0000)]
Merge "L2capTest ICS 2/27"

4 years agoL2capTest ICS 2/27
Hansong Zhang [Fri, 13 Mar 2020 07:11:07 +0000 (00:11 -0700)]
L2capTest ICS 2/27

Test: cert/run --host
Bug: 144770889
Change-Id: Ib1207d79448be85ddc2dffb2699e709f29ff5e06

4 years agoMerge "BluetoothMetricid: Add metric allocator api in java"
Chen Chen [Fri, 13 Mar 2020 17:12:08 +0000 (17:12 +0000)]
Merge "BluetoothMetricid: Add metric allocator api in java"

4 years agoSM: Ensure we cannot cancel a pairing handler twice.
Martin Brabham [Wed, 11 Mar 2020 02:39:53 +0000 (19:39 -0700)]
SM: Ensure we cannot cancel a pairing handler twice.

The callback for a ClassicPairingHandler is a OnceCallback,
so we only want Cancel to call it Once.

Bug:
Test: bluetooth_test_gd
Change-Id: I8c79b93fcce87d3f5197401ac25a5b96d1255dd7

4 years agoSM: Reset fixed channel service pointer so we could continue
Martin Brabham [Wed, 11 Mar 2020 02:36:07 +0000 (19:36 -0700)]
SM: Reset fixed channel service pointer so we could continue

Bug:
Test: bluetooth_test_gd
Change-Id: I326ee8f8206d139fadb4585a47832e2a0416dd4a

4 years agoMerge "LeL2capTest: Add COC PTS test"
Treehugger Robot [Thu, 12 Mar 2020 18:12:11 +0000 (18:12 +0000)]
Merge "LeL2capTest: Add COC PTS test"

4 years agoFix bond list mismatch between Java and native
Ugo Yu [Mon, 9 Mar 2020 06:54:14 +0000 (14:54 +0800)]
Fix bond list mismatch between Java and native

When a paired device is diconnected while authenticating, do not report
bond state change to Java since the stack does not remove the device in
this situation.

Bug: 142842685
Test: Manual
Change-Id: I308320b0c10387d1cce27f709c8b2348c14dc423

4 years agoHFP: fix collision for the outgoing and incoming connection
weichinweng [Wed, 11 Mar 2020 06:51:27 +0000 (14:51 +0800)]
HFP: fix collision for the outgoing and incoming connection

Since the HF incoming connection and the HF outgoing connection use the
same HF control block (p_scb) at the same time, the case will cause the
btif_hf_cb flag going wrong due to collision. Then it will trigger a
crash due to a check failure when executing BTA_AG_OPEN_EVT. The patch
will ignore the outgoing connection when the connection
collision is happening.

Bug: 143128949
Test: manual

Change-Id: Id5495bd3ecb1ed9e03de5bd74a61ab102604eaae

4 years agoLeL2capTest: Add COC PTS test
Hansong Zhang [Thu, 12 Mar 2020 00:13:40 +0000 (17:13 -0700)]
LeL2capTest: Add COC PTS test

Bug: 145707677
Test: cert/run --host
Change-Id: I8ddee9be99deb535dea97bbcc6cb33c83ab55266

4 years agoBluetoothMetricid: Add metric allocator api in java
Chen Chen [Thu, 5 Mar 2020 23:02:46 +0000 (15:02 -0800)]
BluetoothMetricid: Add metric allocator api in java

Bug: 142563377
Test: Manual atest AdapterServiceTest

Change-Id: I46d1c1d5bf0c8beea1f46b1024cbd5ceb9c0b562
Merged-In: I46d1c1d5bf0c8beea1f46b1024cbd5ceb9c0b562

4 years agoLeL2capTest initial commit
Hansong Zhang [Wed, 11 Mar 2020 20:18:55 +0000 (13:18 -0700)]
LeL2capTest initial commit

Test: cert/run --host
Change-Id: I7e1aea927a63fa4b84774ef213c7724bd1db2202

4 years agoMerge "PDL: Always compare size to base struct"
Treehugger Robot [Wed, 11 Mar 2020 16:56:42 +0000 (16:56 +0000)]
Merge "PDL: Always compare size to base struct"

4 years agoMerge "Clear LE cache before starting le scan or the report is skipped"
Treehugger Robot [Wed, 11 Mar 2020 16:45:52 +0000 (16:45 +0000)]
Merge "Clear LE cache before starting le scan or the report is skipped"

4 years agoPacketParser: ToString() method for PacketViews
Jakub Pawlowski [Mon, 9 Mar 2020 20:15:34 +0000 (21:15 +0100)]
PacketParser: ToString() method for PacketViews

This is a helper method that should make debugging easier.

Bug: 150669615
Test: added
Change-Id: I15aceaa6a5b7ef628bbc98d9a1ef37950ebc22a2

4 years agoL2capLe: Expose dynamic channel manager API
Hansong Zhang [Thu, 5 Mar 2020 23:16:56 +0000 (15:16 -0800)]
L2capLe: Expose dynamic channel manager API

Test: bluetooth_test_gd
Change-Id: I4c17b257bcfc517d249db30ab6f29f4b9f4df468

4 years agoFix L2capTest:test_continuation_flag
Hansong Zhang [Tue, 10 Mar 2020 20:53:20 +0000 (13:53 -0700)]
Fix L2capTest:test_continuation_flag

Test: cert/run --host
Change-Id: I8bab6d3d6f49ca5c27991e6d140b5e2710e25569

4 years agoPDL: Always compare size to base struct
Myles Watson [Tue, 10 Mar 2020 18:33:32 +0000 (11:33 -0700)]
PDL: Always compare size to base struct

Fixes: 146523920
Test: bluetooth_test_gd
Change-Id: I08f5023578ab171a99291eee5444d470370e272a

4 years agoMerge "L2CAP: Add test for L2CAP 2/2 Support of configuration process"
Treehugger Robot [Tue, 10 Mar 2020 18:33:59 +0000 (18:33 +0000)]
Merge "L2CAP: Add test for L2CAP 2/2 Support of configuration process"

4 years agoMerge "btsnoop: Fix btsnoop_net runs unexpected"
Treehugger Robot [Tue, 10 Mar 2020 16:58:48 +0000 (16:58 +0000)]
Merge "btsnoop: Fix btsnoop_net runs unexpected"

4 years agoMerge "A2DP: SBC encoding counter errata"
Treehugger Robot [Tue, 10 Mar 2020 16:36:31 +0000 (16:36 +0000)]
Merge "A2DP: SBC encoding counter errata"

4 years agoMerge "A2DP: AAC encoding counter errata"
Treehugger Robot [Tue, 10 Mar 2020 16:36:27 +0000 (16:36 +0000)]
Merge "A2DP: AAC encoding counter errata"

4 years agobtsnoop: Fix btsnoop_net runs unexpected
KimJeongYeon [Tue, 10 Mar 2020 04:00:40 +0000 (13:00 +0900)]
btsnoop: Fix btsnoop_net runs unexpected

By default, btsnoop_net was disabled using "BT_NET_DEBUG" macro.
But, it enabled actually and manages socket connection for sending
btsnoop logs. The reason was, TRUE/FALSE macro were not defined.
This fix including "bt_types.h" to work macro properly.

Test: Turn on btsnoop logging and observe btsnoop_net runs or not.

Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
4 years agoA2DP: SBC encoding counter errata
Cheney Ni [Fri, 14 Feb 2020 12:29:54 +0000 (20:29 +0800)]
A2DP: SBC encoding counter errata

When the encoder interval is 20 milliseconds per tick for {44.1 kHz /
16 bits per sample / Stereo}, there were around three microseconds shift
every tick, but would cause one SBC frame mismatched after 20 seconds.
Here try to adjust the timeline to increase the accuracy by following
methods:

1. add the remainder back to the timeline when converting the time
   period to data size.
2. change the timestamp to be presented by values in 1/10 microseconds.

Bug: 149546181
Test: manually
Change-Id: Ic42b2f331628c44aa927c7b9e35562be1fa750c7

4 years agoA2DP: AAC encoding counter errata
Cheney Ni [Thu, 13 Feb 2020 14:25:51 +0000 (22:25 +0800)]
A2DP: AAC encoding counter errata

When the encoder interval is 23 milliseconds per tick for {44.1 kHz /
16 bits per sample / Stereo}, 3 microseconds shift every tick would
cause one AAC frame mismatched after 180 seconds. Here try to adjust the
timeline to increase the accuracy by following methods:

1. add the remainder back to the timeline when converting the time
   period to data size.
2. change the timestamp to be presented by values in 1/10 microseconds.

Bug: 149546181
Test: manually
Change-Id: I16742042ba64a9355c39c0248be9208567312a9f

4 years agoMerge "Limit fuzzed L2CAP packets to 64K"
Treehugger Robot [Tue, 10 Mar 2020 01:35:54 +0000 (01:35 +0000)]
Merge "Limit fuzzed L2CAP packets to 64K"

4 years agoLimit fuzzed L2CAP packets to 64K
Myles Watson [Tue, 10 Mar 2020 00:06:10 +0000 (17:06 -0700)]
Limit fuzzed L2CAP packets to 64K

The maximum ACL packet size is 64K, so fuzzing beyond that for L2CAP
is not worthwhile.

Tested with packets smaller than the limit to verify that the
failure only occurs with packets beyond the limit.

Bug: 146869530
Test: bluetooth_gd_fuzz_test \
      clusterfuzz-testcase-minimized-bluetooth_gd_fuzz_test-5672164365697024
Change-Id: I1361fb4904d6c1a55caad63bf65c67bef0207362

4 years agoL2CAP: Add test for L2CAP 2/2 Support of configuration process
Ted Wang [Mon, 24 Feb 2020 09:57:31 +0000 (17:57 +0800)]
L2CAP: Add test for L2CAP 2/2 Support of configuration process

* Add handle for configuration request with invalid mtu option.
  Negotiate with kDefaultClassicMtu.
* Add handle for configuration response with result unacceptable
  parameters. Negotiate with no options.

* Add test case in l2cap_test:
    test_continuation_flag [L2CAP/COS/CFD/BV-01-C]
    test_configuration_negotiation_with_reject
      [L2CAP/COS/CFD/BV-02-C]
    test_send_requested_options [L2CAP/COS/CFD/BV-03-C]
    test_configuration_negotiation_with_unsupported_paremeter
      [L2CAP/COS/CFD/BV-11-C]
    test_unknow_option_response [L2CAP/COS/CFD/BV-12-C]

Bug: 149962814
Test: run_cert_facade_only.sh
Change-Id: I48a026cc203af2aa9067908b8bc419bc14e509ce

4 years agoUse GD style logging through whole stack
Jakub Pawlowski [Thu, 5 Mar 2020 20:16:10 +0000 (21:16 +0100)]
Use GD style logging through whole stack

This make it easier to copy code. Also if we ever decide to expose
legacy code to GD, having same logging format will make things easier.

Test: compilation
Change-Id: I21ac96e1be1baf4c2633372e9be38b9f4cf74199
Merged-In: I21ac96e1be1baf4c2633372e9be38b9f4cf74199

4 years agoMerge changes I44f2e73a,I1755c0c4,Iee69245a,Ie7f4e084
Treehugger Robot [Sat, 7 Mar 2020 05:10:48 +0000 (05:10 +0000)]
Merge changes I44f2e73a,I1755c0c4,Iee69245a,Ie7f4e084

* changes:
  Cert: make test setup more robust to binary failures
  Cert: use "git checkout" instead of "git co"
  Cert: Add required host libraries to test ZIP
  Cert: Handle None filter function in FilteringStream

4 years agoCert: make test setup more robust to binary failures
Jack He [Fri, 6 Mar 2020 08:19:48 +0000 (00:19 -0800)]
Cert: make test setup more robust to binary failures

* Add checks to see if a backing process or root-canal is alive
  immediately after launching them to avoid making the whole
  test stuck on a response from these dead processes
* Add methods to disable verity on test devices and push test files
  to required directories on the Android device

Bug: 150321998
Test: source gd/cert/set_up_and_run_device_cert.sh
Change-Id: I44f2e73aa88e7924c7e594faad020f8199c76994

4 years agoCert: use "git checkout" instead of "git co"
Jack He [Fri, 6 Mar 2020 08:18:51 +0000 (00:18 -0800)]
Cert: use "git checkout" instead of "git co"

* Also serach for dalvik instead of out dir

Test: source cert/set_up_and_run_device_cert.sh
Change-Id: I1755c0c46ef79ad6b92be438f2380f3be54e542c

4 years agoCert: Add required host libraries to test ZIP
Jack He [Fri, 6 Mar 2020 08:17:27 +0000 (00:17 -0800)]
Cert: Add required host libraries to test ZIP

* So that this ZIP archive contains all files we need to run a test
  in a separate environment

Bug: 150321998
Test: source cert/run --host
Change-Id: Iee69245a94adadbb551b0b6bbcdd04375787bb81

4 years agoCert: Handle None filter function in FilteringStream
Jack He [Fri, 6 Mar 2020 08:16:08 +0000 (00:16 -0800)]
Cert: Handle None filter function in FilteringStream

Test: source cert/run --host
Change-Id: Ie7f4e084494f0dad6b5b22ec75fe0e2933b361c4

4 years agoMerge "HCI: Add packet definitions from 5.2 spec part 2"
Treehugger Robot [Thu, 5 Mar 2020 23:20:12 +0000 (23:20 +0000)]
Merge "HCI: Add packet definitions from 5.2 spec part 2"

4 years agoMerge "L2capTest: Remove unused classic facade"
Treehugger Robot [Thu, 5 Mar 2020 22:27:50 +0000 (22:27 +0000)]
Merge "L2capTest: Remove unused classic facade"

4 years agoHCI: Add packet definitions from 5.2 spec part 2
Jakub Pawlowski [Thu, 5 Mar 2020 18:35:39 +0000 (19:35 +0100)]
HCI: Add packet definitions from 5.2 spec part 2

Bug: 150669615
Test: compilation
Change-Id: I3cf18b118b94fd158d5086cffcbcaef8b1a60336

4 years agoMerge "BluetoothMetrics: Implement and test metric_id_allocator and lru"
Chen Chen [Thu, 5 Mar 2020 20:58:57 +0000 (20:58 +0000)]
Merge "BluetoothMetrics: Implement and test metric_id_allocator and lru"

4 years agoL2capTest: Remove unused classic facade
Hansong Zhang [Thu, 5 Mar 2020 20:22:53 +0000 (12:22 -0800)]
L2capTest: Remove unused classic facade

Test: cert/run --host
Change-Id: Id60428b7491123de02b8dff17d28c7e2f6a6d94d

4 years agoMerge stage-aosp-master to aosp-master - DO NOT MERGE
Bill Yi [Thu, 5 Mar 2020 17:51:37 +0000 (09:51 -0800)]
Merge stage-aosp-master to aosp-master - DO NOT MERGE

Change-Id: I7a18fc2613aeb4a0a8b6d5e81b1985bfaa117540

4 years agoOS Queue and Reactor: Minor fixes
Hansong Zhang [Wed, 4 Mar 2020 21:55:09 +0000 (13:55 -0800)]
OS Queue and Reactor: Minor fixes

* When deleting EnqueueBuffer, unregister if needed
* Add a mutex to Reactor::WaitForUnregisteredReactable to prevent from
potential race
* EnqueueBuffer: Use an atomic_bool to synchronize Register/Unregister

Bug: 150174451
Test: cert/run --device
Change-Id: I7abcc2f763f8f0575dc0c67141571904c9a20136

4 years agoMerge "Cert: Unzip all cert files into the same virtual environment" am: d03c48a520
Automerger Merge Worker [Thu, 5 Mar 2020 17:28:22 +0000 (17:28 +0000)]
Merge "Cert: Unzip all cert files into the same virtual environment" am: d03c48a520

Change-Id: Iaeded4e112ad91e69ac8c040490256193bd66741

4 years agoMerge "Cert: Unzip all cert files into the same virtual environment"
Treehugger Robot [Thu, 5 Mar 2020 17:16:56 +0000 (17:16 +0000)]
Merge "Cert: Unzip all cert files into the same virtual environment"

4 years agoHCI: Add packet definitions from 5.2 spec am: 2800f01798
Automerger Merge Worker [Thu, 5 Mar 2020 14:40:24 +0000 (14:40 +0000)]
HCI: Add packet definitions from 5.2 spec am: 2800f01798

Change-Id: Ib944a6ac4c9274bd5c9db18d6fa00d8b88ea5eab

4 years agoCert: Unzip all cert files into the same virtual environment
Jack He [Thu, 5 Mar 2020 11:41:22 +0000 (03:41 -0800)]
Cert: Unzip all cert files into the same virtual environment

* All Python import must root from system/bt/gd
* Include all .py files in system/bt/gd in bluetooth_cert_test.zip
* At runtime, unzip all cert files into the same bluetooth_cert_test_env
  folder so that generated files and developer written files are
  overlayed together
* This helps avoid duplicate module problem at runtime

Bug: 150321998
Test: source cert/run --host
Change-Id: I7a8b1fe9fbccae1b1b4e8bf31a759a1c1eb7475c

4 years agoHCI: Add packet definitions from 5.2 spec
Jakub Pawlowski [Tue, 3 Mar 2020 10:31:46 +0000 (11:31 +0100)]
HCI: Add packet definitions from 5.2 spec

Bug: 150669615
Test: compilation
Change-Id: I7d7bbfa93fd0f3df3c4df35881ab53f3a6ea9c51

4 years agoFix L2CAP Cert and AclManagerFacade am: 5b735ba9d4
Automerger Merge Worker [Thu, 5 Mar 2020 02:37:22 +0000 (02:37 +0000)]
Fix L2CAP Cert and AclManagerFacade am: 5b735ba9d4

Change-Id: I73665cb46e8a8844fcb7b4a39957bfc5dc72aef4

4 years agoFix on device L2capTest am: 6d0c1f93a5
Automerger Merge Worker [Thu, 5 Mar 2020 02:37:20 +0000 (02:37 +0000)]
Fix on device L2capTest am: 6d0c1f93a5

Change-Id: Ibf0a696bd3544372909383f880d24e430ecbec3a

4 years agoHCI: Synchronize ACL Queue am: b708a906f3
Automerger Merge Worker [Thu, 5 Mar 2020 01:00:05 +0000 (01:00 +0000)]
HCI: Synchronize ACL Queue am: b708a906f3

Change-Id: I83d72c5e88f455d780deb030b6cf45641f07eaf4

4 years agoFix L2CAP Cert and AclManagerFacade
Hansong Zhang [Wed, 4 Mar 2020 23:03:26 +0000 (15:03 -0800)]
Fix L2CAP Cert and AclManagerFacade

* Store RetransmissionAndFlowControlMode from remote config request
* Send correct config request from cert
* SendAclPacket: Hold lock until packet has been dequeued to avoid
  double RegisterEnqueue

Test: cert/run --device
Bug: 150174451
Change-Id: I2c31f336a19d4a3e1e05efb56c20b9e4dbdd98a7

4 years agoFix on device L2capTest
Hansong Zhang [Wed, 4 Mar 2020 21:57:03 +0000 (13:57 -0800)]
Fix on device L2capTest

* Synchronize between Queue callback context and module handler context
* Synchronize between Stop() and Queue callback context
* Fix DataPipelineManager channel registration logic with
  SignallingManager

Bug: 150174451
Test: cert/run --device
Change-Id: If58dcb5b0cc400f9c9ed1bbc6ec2c01de52789b2

4 years agoHCI: Synchronize ACL Queue
Hansong Zhang [Wed, 4 Mar 2020 21:52:20 +0000 (13:52 -0800)]
HCI: Synchronize ACL Queue

* Synchronize Queue registration with Module Handler and Stop()
* Synchronize UnregisterCompletedAclPacketsCallback() as this is invoked
  during Stop()
* Add a timeout in AclManagerFacade to prevent from deadlock

Bug: 150174451
Test: cert/run --device
Change-Id: I3a476af54aaa57e25a7fd51089b44954ae574dc6

4 years agoMinor improvements to Module, Reactor, StackManager am: 25ab0d1206
Automerger Merge Worker [Wed, 4 Mar 2020 21:24:25 +0000 (21:24 +0000)]
Minor improvements to Module, Reactor, StackManager am: 25ab0d1206

Change-Id: Iadc2bd7a1826cae5c808cd8e3c65b12beb4cedee

4 years agoFix NeighborTest am: 7ff79a3e50
Automerger Merge Worker [Wed, 4 Mar 2020 21:24:09 +0000 (21:24 +0000)]
Fix NeighborTest am: 7ff79a3e50

Change-Id: Id4d0978e1cfd5587f120c6f7615874fec5463dcc

4 years agoMinor improvements to Module, Reactor, StackManager
Hansong Zhang [Tue, 3 Mar 2020 23:05:34 +0000 (15:05 -0800)]
Minor improvements to Module, Reactor, StackManager

Add some logs. Fix the timeout in StackManager because some systems are
slow.

Test: bluetooth_test_gd
Change-Id: Idd3f0b14fd66dde250eadc84c1d5cad10664154d

4 years agoFix NeighborTest
Hansong Zhang [Tue, 3 Mar 2020 23:01:34 +0000 (15:01 -0800)]
Fix NeighborTest

Test: cert/run --host
Change-Id: I2c7296817e95cc2711360f310515afb1d4f7d909

4 years agoBluetoothMetrics: Implement and test metric_id_allocator and lru
Chen Chen [Thu, 20 Feb 2020 19:29:42 +0000 (11:29 -0800)]
BluetoothMetrics: Implement and test metric_id_allocator and lru

Test: run atest on unittests
Bug: 142563377

Change-Id: I05739258479a67d47550a6cb1db1c6f8c1ff3e98

4 years agoMerge "Cert: Do not use ANDROID_ build environment variables in test" am: e9c391e7b8
Automerger Merge Worker [Wed, 4 Mar 2020 05:25:03 +0000 (05:25 +0000)]
Merge "Cert: Do not use ANDROID_ build environment variables in test" am: e9c391e7b8

Change-Id: I861b9ad8f674d45feb1071444fcb4458cae41365

4 years agoMerge "Cert: Do not use ANDROID_ build environment variables in test"
Treehugger Robot [Wed, 4 Mar 2020 05:11:36 +0000 (05:11 +0000)]
Merge "Cert: Do not use ANDROID_ build environment variables in test"

4 years agoMerge changes I099e53e6,Icab0e0d7,Ic8b73158,I989b35eb,Ie3bf7c90, ... am: cc80ee299b
Automerger Merge Worker [Wed, 4 Mar 2020 01:05:17 +0000 (01:05 +0000)]
Merge changes I099e53e6,Icab0e0d7,Ic8b73158,I989b35eb,Ie3bf7c90, ... am: cc80ee299b

Change-Id: I72adfd873b9794c41ac5f3c3ef21c8a892617df4

4 years agoMerge changes I099e53e6,Icab0e0d7,Ic8b73158,I989b35eb,Ie3bf7c90, ...
Zach Johnson [Wed, 4 Mar 2020 00:54:11 +0000 (00:54 +0000)]
Merge changes I099e53e6,Icab0e0d7,Ic8b73158,I989b35eb,Ie3bf7c90, ...

* changes:
  Assorted cleanup
  Simplify disconnect for cert channels
  Simplify sending information requests
  Add information response matchers
  Move dut & cert channels into return result
  Use multi-match in a few places where it makes sense
  Add function to send s_frames & clean up sending
  Rename L2capMatchers.InformationFrame & SupervisoryFrame
  Distingiush between validated and unvalidated channels open
  Simplify channel open, so it can fit on one line
  Migrate i frame sending into CertL2cap
  Start migrating to channel abstractions
  Make ertm & fcs separable, reduce redundant code
  Add function to simplify sending control packets

4 years agoCert: Do not use ANDROID_ build environment variables in test
Jack He [Tue, 3 Mar 2020 23:39:37 +0000 (15:39 -0800)]
Cert: Do not use ANDROID_ build environment variables in test

* Various environment variables should come from the build artifacts
  instead of the running environment.
* Hence getting rid of varioud usage of ANDROID_* variables in test
  files and figure them out through build artifacts
* Generate environment_provider.py at build time to provide
  build specific variables to the test at run time

Test: source cert/run
Bug: 150321998
Change-Id: I783c3784ad6018cb807a46701675fa5307e39175

4 years agoQueue: Wait for unregistration if on different thread am: 4813536675
Automerger Merge Worker [Tue, 3 Mar 2020 23:33:00 +0000 (23:33 +0000)]
Queue: Wait for unregistration if on different thread am: 4813536675

Change-Id: Iee6c21432077bcd345723efdbe59432fbac88db6

4 years agoAssorted cleanup
Zach Johnson [Tue, 3 Mar 2020 21:54:34 +0000 (13:54 -0800)]
Assorted cleanup

Hide methods that are only used internally, remove unused ones, etc.

Test: cert/run --host --test_filter=L2capTest
Change-Id: I099e53e6b9f1d229fdc1ee14b30d66e27c2c7a09

4 years agoSimplify disconnect for cert channels
Zach Johnson [Tue, 3 Mar 2020 21:45:58 +0000 (13:45 -0800)]
Simplify disconnect for cert channels

Test: cert/run --host --test_filter=L2capTest
Change-Id: Icab0e0d7e356ae228c3125e452c93ad057be6074

4 years agoSimplify sending information requests
Zach Johnson [Tue, 3 Mar 2020 21:31:01 +0000 (13:31 -0800)]
Simplify sending information requests

Test: cert/run --host --test_filter=L2capTest
Change-Id: Ic8b731582ad2087922c18c06ad40e0319ae80b99

4 years agoAdd information response matchers
Zach Johnson [Tue, 3 Mar 2020 20:43:04 +0000 (12:43 -0800)]
Add information response matchers

Test: cert/run --host --test_filter=L2capTest
Change-Id: I989b35eb6ed05f1d845d332e238a44eb136f966a

4 years agoMove dut & cert channels into return result
Zach Johnson [Tue, 3 Mar 2020 19:59:43 +0000 (11:59 -0800)]
Move dut & cert channels into return result

Simplfies access in tests (no self. prefix) and
is also less like global variables.

Test: cert/run --host --test_filter=L2capTest
Change-Id: Ie3bf7c9039a6018f16a587dab542b3d8f88781cc

4 years agoUse multi-match in a few places where it makes sense
Zach Johnson [Tue, 3 Mar 2020 19:36:07 +0000 (11:36 -0800)]
Use multi-match in a few places where it makes sense

Test: cert/run --host --test_filter=L2capTest
Change-Id: I8fa955ef15c36d8b3c91c9a7d97289741d08fa96

4 years agoAdd function to send s_frames & clean up sending
Zach Johnson [Tue, 3 Mar 2020 19:25:37 +0000 (11:25 -0800)]
Add function to send s_frames & clean up sending

Test: cert/run --host --test_filter=L2capTest
Change-Id: I3bc7d2f0489a8a99febbc7bf746f355a2c77223d

4 years agoRename L2capMatchers.InformationFrame & SupervisoryFrame
Zach Johnson [Tue, 3 Mar 2020 19:02:26 +0000 (11:02 -0800)]
Rename L2capMatchers.InformationFrame & SupervisoryFrame

Use IFrame and SFrame, to match the sending functions on channel
Test: cert/run --host --test_filter=L2capTest

Change-Id: I4d75e59b570a32ad2d8005a1365156025b2f4416

4 years agoDistingiush between validated and unvalidated channels open
Zach Johnson [Tue, 3 Mar 2020 18:55:08 +0000 (10:55 -0800)]
Distingiush between validated and unvalidated channels open

Since the common case is a validated channel, push the response
validation into _open_channel so we don't need to repeat it
in the test function.

Create _open_unvalidated_channel, so tests that need to do
custom validation off the common path can do so.

Test: cert/run --host --test_filter=L2capTest
Change-Id: Ic4c7d74109c23486e0862b7eca38f62cb8469228

4 years agoFix RepeatingAlarmTest am: b0e3826ac4
Automerger Merge Worker [Tue, 3 Mar 2020 21:37:03 +0000 (21:37 +0000)]
Fix RepeatingAlarmTest am: b0e3826ac4

Change-Id: Ib3a6ea5594602feffbc4590d21c55b4dc82c2e22

4 years agoQueue: Wait for unregistration if on different thread
Hansong Zhang [Tue, 3 Mar 2020 20:43:23 +0000 (12:43 -0800)]
Queue: Wait for unregistration if on different thread

Before Queue object is deleted, we must make sure that the enqueue or
dequeue callback isn't executing. If on same thread, callbacks are
synchronized. If on different thread, we must wait for unregistration to
synchronize callbacks.

Test: bluetooth_test_gd
Bug: 150174451
Change-Id: Id3c980aa0bf7bd9fa10c33c5cca3751df38f7d97

4 years agoFix RepeatingAlarmTest
Hansong Zhang [Tue, 3 Mar 2020 21:02:03 +0000 (13:02 -0800)]
Fix RepeatingAlarmTest

We may not be cancel the alarm within 1 millisecond for some machine.
Make it a bit longer.

Test: bluetooth_test_gd
Change-Id: Ia0eae89b8022d41281db55c152dbb748332f2dee

4 years agoSimplify channel open, so it can fit on one line
Zach Johnson [Tue, 3 Mar 2020 18:22:42 +0000 (10:22 -0800)]
Simplify channel open, so it can fit on one line

Test: cert/run --host --test_filter=L2capTest
Change-Id: I377a313008465b725991433158e5c828c8568cf3

4 years agoMigrate i frame sending into CertL2cap
Zach Johnson [Tue, 3 Mar 2020 17:32:01 +0000 (09:32 -0800)]
Migrate i frame sending into CertL2cap

Test: cert/run --host --test_filter=L2capTest
Change-Id: I4af9e1576741b77d8cd24aa4852ee868660be688

4 years agoMerge "Start CertL2cap, an abstraction to make L2cap testing simpler" am: a9017fae2b
Automerger Merge Worker [Tue, 3 Mar 2020 17:14:18 +0000 (17:14 +0000)]
Merge "Start CertL2cap, an abstraction to make L2cap testing simpler" am: a9017fae2b

Change-Id: I3390b0353ab77967be2eb854f007fa4f6d41e052

4 years agoMerge "Start CertL2cap, an abstraction to make L2cap testing simpler"
Treehugger Robot [Tue, 3 Mar 2020 17:05:41 +0000 (17:05 +0000)]
Merge "Start CertL2cap, an abstraction to make L2cap testing simpler"

4 years agoMerge "SecurityModule: Restructure L2CAP connections" am: 5f7aca01ef
Automerger Merge Worker [Tue, 3 Mar 2020 08:03:37 +0000 (08:03 +0000)]
Merge "SecurityModule: Restructure L2CAP connections" am: 5f7aca01ef

Change-Id: I2b931ac4509299b3a048565edd8471ab81b16034