OSDN Git Service

android-x86/system-bt.git
4 years agoNeighbor: Test remote name
Myles Watson [Tue, 4 Feb 2020 14:26:21 +0000 (06:26 -0800)]
Neighbor: Test remote name

Bug: 145638034
Test: ./cert/run_cert_facade_only.sh
Change-Id: I3f56057573d2646ce44ed2a57019fef97a1e392b

4 years agoRootCanal: Use a copied vector for SetName
Myles Watson [Tue, 4 Feb 2020 20:14:20 +0000 (12:14 -0800)]
RootCanal: Use a copied vector for SetName

Bug: 145638034
Test: ./cert/run_cert_facade_only.sh
Change-Id: Ie0d423a9fa7a8d41d1fa87820d7b83c86f84d536

4 years agoDevice cert: set up device in test script
Hansong Zhang [Tue, 4 Feb 2020 18:16:15 +0000 (10:16 -0800)]
Device cert: set up device in test script

Currently users have to set up the device with adb shell commands
manually. Move it to test script instead.

Test: cert/run_cert_facade_only.sh and run_device_cert.sh
Bug: 148147248
Change-Id: Id475bd550a46e8cd11ade0b72a5cb4032f55980e

4 years agoMerge "HCI: Modify SimplePairingDebugMode base class"
Treehugger Robot [Tue, 4 Feb 2020 19:02:31 +0000 (19:02 +0000)]
Merge "HCI: Modify SimplePairingDebugMode base class"

4 years agoMerge "ACL: Add functions for remote version information"
Treehugger Robot [Tue, 4 Feb 2020 18:51:42 +0000 (18:51 +0000)]
Merge "ACL: Add functions for remote version information"

4 years agoMerge "DirectHciTest: Always listen to CONNECTION_PACKET_TYPE_CHANGED"
Treehugger Robot [Tue, 4 Feb 2020 18:31:11 +0000 (18:31 +0000)]
Merge "DirectHciTest: Always listen to CONNECTION_PACKET_TYPE_CHANGED"

4 years agoACL: Add functions for remote version information
Martin Brabham [Tue, 4 Feb 2020 17:33:53 +0000 (09:33 -0800)]
ACL: Add functions for remote version information

Bug: 145638034
Test: bluetooth_test_gd
Change-Id: Ib2458e10737b244123bed14b3c5c96685505e9eb

4 years agoHCI: Modify SimplePairingDebugMode base class
Martin Brabham [Tue, 4 Feb 2020 17:26:22 +0000 (09:26 -0800)]
HCI: Modify SimplePairingDebugMode base class

Bug: 145638034
Test: manual; builds
Change-Id: Ia3f7ae0549f6e6e89bc924cea92c861c3da08439

4 years agoHCI: Add features notification to security i/f
Myles Watson [Tue, 4 Feb 2020 12:37:40 +0000 (04:37 -0800)]
HCI: Add features notification to security i/f

Bug: 145638034
Test: ./cert/run_cert_facade_only.sh
Change-Id: I91cde70c1c3b83fd9e7ba019367f8d112773d44d

4 years agoRootCanal: Send SimplePairingComplete on success
Myles Watson [Tue, 4 Feb 2020 12:38:15 +0000 (04:38 -0800)]
RootCanal: Send SimplePairingComplete on success

Send SimplePairingComplete after sending keys and before
authentication.

Bug: 145638034
Test: ./cert/run_cert_facade_only.sh
Change-Id: I9a262001b111c2caaae6c48413b2d836fdfaefae

4 years agoMerge "Propagate connection failures to client"
Treehugger Robot [Tue, 4 Feb 2020 03:57:40 +0000 (03:57 +0000)]
Merge "Propagate connection failures to client"

4 years agoMerge "Add gd shim l2cap unit test"
Treehugger Robot [Tue, 4 Feb 2020 03:37:19 +0000 (03:37 +0000)]
Merge "Add gd shim l2cap unit test"

4 years agoMerge "Gracefully handle startup timer expiry"
Treehugger Robot [Tue, 4 Feb 2020 02:43:49 +0000 (02:43 +0000)]
Merge "Gracefully handle startup timer expiry"

4 years agoPropagate connection failures to client
Chris Manton [Fri, 31 Jan 2020 19:48:16 +0000 (11:48 -0800)]
Propagate connection failures to client

Bug: 146086425
Test: bluetooth_test_gd

Change-Id: I0efa1084ca89c3fc34ef117e7c9c6da2ef62c04b

4 years agoDirectHciTest: Always listen to CONNECTION_PACKET_TYPE_CHANGED
Hansong Zhang [Mon, 3 Feb 2020 23:20:41 +0000 (15:20 -0800)]
DirectHciTest: Always listen to CONNECTION_PACKET_TYPE_CHANGED

Test: run_cert_facade_only.sh
Change-Id: I70a0ce92c52358b532c90139f15f237b25a03796

4 years agoAdd IsRpa and IsRpaThatMatchesIrk into AddressWithType
Jakub Pawlowski [Mon, 3 Feb 2020 23:12:09 +0000 (00:12 +0100)]
Add IsRpa and IsRpaThatMatchesIrk into AddressWithType

Test: added unittests
Bug: 142341141
Change-Id: I0fc939317cf83793d2496780fab5ebdc05b76ba3

4 years agoAdd gd shim l2cap unit test
Chris Manton [Thu, 30 Jan 2020 01:10:14 +0000 (17:10 -0800)]
Add gd shim l2cap unit test

Bug: 141758481
Test: bluetooth_test_gd
Change-Id: I7ba26676a3e91f98f5d5d148422e51e737fc62f2

4 years agoMerge "SecurityManager::CreateBondLe"
Treehugger Robot [Mon, 3 Feb 2020 21:09:09 +0000 (21:09 +0000)]
Merge "SecurityManager::CreateBondLe"

4 years agoSecurityManager::CreateBondLe
Jakub Pawlowski [Mon, 3 Feb 2020 17:42:00 +0000 (18:42 +0100)]
SecurityManager::CreateBondLe

This is stub to be implemented in the future. It is however wired to the
shim, and will get called when GD is running.

Bug: 142341141
Test: Attempt to bond with LE device, verify log is printed.
Change-Id: I7170ddb65fdd18af310ea180bb554439e884f3b7

4 years agoGracefully handle startup timer expiry
Ugo Yu [Mon, 3 Feb 2020 12:37:17 +0000 (20:37 +0800)]
Gracefully handle startup timer expiry

* Close HCI when startup timer has expired as a signal of error to
  the Bluetooth HAL.
* Do not handle H/W error event if the stack has already received
  root inflammtion event.
* Correctly handle initializeComplete callback after receives a root
  inflammation event.

Bug: 144572644
Test: Manual
Change-Id: Ic165ff1340bcada5d71668ac76e71ef67f2643fd

4 years agoMerge "Move EventAsserts close to with statements"
Treehugger Robot [Sun, 2 Feb 2020 02:21:24 +0000 (02:21 +0000)]
Merge "Move EventAsserts close to with statements"

4 years agoMerge "Add removeActiveDevice to IBluetooth.aidl"
Treehugger Robot [Sat, 1 Feb 2020 23:27:10 +0000 (23:27 +0000)]
Merge "Add removeActiveDevice to IBluetooth.aidl"

4 years agoMerge "gd: Fix reactor race condition"
Treehugger Robot [Sat, 1 Feb 2020 07:04:24 +0000 (07:04 +0000)]
Merge "gd: Fix reactor race condition"

4 years agogd: Fix reactor race condition
Chris Manton [Sat, 1 Feb 2020 02:38:36 +0000 (18:38 -0800)]
gd: Fix reactor race condition

If one thread is in Unregister() while another is
in Run(), there is a very small window where
the reactor lock drops allowing Unregister()
to think the reactable is not running, but it is.  So
then the reactable is deleted underneath the Run()
thread and crashy ensues.

Bug: 148703760
Test: bluetooth_test_gd --gtest_filter=L2capClassicLinkTest.* --gtest_repeat=1000000
Change-Id: I11535fdcda2102102e6e9e23baecd5465549c723

4 years agoMove EventAsserts close to with statements
Myles Watson [Thu, 30 Jan 2020 00:51:57 +0000 (16:51 -0800)]
Move EventAsserts close to with statements

Bug: 148096951
Test: ./cert/run_cert_facade_only.sh
Change-Id: Icb9c6d4b555f80ad434824695b76e5a03c36021d

4 years agoAdd removeActiveDevice to IBluetooth.aidl
Rahul Sabnis [Fri, 31 Jan 2020 01:02:17 +0000 (17:02 -0800)]
Add removeActiveDevice to IBluetooth.aidl

Bug: 147428526
Test: Manual
Change-Id: I4f8e526d8f4924841f1d29aed101915ad6d97df0

4 years agoAdd missing .so to dist
Hansong Zhang [Thu, 30 Jan 2020 19:27:28 +0000 (11:27 -0800)]
Add missing .so to dist

Test: m dist bluetooth_stack_with_facade
Bug: 148147248
Change-Id: I504acb08d3ef6d415901bd9e42458116faae30ad

4 years agoMerge "LE Legacy Pairing fixes"
Treehugger Robot [Thu, 30 Jan 2020 02:19:01 +0000 (02:19 +0000)]
Merge "LE Legacy Pairing fixes"

4 years agoMerge "Add new function getMostRecentlyConnectedDevices to IBluetooth.aidl"
Treehugger Robot [Wed, 29 Jan 2020 23:44:36 +0000 (23:44 +0000)]
Merge "Add new function getMostRecentlyConnectedDevices to IBluetooth.aidl"

4 years agoLE Legacy Pairing fixes
Jakub Pawlowski [Wed, 29 Jan 2020 21:19:24 +0000 (22:19 +0100)]
LE Legacy Pairing fixes

This patch fixes issues found during tests against real devices

Test: Pair with android TV remote, security key
Bug: 142341141
Change-Id: I2fb15c97f4e60710fa986762576211e4048d5271

4 years agoAdd new function getMostRecentlyConnectedDevices to IBluetooth.aidl
Rahul Sabnis [Wed, 29 Jan 2020 19:57:39 +0000 (11:57 -0800)]
Add new function getMostRecentlyConnectedDevices to IBluetooth.aidl

Bug: 130984590
Test: Manual
Change-Id: I1a921ad1ba2d21c1f8ccd668ea01a5a59eb82e31

4 years agoLE Pairing Handler improvements and fixes
Jakub Pawlowski [Wed, 29 Jan 2020 11:50:56 +0000 (12:50 +0100)]
LE Pairing Handler improvements and fixes

* improve logging for easier debugging
* fix AuthReq bitmasks
* distribute proper keys in secure connections mode
* return on encryption change failures

Bug: 142341141
Test: manual testing against Pixel phone
Change-Id: I27106e05cae22f669e39eb961daeab7c0a065135

4 years agoShow warning on invalid data frame in Basic mode
Jakub Pawlowski [Wed, 29 Jan 2020 12:58:15 +0000 (13:58 +0100)]
Show warning on invalid data frame in Basic mode

Change-Id: Ib8e81aa4ed82b6bae4371d6354c7a0f2d87fdcd1

4 years agoMerge "Add ATT stub to prevent stack from crashing"
Jakub Pawlowski [Wed, 29 Jan 2020 11:15:14 +0000 (11:15 +0000)]
Merge "Add ATT stub to prevent stack from crashing"

4 years agoMerge "L2CAP socket: Stop L2CAP server by ID instead of PSM"
Treehugger Robot [Wed, 29 Jan 2020 02:17:40 +0000 (02:17 +0000)]
Merge "L2CAP socket: Stop L2CAP server by ID instead of PSM"

4 years agoL2CAP socket: Stop L2CAP server by ID instead of PSM
Jack He [Tue, 28 Jan 2020 03:33:45 +0000 (19:33 -0800)]
L2CAP socket: Stop L2CAP server by ID instead of PSM

* There could be multiple L2CAP socket control blocks with the same PSM
* The unique identifier for a L2CAP socket control block should be the
  unique ID allocated during control block initialization
* Use this ID to track L2CAP socket control block instead of PSM ensure
  that we close the correct socket
* Reset GAP handle and L2CAP socket ID to 0 when calling
  bta_jv_free_l2c_cb() so that disconnected L2CAP control blocks does
  not count

Test: CtsVerifier
Bug: 147997447
Bug: 144148429
Change-Id: Ideb428bc73aa0b36b8deb20fac280e44c8fe7db1

4 years agoCert: Set default log_path_base
Hansong Zhang [Tue, 28 Jan 2020 23:29:40 +0000 (15:29 -0800)]
Cert: Set default log_path_base

If ACTS failed to set configs.log_path, use /tmp/logs

Test: cert/run_cert_facade_only.sh
Change-Id: If3ddc15dc04fedcb23e87ff45c2bf81f537fa11a

4 years agoAdd ATT stub to prevent stack from crashing
Jakub Pawlowski [Tue, 28 Jan 2020 15:53:20 +0000 (16:53 +0100)]
Add ATT stub to prevent stack from crashing

Bug: 142341141
Test: Connect to LE device, verify no crash happen when ATT packet is
      received
Change-Id: Ia5e0352288565cd578fd163fe821b4d779ed762a

4 years agoReduce logspam in AclManager
Jakub Pawlowski [Mon, 27 Jan 2020 15:21:12 +0000 (16:21 +0100)]
Reduce logspam in AclManager

Bug: 142341141
Test: receive long packet, verify next received packet doesn't print out
      "Dropping invalid packet" line.
Change-Id: I5bd2ecf4200ec030a26d0313a528ff51531d6688

4 years agoMerge "Move compiled grpc py to dist"
Treehugger Robot [Tue, 28 Jan 2020 03:28:32 +0000 (03:28 +0000)]
Merge "Move compiled grpc py to dist"

4 years agoL2CAP Socket: Keep track of last allocated socket ID
Jack He [Tue, 28 Jan 2020 01:09:17 +0000 (17:09 -0800)]
L2CAP Socket: Keep track of last allocated socket ID

* Keep track of last allocated socket ID in L2CAP socket stack
* Use last_sock_id + 1 as new IDs when allocating new socket blocks
* The de-dupe and overflow detection mechanism in btsock_l2cap_alloc_l()
  would handle the uint32_t overflow and duplicate ID cases

Test: CtsBluetoothTestCases
Bug: 144148429
Change-Id: Ieb9791ffa34eef919a32e4aff6f4b514859c69c0

4 years agoMove compiled grpc py to dist
Hansong Zhang [Tue, 28 Jan 2020 00:49:29 +0000 (16:49 -0800)]
Move compiled grpc py to dist

Currently we are using intermediate directory, which is unreliable.
Instead, zip all generated files and move it to dist target.

Add dist directory to temporary Python path, and run cert.

Bug: 148147248
Test: cert/run_cert.sh, cert/run_cert_facade_only.sh
Change-Id: I7daeb12247e3474ca4a4e20e94c20a7b83a21fad

4 years agoMerge "gd: Register close callback prior to channel acquire"
Treehugger Robot [Mon, 27 Jan 2020 22:20:57 +0000 (22:20 +0000)]
Merge "gd: Register close callback prior to channel acquire"

4 years agoMerge "Remove unused HCI cert"
Treehugger Robot [Mon, 27 Jan 2020 21:52:30 +0000 (21:52 +0000)]
Merge "Remove unused HCI cert"

4 years agoMerge "Improve cert set up"
Treehugger Robot [Mon, 27 Jan 2020 21:31:16 +0000 (21:31 +0000)]
Merge "Improve cert set up"

4 years agoRemove unused HCI cert
Hansong Zhang [Fri, 24 Jan 2020 23:11:46 +0000 (15:11 -0800)]
Remove unused HCI cert

Test: cert/run_cert.sh
Change-Id: I48ce5068ea6f41b053ea5ac2be0441fbd44bca88

4 years agogd: Register close callback prior to channel acquire
Chris Manton [Mon, 27 Jan 2020 18:21:40 +0000 (10:21 -0800)]
gd: Register close callback prior to channel acquire

The underlying implementation enforces this with ASSERT

Bug: 144170448
Test: CtsVerifier HID host test
Change-Id: I65e023e4a523deb9a8aa8edd41a3592a600ffb8e

4 years agoImprove cert set up
Hansong Zhang [Fri, 24 Jan 2020 22:40:41 +0000 (14:40 -0800)]
Improve cert set up

Test: cert/run_cert.sh and cert/run_cert_facade_only.sh
Bug: 148147248
Change-Id: Ie8bddde7a7fe3b8c7f213be254645549115ec866

4 years agogd: Remove using directive from shim header file
Chris Manton [Mon, 27 Jan 2020 17:51:54 +0000 (09:51 -0800)]
gd: Remove using directive from shim header file

Bug:144170448
Test: bluetooth_test_legacy

Change-Id: I2c94aa18d4a993bbf5a198ae1a39e8065dc599c6

4 years agogd: Refactor how psms are un/registered in shim
Chris Manton [Fri, 24 Jan 2020 22:13:33 +0000 (14:13 -0800)]
gd: Refactor how psms are un/registered in shim

Bug:144170448
Test: CtsVerifier install/remove verifier PSM services

Change-Id: I3849bb60c308cf9a7cda56aec8978e9ede3f3787

4 years agoCert: Append to Python path in command only
Hansong Zhang [Fri, 24 Jan 2020 22:17:05 +0000 (14:17 -0800)]
Cert: Append to Python path in command only

Test: cert/run_cert.sh and cert/run_cert_facade_only.sh
Bug: 148147248
Change-Id: I828d6d38d1338a730b303ebf090c6b7706211371

4 years agoAdd bluetooth_packets_python3 and proto to zip
Hansong Zhang [Fri, 24 Jan 2020 21:40:32 +0000 (13:40 -0800)]
Add bluetooth_packets_python3 and proto to zip

Bug: 148147248
Test: make
Change-Id: I981b1a171538ab5ff47ac59a6bfda0472b8cbe69

4 years agoMerge "gd shim l2cap_test"
Treehugger Robot [Fri, 24 Jan 2020 20:17:06 +0000 (20:17 +0000)]
Merge "gd shim l2cap_test"

4 years agogd shim l2cap_test
Chris Manton [Thu, 23 Jan 2020 00:34:35 +0000 (16:34 -0800)]
gd shim l2cap_test

Also avoid holding a memory in unique_ptr

Bug: 146086425
Test: bluetooth_test_gd

Change-Id: I23ac9eaced5f2426b26cd7fb0d041adf578315d0

4 years agoAdd device artifacts to bluetooth_cert_test.zip
Hansong Zhang [Fri, 24 Jan 2020 18:10:10 +0000 (10:10 -0800)]
Add device artifacts to bluetooth_cert_test.zip

Test: m dist bluetooth_stack_with_facade
Change-Id: I08d722e21300c8a3bfcb393c3a9ec1cefe22d8e2

4 years agoAdd required binaries to zip file
Hansong Zhang [Thu, 23 Jan 2020 21:44:33 +0000 (13:44 -0800)]
Add required binaries to zip file

Bug: 148147248
Test: build
Change-Id: I87b96b05975ae9e66fb1fd78d185f911b809706c

4 years agoUse bluetooth_stack_with_facade as dist target
Hansong Zhang [Wed, 22 Jan 2020 00:03:53 +0000 (16:03 -0800)]
Use bluetooth_stack_with_facade as dist target

And let bluetooth_stack_with_facade require root-canal

Test: m dist bluetooth_stack_with_facade -j50
Bug: 148147248
Change-Id: I6b4651042cb6bb5769d96575ac61a8f192381d3c

4 years agoSecurityModule: Add callbacks to your callbacks
Martin Brabham [Thu, 16 Jan 2020 19:18:42 +0000 (11:18 -0800)]
SecurityModule: Add callbacks to your callbacks

Add an argument to the external callback signature in order
to allow external caller to input user responses.

Bug: 139137147
Test: ./out/host/linux-x86/nativetest64/bluetooth_test_gd/bluetooth_test_gd --gtest_filter=ClassicPairing*
Change-Id: Ib827991dd2827ec0bad0206192387ad66696d740

4 years agoL2cap/Hci: Add call for feature exchange
Martin Brabham [Thu, 16 Jan 2020 23:49:59 +0000 (15:49 -0800)]
L2cap/Hci: Add call for feature exchange

Bug: 145638034
Test: N/A
Change-Id: I811856672663874928b98137f16e6aee2e612caf

4 years agoMerge "Zip cert resources and scripts"
Treehugger Robot [Wed, 22 Jan 2020 17:43:45 +0000 (17:43 +0000)]
Merge "Zip cert resources and scripts"

4 years agoMerge "Cert: Check that child returns 0 or -signal"
Treehugger Robot [Wed, 22 Jan 2020 03:27:26 +0000 (03:27 +0000)]
Merge "Cert: Check that child returns 0 or -signal"

4 years agoMerge "gd: Fix for l2cap connection on failure"
Treehugger Robot [Wed, 22 Jan 2020 00:12:27 +0000 (00:12 +0000)]
Merge "gd: Fix for l2cap connection on failure"

4 years agoMerge "HCI: Add LocalName test"
Treehugger Robot [Wed, 22 Jan 2020 00:11:20 +0000 (00:11 +0000)]
Merge "HCI: Add LocalName test"

4 years agoZip cert resources and scripts
Hansong Zhang [Mon, 13 Jan 2020 23:47:22 +0000 (15:47 -0800)]
Zip cert resources and scripts

Test: compile
Change-Id: Ib11e566273a3bdd62ad791d0a66d36ebde5d6f39

4 years agoMerge "Initial entry for headless"
Treehugger Robot [Tue, 21 Jan 2020 23:56:10 +0000 (23:56 +0000)]
Merge "Initial entry for headless"

4 years agoHCI: Add LocalName test
Myles Watson [Fri, 17 Jan 2020 17:37:25 +0000 (09:37 -0800)]
HCI: Add LocalName test

Bug: 147444951
Test: ./cert/run_device_cert.sh
Change-Id: I9d3345d2316357beac727c9245134a8994aba25b

4 years agogd: Fix for l2cap connection on failure
Chris Manton [Tue, 21 Jan 2020 19:34:00 +0000 (11:34 -0800)]
gd: Fix for l2cap connection on failure

Included method and parameter naming updates to reflect functionality

Bug: 140778599
Test: bt_headless with failing params

Change-Id: I5ed4e2769f7c8f6f78a92af76545e3a0e41582d1

4 years agoInitial entry for headless
Chris Manton [Wed, 15 Jan 2020 00:34:08 +0000 (16:34 -0800)]
Initial entry for headless

Bug: 147316415
Test: Compiles and sdp test runs

Change-Id: I2db01df68fb8807ce934b59aab5a4f593d4f8074

4 years agoSplit ports for device and root-canal tests
Myles Watson [Fri, 17 Jan 2020 21:46:23 +0000 (13:46 -0800)]
Split ports for device and root-canal tests

Use 89xx ports for Root-canal tests and 88xx for device tests.

Bug: 148096951
Test: ./cert/run_device_cert.sh && ./cert/run_cert_facade_only.sh
Change-Id: I4ad9357d882668058450b42473addb69a290e7f5

4 years agoMerge "ACL packet recombination"
Treehugger Robot [Tue, 21 Jan 2020 20:08:55 +0000 (20:08 +0000)]
Merge "ACL packet recombination"

4 years agoACL packet recombination
Hansong Zhang [Thu, 16 Jan 2020 22:05:41 +0000 (14:05 -0800)]
ACL packet recombination

Recombine ACL fragments according to indicated L2CAP PDU size. Used the
workaround that rootcanal always sends the same ACL packet to remote to
verify.

Also added ACL fragmentation support in rootcanal. Recombination in
rootcanal is not supported so far, so whenever we want to send an ACL
packet fragment, we never buffer it until we have a complete L2CAP PDU.

Test: cert/run_cert_facade_only.sh run_cert.sh
Change-Id: Ieb4d3c987327867a39ce210474b84645175b8984

4 years agoFix legacy shim namespace
Chris Manton [Sun, 19 Jan 2020 01:29:38 +0000 (17:29 -0800)]
Fix legacy shim namespace

Align namespaces to adhere to convention

Bug: 140421732
Test: Builds
Change-Id: I23e716f7250b79d147ba0db974b91578ebf63d56

4 years agoRefactor dumpsys apis for legacy and gd
Chris Manton [Sat, 18 Jan 2020 03:25:36 +0000 (19:25 -0800)]
Refactor dumpsys apis for legacy and gd

Unify legacy and gd dumpsys syntax.
Fix static initialization order problem.

Bug: 147672133
Test: bt_headless and bluetooth_test_gd
Change-Id: I6f4d0d2c5611deace5a2a11eff8001b624b3dc62

4 years agoMerge "Shim stack facade test and fix for test"
Treehugger Robot [Fri, 17 Jan 2020 23:48:27 +0000 (23:48 +0000)]
Merge "Shim stack facade test and fix for test"

4 years agoMerge "Fix issue around Encryption during Pairing"
Treehugger Robot [Fri, 17 Jan 2020 23:07:49 +0000 (23:07 +0000)]
Merge "Fix issue around Encryption during Pairing"

4 years agoShim stack facade test and fix for test
Chris Manton [Fri, 17 Jan 2020 18:32:53 +0000 (10:32 -0800)]
Shim stack facade test and fix for test

Accidently 'captured' a raw pointer into a unique
pointer, which forced deletion upon destruction
resulting in other modules who rely on the no-longer-
in-existance module to call the module's pure
virtual Stop() function which is a bad thing.

Bug: 140778599
Test: ./gd/cert/run_cert_facade_only.sh

Change-Id: Ie1e39430517e47497172786fe4d8ab4976c371b4

4 years agoMerge "Cert: Swap Cert and DUT for device tests"
Treehugger Robot [Fri, 17 Jan 2020 18:59:33 +0000 (18:59 +0000)]
Merge "Cert: Swap Cert and DUT for device tests"

4 years agoFix issue around Encryption during Pairing
Jakub Pawlowski [Fri, 17 Jan 2020 18:54:47 +0000 (19:54 +0100)]
Fix issue around Encryption during Pairing

* ECC_PointMult erases private key argument, pass copy instead of
original value.
* Specify Z parameter for ECC Points

This fixes issues where LE Secure connection pairing between old and new
stack was failing due to DHKey mismatch

Test: manual pairing between phone running new and old stack
Bug: 147086339
Change-Id: Ied3404c2eb2ca55b717042ea099e1aefed1c3e8d

4 years agoCert: Check that child returns 0 or -signal
Myles Watson [Fri, 17 Jan 2020 17:33:26 +0000 (09:33 -0800)]
Cert: Check that child returns 0 or -signal

Bug: 147444951
Test: ./cert/run_device_cert.sh
Change-Id: I1628a039a90b6a389509afa28e59d1f23c622531

4 years agoMerge "Hid: Fix connection issue with legacy mouse"
Treehugger Robot [Fri, 17 Jan 2020 16:39:06 +0000 (16:39 +0000)]
Merge "Hid: Fix connection issue with legacy mouse"

4 years agoCert: Swap Cert and DUT for device tests
Myles Watson [Fri, 17 Jan 2020 16:28:02 +0000 (08:28 -0800)]
Cert: Swap Cert and DUT for device tests

Test: ./cert/run_device_cert.sh
Change-Id: Ib95eb8d2c7dacb252447902d0e0d6a366f20a01f

4 years agoMerge "LE-COC: Free LE-COC server resource when BluetoothServerSocket is closed"
Treehugger Robot [Fri, 17 Jan 2020 14:24:38 +0000 (14:24 +0000)]
Merge "LE-COC: Free LE-COC server resource when BluetoothServerSocket is closed"

4 years agoHid: Fix connection issue with legacy mouse
sravan voleti [Fri, 17 Jan 2020 08:44:37 +0000 (14:14 +0530)]
Hid: Fix connection issue with legacy mouse

use case:
1) Pair and connect mouse from DUT
2) Unpair mouse from DUT UI
3) Try to pair from mouse, SDP connection from dut
    should fail during pairing.
4) Scan the mouse from DUT and initiate pairing.

Observed Results:
Pairing stuck in bonding state.

Root cause:
On sdp failure cases, HID incoming connection flags not cleared
 and leading to HID connection and pairing failure in next outgoing pairing.

Fix:
Reset hid incoming connection flags when sdp fails,
to fix connection issue with specific HID mouse.

Fixes: 147856205
Test: Tested above use case with legacy mouse, issue not observed.
Change-Id: I11b5d52a78f861cc270d0736c912cd40f1b76d6d

4 years agoMerge "A2DP: Based on the AAC parameters to calculate its encoder interval"
Treehugger Robot [Fri, 17 Jan 2020 06:45:20 +0000 (06:45 +0000)]
Merge "A2DP: Based on the AAC parameters to calculate its encoder interval"

4 years agoLE-COC: Free LE-COC server resource when BluetoothServerSocket is closed
Jack He [Fri, 17 Jan 2020 00:20:06 +0000 (16:20 -0800)]
LE-COC: Free LE-COC server resource when BluetoothServerSocket is closed

* When BluetoothServerSocket is closed in the Java layer, the native
  layer should respond by freeing all resources used by the server
  including file descriptors, structs, PSMs, and security IDs
* We did this correctly for BR_EDR L2CAP COC channels after
  I4e37dcd858af258fbd64fbfb2fbf0083bd743e06, but the same fix did not
  apply to LE COC
* This CL make sure LE COC server resources are freed propertly upon
  server fd closure

Test: open and close LE COC server repeatedly on an Android phone
Bug: 144148429
Change-Id: I16fa10e77612105d23848f71925ff6efc95bc75a

4 years agoRootcanal: Always send FIRST_NON_AUTOMATICALLY_FLUSHABLE
Hansong Zhang [Thu, 16 Jan 2020 23:11:22 +0000 (15:11 -0800)]
Rootcanal: Always send FIRST_NON_AUTOMATICALLY_FLUSHABLE

Controller should only send FIRST_NON_AUTOMATICALLY_FLUSHABLE to host
per spec 5.1 vol 2 part E 5.4.2

Test: run_cert.sh
Change-Id: Ia79a4a1d4e64de4ba0d59a44108db93e4a2f7c7a

4 years agoAdd queuing for incoming acl packets
Chris Manton [Thu, 16 Jan 2020 21:36:44 +0000 (13:36 -0800)]
Add queuing for incoming acl packets

If a second packet arrives to the acl while there is
already a packet being processed the code ASSERTS
with enqueue already registered.

Bug: 140778599
Test: Runs bt_headless for 100 runs with no errors

Change-Id: Ib7601eab2121b1888f58f71676f734080f41c8ec

4 years agoMerge "PAN: Remove bta_pan_co_tx_writebuf (dead code)"
Treehugger Robot [Thu, 16 Jan 2020 23:06:22 +0000 (23:06 +0000)]
Merge "PAN: Remove bta_pan_co_tx_writebuf (dead code)"

4 years agoMerge "Delay removal of owned memory until close callback completes"
Treehugger Robot [Thu, 16 Jan 2020 21:53:30 +0000 (21:53 +0000)]
Merge "Delay removal of owned memory until close callback completes"

4 years agoDelay removal of owned memory until close callback completes
Chris Manton [Thu, 16 Jan 2020 19:25:06 +0000 (11:25 -0800)]
Delay removal of owned memory until close callback completes

Bug: 146086425
Test: bt_headless runs many (~100) iterations without this signature failure
Change-Id: I96a59ca80cf15ca0248e6ef2a0a2f1dcaf5c9fea

4 years agoAdd names for all shim modules
Chris Manton [Thu, 16 Jan 2020 17:53:17 +0000 (09:53 -0800)]
Add names for all shim modules

Bug: 140778599
Test: bluetooth_test_gd
Change-Id: Ie55ab28a5b1d748053c48835b2c9d7b855ede750

4 years agoMerge "AclManager::create_le_connection fixes"
Jakub Pawlowski [Thu, 16 Jan 2020 14:55:42 +0000 (14:55 +0000)]
Merge "AclManager::create_le_connection fixes"

4 years agoMerge "Convert on-device tests to facade_only"
Treehugger Robot [Thu, 16 Jan 2020 14:07:39 +0000 (14:07 +0000)]
Merge "Convert on-device tests to facade_only"

4 years agoMerge "SecurityManager: Call Init in the constructor"
Treehugger Robot [Thu, 16 Jan 2020 14:04:09 +0000 (14:04 +0000)]
Merge "SecurityManager: Call Init in the constructor"

4 years agoA2DP: Based on the AAC parameters to calculate its encoder interval
Cheney Ni [Tue, 17 Dec 2019 07:47:01 +0000 (15:47 +0800)]
A2DP: Based on the AAC parameters to calculate its encoder interval

When running AAC software encoder, the PCM data size per AAC frame is:
  1024 (sample counts per frame) * 2 (16 bits per sample) * 2 (stereo)
If we are using 44.1 kHz, the interval is about 23.22 ms. When using 48
kHz, it is about 21.33 ms. Here we determine the interval based on the
codec configuration and feeding parameters while updating the AAC
encoder.

Bug: 146399686
Test: There were AAC frames every 23 ms in BTSnoop
Change-Id: I8af7696917b007cb751a8991f21b344724b9ba94

4 years agoMerge "HCI: Add an LeAclManagerFacade and tests"
Treehugger Robot [Thu, 16 Jan 2020 13:06:08 +0000 (13:06 +0000)]
Merge "HCI: Add an LeAclManagerFacade and tests"

4 years agoAclManager::create_le_connection fixes
Jakub Pawlowski [Mon, 13 Jan 2020 19:25:45 +0000 (20:25 +0100)]
AclManager::create_le_connection fixes

* modern controllers require "Enhanced" version of Create Connection
Command
* They also require "Set Random Address" to be used before attempting to
create connection
* Use same parameters for connection initiation as the old  stack is using

Test: Attempt to Bond with LE device
Change-Id: I58eb54b4e45f5884a69079421b7a2c6a67b7a2bd

4 years agoMerge "L2CAP: Call Authenticate for the Classic Pairing service"
Treehugger Robot [Thu, 16 Jan 2020 06:14:49 +0000 (06:14 +0000)]
Merge "L2CAP: Call Authenticate for the Classic Pairing service"

4 years agoMerge "Remove async grpc helper"
Treehugger Robot [Thu, 16 Jan 2020 02:05:23 +0000 (02:05 +0000)]
Merge "Remove async grpc helper"

4 years agoMerge "Fix flaky gd unit tests"
Treehugger Robot [Thu, 16 Jan 2020 01:36:22 +0000 (01:36 +0000)]
Merge "Fix flaky gd unit tests"