Commit Graph

18 Commits

Author SHA1 Message Date
Weilin Xu
a7cc8a9acd Define customized program selector/info comparator
Define customized comparators for program selector and program info
in broadcast radio AIDL HAL utils library, which can be used to
sort program list by the order of frequency in HAL implementation of
devices other than emulator.

Bug: 315389663
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Ie8de342f3c123d896589751a6244f871ee07eb81
2023-12-11 12:45:11 -08:00
Weilin Xu
90e39f542d Improve DAB radio support in refrence bcRadio HAL
Improved DAB radio support in the reference implementation for AIDL
broadcast radio HAL. Used real DAB service ID, ECC code, freuqnecy
and ensemble values for virtual DAB stations and implemented sub-channel
support for DAB radio.

Bug: 309693129
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I6a78794e16400f05c6d7c5ec99aa4978adca5b58
2023-11-29 21:26:50 -08:00
Weilin Xu
7991996514 Implement HD signal acquisition state in radio HAL
Implemented HD signal acquisition status change using program info flag
in the reference broadcast radio HAL.

Bug: 309694368
Test: seek/tune to an HD radio station in radio KS app
Change-Id: Ibde570429d4c21b2f894f8658de1b37001541f3a
2023-11-29 21:26:27 -08:00
Weilin Xu
4833896a0d Separate AM/FM band in default radio HAL
Separated AM/FM band so that seeking should loop within the band of
the current program info in default AIDL broadcast radio HAL
implementation. Also updated program list by tuner callback when the
AM/FM band is switched.

Bug: 309694368
Test: switch to AM and do not see FM stations in program list in radio KS app
Test: seek in FM band and do not jump any AM stations in radio KS app
Change-Id: Ia4618232d8726f2d779ac2ec87f169b0263ee979
2023-11-21 15:11:44 -08:00
Weilin Xu
39dd0f832b Add mock HD programs to default AIDL bcradio HAL
Added mocked HD radio programs and HD radio tune/seek/step support with
subchannel in the default AIDL broadcast radio HAL implementiation.

Bug: 309694368
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Id0ba9b127860d98822e9102ba48d913dc38cade1
2023-11-20 19:50:58 -08:00
Weilin Xu
ee546a6300 Fix missing return in default AIDL radio HAL Impl
Bug: 310027894
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Iea97042e553ddc2c3a20db189077ca4a41200c89
2023-11-15 13:14:58 -08:00
Weilin Xu
31c541c228 Upgrade default bcRadio AIDL HAL impl to version 2
Bug: 280300929
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I4bc9b24bf421bad8d980de2c82434abdf7cae74c
2023-10-30 16:02:24 -07:00
Weilin Xu
95f187b588 Improved HD radio support in broadcast radio HAL
Added identifier types, program info flags and metadata needed for
HD radio in AIDL broadcast radio HAL. Depracated SXM identifier
types since SXM is not supported.

Bug: 280300929
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I822b43e6452c308db1259b99b961378c14c8b294
2023-10-30 11:15:55 -07:00
Steven Moreland
50f1040abc broadcast radio fuzzer: remove vendor
This fuzzer was crashing immediately due to a
hermeticity issue where a vendor variant of libbinder
was used underneath libbinder_ndk (b/307611931).

Now, it is hanging in ~WorkerThread.

Fixes: 307611931
Test: run fuzzer
Change-Id: Iba16c6eefeb508e41951ba9f5b3e4fc7e2fc3457
2023-10-24 23:40:26 +00:00
Weilin Xu
664048f218 Fix bcradio HAL unsigned int comparison error
Bug: 299489486
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I87fe60a593800535e0aadb0baf87696ee6844004
2023-09-07 13:21:55 -07:00
Weilin Xu
764fe0dea7 Implement default radio HAL stopProgramListUpdates
Implemented stopProgramListUpdates method in default AIDL broadcast
radio HAL. Created a separate thread for program list updates, so
that canceling pending tuning operations and canceling pending
program list updates are independent.

Bug: 243681584
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I9e09f267a2264fa0cbc280d0d6ea71037db519ac
2023-07-26 18:18:24 +00:00
Weilin Xu
3bd4d9b299 Implement config flag in default AIDL radio HAL
Implemented getting and setting config flag method in IBroadcastRadio
inferface for default AIDL broadcast radio HAL.

Bug: 249850737
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Iedbae78fe3afccab5e8cbb850b2d8f3da3ab20d4
2023-07-20 18:33:17 +00:00
Weilin Xu
acb8fb6242 Add fuzzer for AIDL broadcast radio
Refactored Android.bp file and added fuzzer for default AIDL broadcast
radio HAL.

Bug: 246857025
Test: SANITIZE_TARGET=address make android.hardware.broadcastradio-service.default_fuzzer
cd ${ANDROID_PRODUCT_OUT}
adb root && adb sync data
adb shell /data/fuzz/x86_64/android.hardware.broadcastradio-service.default_fuzzer/vendor/android.hardware.broadcastradio-service.default_fuzzer --test_env=ENABLE_BLAZE_TEST_FUZZING=1 --test_arg=--minloglevel=0

Change-Id: I443fe6fccccb51626e6a58819f3f28ce11b0bff8
2023-05-17 17:20:52 +00:00
Weilin Xu
64cb963141 Allow secondary ids missing for DAB selector
Sometimes DAB program selector used in tuning does not have secondary
identifiers such as ensemble and frequency, and HAL will automatically
selector a DAB station with specified ensemble and frequency. Thus,
secondary ids in DAB program selector are not mandatory in HAL. Also
updated broadcast radio AIDL HAL documentation.

Bug: 273804622
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: If05b7eeb79e299667c3a64bf8b931bb6396f9045
2023-03-22 18:18:31 +00:00
Weilin Xu
0d4207d97a Improve DAB support in broadcast radio AIDL HAL
SID in DAB_SID_EXT was extended to 32-bit to support DMB radio.
The documatation for DAB program selector and program info was
updated to make a DAB station is uniquely specified. AIDL HAL
definition requirement for identifier, program selector and info
was enforced in the AIDL utils class. The default implementation
and VTS were also updated correspondingly.

Bug: 261912181
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Ic420955340f0c77370106e736410d7125536e62d
2022-12-22 01:29:36 +00:00
Weilin Xu
d7483327cb Add onTuneFailed when canceling tuning operation
Due to RadioTuner API documentation, onTuneFailed should be called
when a pending tuning operation is canceled. Therefore, a new
result value Canceled was added in broadcast radio HAL. The
onTuneFailed callback for pending tuning operations in default HAL
was implemented by adding whatIfCanceled function field in Task
struct in WorkerThread utils class.

Bug: 257337458
Test: atest RadioTunerTest#cancel_whenTune
Test: atest RadioTunerTest#cancel_whenSeek
Change-Id: I901ab2cc3561082e5f11a9f6c33db044fc9bc28b
2022-12-07 19:36:15 +00:00
Weilin Xu
97203b0f3e Add adb shell command to default AIDL
Add adb shell commands to call methods of tune, seek, step, cancel,
startProgramListUpdates and stopProgramListUpdates in
BroadcastRadio HAL.

Bug: 170336130
Test: m -j
Test: manually test dump options listed in "adb shell dumpsys
android.hardware.broadcastradio.IBroadcastRadio/amfm --help"

Change-Id: I7aac96459f61c36dc9aae2d0a3866272f5bb9aed
2022-09-26 22:53:45 +00:00
Weilin Xu
b2a6ca6828 Default implementation for BroadcastRadio AIDL HAL
Default implementation for BroadcastRadio AIDL HAL is based on
default implementation for HIDL 2.0, with necessary data type
conversion. The callback for IBroadcastRadio interface is
initialized as nullptr.

Bug: 170336130
Test: m -j
Change-Id: Id521573116c565c42af16333cad73c5dd0583420
2022-09-21 23:22:47 +00:00