Commit graph

55 commits

Author SHA1 Message Date
Myles Watson
1f0e88bff9 HCI: Prefer the requested hci_interface
Bug: 345058678
Test: mma -j32
      Connect passthrough mode with AAOS
Change-Id: I9fd5e4cba1e14e6260f485f56f473ce506f18437
2024-06-05 13:39:54 -07:00
Myles Watson
f7986f1a31 HCI: Return the interface from EV_INDEX_ADDED
Bug: 345058678
Test: mma -j32
      Connect passthrough mode with AAOS
Change-Id: I59872b1a5f84401c19106ebb0ffe1dbcc72f6aff
2024-06-05 13:39:10 -07:00
Omair Kamil
84a95be33b Add VTS requirement for concurrent LE connections.
Bug: 334200772
Test: atest VtsHalBluetoothTargetTest
Change-Id: I07c72ee077f67858764cbcfc8a1ea34c5d4454e3
2024-04-22 13:30:25 -07:00
William Escande
ac0f34f6cd Bluetooth vts hal: Restore to 2s startup
1s should really be the max limit, but it requires time to investigate
the failures and optimize this

Bug: 327273567
Fix: 332815453
Test: atest VtsHalBluetoothTargetTest
Change-Id: I43767b5241d967cb643401711fd7b2e015e99455
2024-04-11 09:06:31 -07:00
Henri Chataing
11c3782296 VtsHalBluetoothTargetTest: Link with libbluetooth_log
Test: m VtsHalBluetoothTargetTest
Bug: 305066880
Change-Id: Id16fa4557a4152c5972fa6a3a71626840414ebf0
2024-03-29 17:16:11 +00:00
Doug Ferraz
eff7b9102f Bluetooth HCI: Add VTS requirement for HCI 4.2 - Annotations
Bug: 285456310
Test: atest VtsHalBluetoothV1_1TargetTest
Test: atest VtsHalBluetoothV1_0TargetTest
Test: atest VtsHalBluetoothTargetTest
Change-Id: I5a910d2a7d778b2e64a524d0a389b911c080e189
2024-03-25 20:04:19 -04:00
Doug Ferraz
83b2267b78 Bluetooth HCI: Add VTS requirement for HCI 4.2
Bug: 285456310
Test: atest VtsHalBluetoothTargetTest
Change-Id: I056b924543ac349beb9b0eddaf039b0aa9187821
2024-03-25 14:52:55 -04:00
William Escande
1a13990ae0 Bluetooth vts hal: Enforce 1s startup
Bug: 327273567
Test: atest VtsHalBluetoothTargetTest
Change-Id: I0035a8aa82e172c776b97a73afcca099f48dddcf
2024-02-28 17:08:53 -08:00
yanggang.yang
c59d2d80ee Allow non-zero HCI interface numbers
[Description]
when driver re-register hci device, it may register hci 1
[Root Cause]
In the kernel mechanism, there may be a timing issue. when driver re-register hci device,kernel may not completely unregister hci 0.But aidl only open hci 0.
[Solution]
assign a value to the hci interface based on the device node found by AIDL

[Test Report]
Insert the bt chip into the usb 2.0 port, and then suspend the TV. The bt chip will be disconnected due to the USB power outage. And then quickly resume the TV,check whether the Bluetooth state is on. Suspend and resume for several times, check for bt state.

Change-Id: I57fd4a22c956e0cf2b4a516247c258493163e51a
BUG: 314149416
2023-12-07 02:07:58 +00:00
yanggang.yang
886074d669 Fix bluetooth aidl crash
[Description]
during servicefuzz test, when AIDL has already been closed, then send
packet will cause crash
[Root Cause]
send function doesn't check AIDL mstate and it may use illegal socket fd
[Solution]
add AIDL state check before send

[Test Report]
test bluetooth servcefuzz pass

Change-Id: Id10c72269a392562798a6e46e9753402db423ee3
Bug: 308904509
2023-11-13 13:39:19 +08:00
Treehugger Robot
ccb7204ecf Merge "Use the PDL library for HCI packets" into main am: ab10c92241
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2675951

Change-Id: I7cfe73d0dbe9443a4dc04db615dd1e7e7c95fc15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-01 21:31:03 +00:00
William Escande
b94637beae Use the PDL library for HCI packets
Bug: 296427840
Test: mma -j32
Change-Id: I5dc1d6cd24890e4558ace5b8de4ed6d93a6abc86
Merged-In: I5dc1d6cd24890e4558ace5b8de4ed6d93a6abc86
2023-09-01 18:02:53 +00:00
Treehugger Robot
3928787308 Merge "Remove PDL from the HAL" into main am: c9174b9a18
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2729993

Change-Id: Iec6c62b9ecde82b23bf5d79cb923db1e8529a8dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-29 01:08:58 +00:00
Myles Watson
47c0282de8 Remove PDL from the HAL
The benefit is small and it's painful to make libraries
available to apexes and the platform.

Bug: 296427840
Test: mma -j32
Change-Id: I7f2ed8636b90de415b8d5635dcd7c568810323bd
2023-08-28 15:24:36 -07:00
Xin Li
879960bdce Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I7b6fffac2ada0e039f79bad8cc9b4d954e9c3460
Change-Id: I9466127d8d0fa38df36ca99f704853b2db871e67
2023-08-25 13:29:30 -07:00
Henri Chataing
1267ff2c46 bluetooth/aidl: Enable HCI reset in default hal only when running on emulator devices
Bug: 290329516
Test: m
Change-Id: I624f26824372fb708598e6be322adf06e40cb5a2
2023-08-09 22:57:26 +00:00
xiaoshun.xu
4e85c09959 Fix vts sco test fail for usb interface
[Description]
If bt controller device is usb interface,
sco loopback single pkt and bandwidth test can not pass
because pkt size is limited accroding to core spec

[Root Cause]
USB sco packet size is limited in spec

[Solution]
If is bt usb chip, continuous receive sco packets
  from controller until size is enough

[Test Report]
Test Pass

Bug: 286355871
Change-Id: Idb150d8a72149f7e1dfaccfd7bc82a91710da59c
2023-07-18 09:34:08 +08:00
yanggang.yang
6ebe251322 Fix bluetooth AIDL restart fail when open HCI Fail
[Description]
If aidl open HCI fail at the first time, the aidl state
can not change to enable for the next time to initialize.

[Root Cause]
Bluetooth AIDL State is always equal to INITIALIZING after
open hci fail at the first time.

[Solution]
When open HCI fail at the first time, initialize the mstate to ready

Bug: 285517442
Test: pass

Change-Id: I19756d6602ba931242d0f95942db55c505a210bb
2023-06-28 09:13:57 +00:00
Treehugger Robot
ba20c7b6b7 Merge "VTS: Reduce TV's advertising set requirement to 10" into udc-dev am: 1b3c54106e
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/23202864

Change-Id: I42e1e03034ebbcfd034be9f9d049dfa11c0d1130
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 19:00:22 +00:00
Treehugger Robot
4b518cc3e7 VTS: Reduce TV's advertising set requirement to 10
Bug: 281798597
Test: atest VtsHalBluetoothVTargetTest
Change-Id: Ia3be5a1c7a7acc5270baef74b295291c32851987
2023-05-11 23:54:11 -07:00
Treehugger Robot
5e0277ff94 VTS: Reduce TV's advertising set requirement to 10
Bug: 281798597
Test: atest VtsHalBluetoothVTargetTest
Change-Id: Ia3be5a1c7a7acc5270baef74b295291c32851987
2023-05-11 23:51:26 -07:00
Treehugger Robot
62eb791ab2 Merge "VTS: Rename Vsr_Bluetooth5Requirments" am: 3551f2963e am: 5b83b95388 am: 80537228a0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2585149

Change-Id: I60c4bda67ade7725daf6624a6a594fa3ddc65206
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-11 01:11:29 +00:00
Myles Watson
5bfb3a7995 VTS: Rename Vsr_Bluetooth5Requirments
Bug: 281798597
Test: atest VtsHalBluetoothTargetTest
Change-Id: I7db99066be11a6dae206cfe4997101db751ae059
2023-05-10 14:06:32 -07:00
Treehugger Robot
f3dcc82a6b Merge "Bluetooth AIDL: SetTerminalRaw on fd" am: 4de72a2297 am: bb8c28de90 am: 8b2a877457
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2556557

Change-Id: I31c22dd5c92a8fef9769280885fce4f1f4f49b2e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-28 21:18:19 +00:00
yanggang.yang
d1abb34b44 Bluetooth AIDL: SetTerminalRaw on fd
Call SetTerminalRaw on the fd that was opened, since mFD has not been set. If SetTerminalRaw fails, log it but continue, since some platforms do not need this call.

Bug: 279870989
Test: start Bluetooth on a device that doesn't need SetTerminalRaw
(cherry picked from https://android-review.googlesource.com/q/commit:eb744bc14c0d1e64c4291b3f869d6055db36b0f3)
Merged-In: I97c92c407b7c80442a0ba0812a630525219670a0
Change-Id: I97c92c407b7c80442a0ba0812a630525219670a0
2023-04-28 19:36:38 +00:00
Treehugger Robot
4de72a2297 Merge "Bluetooth AIDL: SetTerminalRaw on fd" 2023-04-28 19:29:33 +00:00
Henri Chataing
a4b4be6c2b Merge "Bluetooth: Enable test Cdd_C_12_1_Bluetooth5Requirements" am: f41cdd3d0d am: 2c2472ee9e am: 30bc77e297
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2551038

Change-Id: Ia47d1611ce185c4ed0faf4a3e85aca404f0c9800
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-28 19:09:56 +00:00
Henri Chataing
f41cdd3d0d Merge "Bluetooth: Enable test Cdd_C_12_1_Bluetooth5Requirements" 2023-04-28 17:35:03 +00:00
yanggang.yang
eb744bc14c Bluetooth AIDL: SetTerminalRaw on fd
Call SetTerminalRaw on the fd that was opened, since mFD has not been set. If SetTerminalRaw fails, log it but continue, since some platforms do not need this call.

Bug: 279870989
Test: start Bluetooth on a device that doesn't need SetTerminalRaw
Change-Id: I97c92c407b7c80442a0ba0812a630525219670a0
2023-04-28 17:02:08 +00:00
Elie Kheirallah
f454e03c9e Merge "Fix null dereference read in android::hardware::bluetooth::hci::H4Protocol::Send" am: 3f2f348c48 am: dcc46ec5bd am: dc747c1046
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2548491

Change-Id: Iad5e17bfb76ff28c6ae3bfa5b465893a577d5457
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-21 22:23:44 +00:00
Elie Kheirallah
3f2f348c48 Merge "Fix null dereference read in android::hardware::bluetooth::hci::H4Protocol::Send" 2023-04-21 15:04:56 +00:00
Henri Chataing
0c581a084a Bluetooth: Enable test Cdd_C_12_1_Bluetooth5Requirements
The requirements have been added to RootCanal:
 - LE Periodic Advertising
 - LL Privacy
 - LE 2M Phy

Test: atest
Bug: 275847929
Change-Id: Ifa49494091727bf162554a658629bc4ec3c3cd63
2023-04-20 23:12:06 +00:00
Elie Kheirallah
cd1bf1e530 Fix null dereference read in android::hardware::bluetooth::hci::H4Protocol::Send
Bug: 276375037
Test: atest VtsHalBluetoothTargetTest
Change-Id: Ib9f99a75a97538899ac64a3c02fff1ec5804a0e6
2023-04-20 21:37:50 +00:00
Myles Watson
ba44266f13 Merge "Bluetooth AIDL: Set max thread count to 0" am: bf6879eaa2 am: 817c6e4139 am: 530846b34c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2545971

Change-Id: I9c15b271447c094cd9a0250f686ff71c76061852
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-19 04:48:48 +00:00
Myles Watson
18bd4096a9 Bluetooth AIDL: Set max thread count to 0
The default HAL only uses one thread, which is 0 more than
the default of 1.

Bug: 205758693
Test: VtsHalBluetoothTargetTest
Change-Id: I8828cab2b4eb4d2a28ecc41cb75e3eb470cd0da6
2023-04-18 15:46:32 -07:00
Alex Buynytskyy
ec1198d941 UpsideDownCake is now 34
Ignore-AOSP-First: UpsideDownCake Finalization
Bug: 275409981
Test: build
Change-Id: I832ab7a8b5445ba85e27bbcf5be64906bfa0e5be
2023-04-07 23:41:20 +00:00
Myles Watson
048b8f7517 Run VtsHalBluetoothTargetTest with hwasan
Bug: 276457982
Test: atest VtsHalBluetoothTargetTest
Change-Id: I4d203f4217f6509c08c5519dc3ff53b9eca5c172
2023-03-31 13:15:19 -07:00
Jack He
2d2f3c272d VTS: Add VSR requirement tests to VTS
* Enforce that LMP version must be greater than or equal to HCI version
* Enforce that minimum advertising set is 16 when HCI version is 5.0 and
  above
* Enforce Link Layer Security, 2M Phy, Coded PHY requirements at BT 5
* Enforce minimum 8 resolving list entries at BT 5

Bug: 263257831
Test: vts
Change-Id: I53a6713563c0b9a5ba27eecf2a69caff0a57f30b
2023-03-29 18:24:55 -07:00
Jack He
dbceaca8e1 Fix clang-tidy errors
Bug: 263257831
Test: vts
Change-Id: I235ca85f9c1c84ab0a929572221020bfd568a2b0
2023-03-28 00:07:21 -07:00
Myles Watson
51b8baeb00 VtsHalBluetooth: Use PDL to generate packets
Bug: 266221125
Test: atest VtsHalBluetoothTargetTest
Change-Id: If3180282249027ffab45b7e84138a660266ce2b8
2023-03-27 17:31:53 -07:00
Myles Watson
0daa164e59 VtsHalBluetooth: Add test for double init
Bug: 266221125
Test: atest VtsHalBluetoothTargetTest
Change-Id: Ic9c0abd27171e210367c2224f8a97991f4088285
2023-02-01 17:17:58 -08:00
Myles Watson
65b47f5f99 BluetoothHAL: Reset the chip on open(), close once
Sending a reset and discarding extra packets
helps ensure that tests are hermetic for devices
that do not power off the chip with rfkill.

Add a mutex to make sure that close only gets
called once.

Bug: 266221125
Test: atest VtsHalBluetoothTargetTest
Change-Id: Ifb259a675202aa5399a8c7570ba8c4df2083e10e
2023-01-31 14:42:57 -08:00
Myles Watson
e1708c8c44 VtsHalBluetoothTargetTest: test loopback
Add tests for loopback testing mode.

Bug: 205758693
Test: atest VtsHalBluetoothTargetTest
Change-Id: Ie4d23136f0cff901435ec33f8668dd1e261d9870
2023-01-20 17:52:31 -08:00
Treehugger Robot
115b1a7dae Merge changes Ie7e60128,I1a648227
* changes:
  Move AIDL library from shared to static for BT VTS
  Add bluetooth VTS to TEST_MAPPING
2023-01-20 02:02:52 +00:00
Devin Moore
21ca742b9e Move AIDL library from shared to static for BT VTS
It can't find the .so in /system when the binary is pushed to the
device.

Test: na
Bug: 205758693
Change-Id: Ie7e601285b96d8242d6c8e162c452363a78ed87e
2023-01-20 00:28:50 +00:00
Treehugger Robot
b53e8ef9b4 Merge "Dispatch correct callbacks from AIDL HAL" 2023-01-19 23:01:25 +00:00
Devin Moore
c1b5f69ea0 Add bluetooth VTS to TEST_MAPPING
Test: na
Bug: 205758693
Change-Id: I1a64822740e4cff402a2b5bd62eed359e3c2f123
2023-01-19 21:13:36 +00:00
David Duarte
a58b79d44e Dispatch correct callbacks from AIDL HAL
Test: pts-bot
Bug: 266052984
Change-Id: I323f32ddbc9773df08f7cc466d37c395279e3dd9
2023-01-19 21:01:13 +00:00
Dylan Tian
8a6e09c72d Vts implementation for Bluetooth Hci
Bug: 205758693
Test: atest VtsHalBluetoothTargetTest
Change-Id: If3e193303881990cbca858a0882891a7b8e19c75
2023-01-18 17:24:27 -08:00
Myles Watson
efa25d7287 bluetooth: Add support for linux bluetooth raw hci sockets
The implementation is imported from
packages/modules/Bluetooth/system/vendor_libs/linux/interface
with modifications to modernize the code.

The default bluetooth HAL implementation now jointly uses
the serial implementation and the bluetooth socket
implementation.

Bug: 205758693
Test: VtsHalBluetoothTargetTest
Change-Id: I791fd406e56a0144e1117cb6f8e27ec71b48a192
2023-01-05 17:09:09 -08:00