Commit Graph

595 Commits

Author SHA1 Message Date
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
Yung Ti Su
fefceb14d0 enable host_supported for libbluetooth_audio_session_aidl
Test: manual

Change-Id: Iae06114020e5bc4e41fa5caa5df5de8a186dc2ff
Signed-off-by: Yung Ti Su <andysu@google.com>
2023-08-22 09:29:06 +00:00
Igor Tolkov
3b3f7f06fa Move StopServicesSetup later in VtsHalBluetoothV1.0TargetTest am: 8c32f711b5 am: 12320fd071 am: cd47557c62
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2709435

Change-Id: I478ec9b89d874d516b384c211f1ee9acaf022288
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-18 08:26:35 +00:00
Igor Tolkov
cd47557c62 Move StopServicesSetup later in VtsHalBluetoothV1.0TargetTest am: 8c32f711b5 am: 12320fd071
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2709435

Change-Id: Id19f7f18a9a374e92a5790240adf260aa1f92b4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-18 07:57:21 +00:00
Igor Tolkov
8c32f711b5 Move StopServicesSetup later in VtsHalBluetoothV1.0TargetTest
Move StopServicesSetup after RunCommandTargetPreparer in
VtsHalBluetoothV1_0TargetTest. RunCommandTargetPreparer requires
settings service, which is not available after StopServicesSetup.

Bug: 293822620
Test: run vts -m VtsHalBluetoothV1_0TargetTest and inspect logs to make
sure no preparer steps fail.

Change-Id: I935d19c5e941bfdb122554d8c413d3095fef27ac
2023-08-16 15:24:25 +08: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
kuanyuhuang
25b4819e08 BT: add LOW_LATENCY mode if low latency allowed
LatencyMode is not updatable after audio session started.
Currently, if low latency is allowed, audio session should have
LOW_LATENCY latency mode.
Create a workaround to add LOW_LATENCY when low_latency_allowed_ set to
ture at ReportLowLatencyModeAllowedChanged.

Bug: 291760415
Bug: 294498919
Test: play low latency audio with supported headset and check
LOW_LATENCY mode can be selected

Change-Id: Ia324f0a368e47ae8b8056c190d8d1f4a2e09ecec
2023-08-07 05:05:52 +00:00
Mikhail Naganov
d5f0d13ef0 bluetooth: Add AudioSession/Control methods for AIDL track metadata
Add overloads for UpdateSink/SourceMetadata that
accept android.hardware.audio.common.Sink/SourceMetadata types.
Move include of hardware/audio.h to BluetoothAudioSession.cpp.
This allows to use this code from "pure AIDL" modules.

Bug: 228804498
Test: m
Change-Id: Ib0b8c6d1c7db9b846a508d6d4001f67feb2111c6
2023-08-01 13:38:47 -07:00
Ram Mohan
f6497dd78c bluetooth: Fix dependency on android.hardware.audio.common
Make android.hardware.bluetooth.audio-V3 and
VtsHalBluetoothAudioTargetTest to depend on
android.hardware.audio.common-V2. This is needed so that
the audio HAL service can depend on
android.hardware.bluetooth.audio-V3.

Bug: 228804498
Test: m
Change-Id: Ic001e651de4cc6ef6920f1d6d80ab272c45aefe2
Merged-In: Ic001e651de4cc6ef6920f1d6d80ab272c45aefe2
2023-08-01 13:38:47 -07:00
Devin Moore
dfcd3bda4b Freeze android.hardware.bluetooth.audio
This was done in ag/22462586 internally which is too large to
cherry-pick. It's being applied to aosp to unblock some trunk stable
work.

This CL is generated with:
`m android.hardware.bluetooth.audio-freeze-api`

Test: m
Bug: 290265210
Change-Id: Icfcea3d6971dd0b91cd320d9995b70bcb38a3750
Merged-In: I832ab7a8b5445ba85e27bbcf5be64906bfa0e5be
2023-07-31 23:46:41 +00:00
William Escande
29120123a8 Sync wait for the bluetooth to be disabled / enabled
Bluetooth does not handle well conflicting message

Test: VtsHalBluetoothV1_0TargetTest
Test: VtsHalBluetoothV1_1TargetTest
Bug: 262645484
Bug: 262501652
Bug: 293822620
Change-Id: I0aca127fb5e5e33cc0086aaad19a8f1286fc83d6
(cherry picked from commit cd64ee13fb)
2023-07-31 06:40:19 +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
Myles Watson
44628f38d2 BluetoothAudio: Statically link HAL dependencies
Bug: 290666670
Bug: 289857524
Bug: 284091286
Bug: 289489060
Test: mma -j32
Change-Id: I2b3c32b133e208ec2cfb1b244ccb24ad249f22df
2023-07-11 16:08:27 -07:00
Bao Do
00dede017f Add a config with test skipping for SDK < 33
Test: atest VtsHalBluetoothAudioTargetTest
Bug: 288598199
Change-Id: I563c8d50b186f2da2cf077dc3631808f8c2a9eee
2023-07-10 07:43:09 +00:00
Treehugger Robot
e959d0923d Merge "Revert "Fix VTS Fuzz issue"" 2023-07-03 12:43:04 +00:00
Guillaume Bailey
a2b4a18ab7 Revert "Fix VTS Fuzz issue"
This reverts commit 1adfae9364.

Reason for revert: Causes Sabrina/Boreal bt stacks to timeout on startup
Bug: 247053367

Change-Id: Ibef97f054510c826920bb30725fed168c755cc14
2023-07-03 12:10:36 +00: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
Edward Liaw
24a8a39219 Merge "TEST_MAPPING: enable vts hal tests in kernel-presubmit" 2023-06-01 20:34:33 +00:00
Edward Liaw
24696b3e32 TEST_MAPPING: enable vts hal tests in kernel-presubmit
Enable the following tests:
VtsHalBluetoothAudioTargetTest
VtsHalGraphicsComposerV2_4TargetTest

Bug: 284307085
Bug: 258819618
Test: atest :kernel-presubmit
Change-Id: I8667eaee120777a776339481f72558566e6c94b3
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-06-01 16:08:42 +00:00
Jooyung Han
16d5af6755 Set root elements for xsd_config modules
This reduces the code size by not generating unnecessary code for
non-root elements.

Bug: 283700992
Test: m
Change-Id: I23bd5c2a0ccc40fded3ca08155ead5f4680c2ed9
2023-05-22 16:43:12 +09:00
Yichun Li
3ac998fa8c Merge "Revert "Remove unused hardware/bluetooth.h include"" 2023-05-19 00:45:21 +00:00
Yichun Li
6d9773daf4 Revert "Remove unused hardware/bluetooth.h include"
Revert submission 2517798-remove_bluetooth_h

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_tm-qpr-dev-plus-aosp&target=aosp_bramble-userdebug&lkgb=10164200&lkbb=10164726&fkbb=10164208

Reverted changes: /q/submissionid:2517798-remove_bluetooth_h

Bug: 10164208
Change-Id: I52877f236db874e95228707d533698e3c12ecde1
2023-05-19 00:33:14 +00:00
David Duarte
9d2cdddb88 Merge "Remove unused hardware/bluetooth.h include" 2023-05-18 21:50:50 +00:00
Myles Watson
970886d163 Bluetooth HIDL 1.0: Log BDADDR source
Bug: 283116345
Test: atest VtsHalBluetoothV1_0TargetTest
Change-Id: I2099dac406035a5f4698806a2d3b016e5dc1a913
2023-05-18 10:32:39 -07:00
David Duarte
26e456b792 Remove unused hardware/bluetooth.h include
Change-Id: I1877f6266cd105bb830a37ff4ac964f240dfa163
2023-05-15 20:30:54 +00: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
6ca63b0e20 Merge changes If33bee4e,I0c14c062
* changes:
  Improve AudioProvider logging
  Fix deathRecipient of BluetoothAudioProvider
2023-05-12 02:17:13 +00:00
William Escande
fb6dd74b2c Improve AudioProvider logging
Bug: 245009140
Test: looked at some beautiful log when bluetooth is killed (RIP)
Change-Id: If33bee4e875812ce3710d41014cae8bd54d840f2
2023-05-12 00:46:05 +00:00
William Escande
f3faab081a Fix deathRecipient of BluetoothAudioProvider
The "provider" is managed with a shared_ptr but we do not hold it and
instead are giving the raw inner pointer as binderDiedCallbackAidl.
This can randomly generate crash as the provider may be freed outside of
this code.

Replacing the provider with a context that we can manually allocate and
deallocate.
Setup AIBinder_DeathRecipient_setOnUnlinked to clean the data allocated

Bug: 245009140
Test: m android.hardware.bluetooth.audio-impl and start / stop session +
      manually kill bluetooth process during audio play
Change-Id: I0c14c062a8bde7e532ff02f01991d66da33ec569
2023-05-11 17:45:43 -07: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
4de72a2297 Merge "Bluetooth AIDL: SetTerminalRaw on fd" 2023-04-28 19:29:33 +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
Henri Chataing
8e9bf734b4 Merge "Bluetooth: Add a test for alignment" 2023-04-21 17:33:23 +00:00
Treehugger Robot
de5c086b79 Merge "Fix HCI parser and packetizer" 2023-04-21 17:22:19 +00:00
Myles Watson
bcc997bdf3 Bluetooth: Add a test for alignment
Bug: 276652301
Test: atest --host bluetooth-vendor-interface-hci-test
Change-Id: I3e862dd88aeed65e7a4ef1f9a223cc520a1ccc54
2023-04-21 16:48:16 +00:00
Henri Chataing
2845303342 Fix HCI parser and packetizer
Issue found from the test H4ProtocolAsyncTest#TestMultiplePackets.
The packetizer does not correctly handle a packet termination
at the beginning of a chunk.

Test: atest --host bluetooth-vendor-interface-hci-test
Bug: 276652301
Change-Id: I1b61efcfa5f817fdb8b5870e81d660be5279fdea
2023-04-21 16:10:22 +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
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
Myles Watson
048b8f7517 Run VtsHalBluetoothTargetTest with hwasan
Bug: 276457982
Test: atest VtsHalBluetoothTargetTest
Change-Id: I4d203f4217f6509c08c5519dc3ff53b9eca5c172
2023-03-31 13:15:19 -07:00
Treehugger Robot
7c0d76357c Merge changes I53a67135,I235ca85f,If3180282
* changes:
  VTS: Add VSR requirement tests to VTS
  Fix clang-tidy errors
  VtsHalBluetooth: Use PDL to generate packets
2023-03-30 04:09:07 +00: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
Ayushi Khopkar
3d396973ff Updated fuzz_config in Android.bp file
Added new fields in fuzz_config like - hotlists,
description, vector, service_privilege, users, fuzzed_code_usage, etc.

Bug: 271384401
Test: Build bluetoothV1.0_fuzzer

Change-Id: I71936ab4b16dd5ade636d3da9b1eafa6a6fea6b0
2023-03-23 14:31:05 +05:30
Myles Watson
a794f83162 VtsHalBluetoothV1: Always wait for completed packets
Bug: 266140831
Test: atest VtsHalBluetoothV1_1TargetTest
Change-Id: I09503e2e4596c2488da65c7ca3a5580798dc2bce
2023-03-02 13:45:53 -08:00
Sagar Verma
62df910355 BT: AptxAdaptive LE/LEX codec and AAC ABR AIDL Changes
AptxAdaptive LE/LEX codec and AAC ABR AIDL side changes

Bug: 254567319
Tag: #feature
Test: m android.hardware.bluetooth.audio-freeze-api &&
      m android.hardware.bluetooth.audio-update-api &&
      atest VtsHalBluetoothAudioTargetTest
Change-Id: I74a2df64ba6ef2ae02e08850b0f6c7784b24b02b
2023-02-22 09:19:17 +05:30
Treehugger Robot
f2d9196a6c Merge "Add field isStreamActive in LeAudioConfiguration to indicate the stream status" 2023-02-14 02:58:34 +00:00