Commit graph

300 commits

Author SHA1 Message Date
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
Treehugger Robot
9de2576962 Merge "Merge OWNERS files for broadcastradio" into main am: a7b29b6338 am: 9cc1248e47 am: daf86b6795 am: d168e5471b am: 59a177ff78
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2746937

Change-Id: If88502945bde89a1bca1060ea688e762bce4f482
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-09 02:59:27 +00:00
Treehugger Robot
59a177ff78 Merge "Merge OWNERS files for broadcastradio" into main am: a7b29b6338 am: 9cc1248e47 am: daf86b6795 am: d168e5471b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2746937

Change-Id: I06292a20c957d75246d0598ad55e47a1f76473ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-09 02:07:42 +00:00
Treehugger Robot
daf86b6795 Merge "Merge OWNERS files for broadcastradio" into main am: a7b29b6338 am: 9cc1248e47
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2746937

Change-Id: I40af77ad4741359753e4fea289824e45c6bad95f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-09 00:37:15 +00:00
Treehugger Robot
9cc1248e47 Merge "Merge OWNERS files for broadcastradio" into main am: a7b29b6338
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2746937

Change-Id: Ieed7e11e309fa3a8b4b0f622f5894bbfc104e40b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 23:43:07 +00:00
Devin Moore
fde9e2de74 Merge OWNERS files for broadcastradio
Test: none
Bug: 296950573
Change-Id: I2f6e58593b4b699ffc8334c25c595055b5f6c496
2023-09-08 22:53:01 +00:00
Weilin Xu
37a6abe4c6 Clarify unsigned int type in AIDL program id
Clarified that the value in ProgramIdentifier in AIDL broadcast radio
HAL should be unsigned 64-bit int, but is represented as signed int
since unsigned int types are not supported in AIDL.

Bug: 299489486
Test: m -j
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:40a58baa2cf0380dcab908a6f1e3cf8fd11d351c)
Merged-In: I2f35cefebdf1b5e39bf48cab896b077c4cb6c2e4
Change-Id: I2f35cefebdf1b5e39bf48cab896b077c4cb6c2e4
2023-09-08 22:27:43 +00:00
Weilin Xu
29c567b256 Merge "Clarify unsigned int type in AIDL program id" into main 2023-09-08 22:26:15 +00:00
Weilin Xu
5d9b066c04 Fix bcradio HAL unsigned int comparison error
Bug: 299489486
Test: atest VtsHalBroadcastradioAidlTargetTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:664048f21856ab30d5b713e524ef588f35747938)
Merged-In: I87fe60a593800535e0aadb0baf87696ee6844004
Change-Id: I87fe60a593800535e0aadb0baf87696ee6844004
2023-09-08 16:40:55 +00:00
Weilin Xu
40a58baa2c Clarify unsigned int type in AIDL program id
Clarified that the value in ProgramIdentifier in AIDL broadcast radio
HAL should be unsigned 64-bit int, but is represented as signed int
since unsigned int types are not supported in AIDL.

Bug: 299489486
Test: m -j
Change-Id: I2f35cefebdf1b5e39bf48cab896b077c4cb6c2e4
2023-09-08 09:27:25 -07: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
bce78d1105 Fix null pointer crash in AIDL radio HAL VTS am: cf892db1ef am: e065f848d0 am: 050c07c475
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/24133137

Change-Id: I52e0a5a66e613108fc60371cb382f3713b34f1b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20 21:32:03 +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
cf892db1ef Fix null pointer crash in AIDL radio HAL VTS
Bug: 277531858
Test: atest VtsHalBroadcastradioAidlTargetTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:978de0a8a4968774e81e10e716a46bd9e1369479)
Merged-In: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d
Change-Id: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d
2023-07-19 19:46:04 +00:00
Weilin Xu
978de0a8a4 Fix null pointer crash in AIDL radio HAL VTS
Bug: 277531858
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d
2023-07-19 17:20:19 +00:00
Treehugger Robot
13b2b44565 Merge "Fix wrong timeout and mock method in radio VTS" into stage-aosp-udc-ts-dev am: d8f18469c3 am: a0dc5d033c am: e25159e0e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/24068038

Change-Id: Icbf6430014b72004cfb3ed0035cf704e91344fc3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 22:12:41 +00:00
Weilin Xu
3729b0bd60 Fix wrong timeout and mock method in radio VTS
Fixed wrong time unit convension for timeout values used in broadcast
radio HAL VTS. Also replaced tuner callback mock method which caused
segmentation fault when unimplemented callback methods are called. In
addition, antenna connection state was checked at the end of the each
test instead of at the beginning.

Bug: 277531858
Test: atest VtsHalBroadcastradioAidlTargetTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4420c1dbbf28cc80ac47cdbafb9cc81034f8fc8f)
Merged-In: Ied70fcfd2742ae5d253aec984e2161afa6f65162
Change-Id: Ied70fcfd2742ae5d253aec984e2161afa6f65162
2023-07-14 00:09:26 +00:00
Weilin Xu
4420c1dbbf Fix wrong timeout and mock method in radio VTS
Fixed wrong time unit convension for timeout values used in broadcast
radio HAL VTS. Also replaced tuner callback mock method which caused
segmentation fault when unimplemented callback methods are called. In
addition, antenna connection state was checked at the end of the each
test instead of at the beginning.

Bug: 277531858
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Ied70fcfd2742ae5d253aec984e2161afa6f65162
2023-07-11 22:34:19 +00:00
Weilin Xu
0576dbcee8 Fixed metadata label in AIDL radio HAL Metadata
Bug: 287517076
Test: atest VtsHalBroadcastradioAidlTargetTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:285598dde00128cfc5fa5a9f7b7847d31daf3620)
Merged-In: I612ca079bda6f47446ec75ca7b4fece7317bd56d
Change-Id: I612ca079bda6f47446ec75ca7b4fece7317bd56d
2023-06-21 17:23:06 +00:00
Weilin Xu
285598dde0 Fixed metadata label in AIDL radio HAL Metadata
Bug: 287517076
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I612ca079bda6f47446ec75ca7b4fece7317bd56d
2023-06-20 23:58:37 +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
e2d763f25d Fix Result enum doc in AIDL broadcast radio HAL
Bug: 279789152
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I204f6c8836534e1bf6ff6309ca0172a2cbcc64a6
2023-04-26 21:49:32 +00: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
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
f6c673b497 Enable toString for Result in broadcast radio HAL
ToString is enabled for Result enum in AIDL broadcast radio HAL. Some
automatic generated files were also modified when updating this AIDL
API.

Bug: 264931778
Test: atest VtsHalBroadcastradioAidlTargetTest
Change-Id: Ia4ac02a95adbbcceac90c5b5106a7ea52dc447e9
2023-01-10 21:16:36 +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
Bob Badour
9fab4916b1 [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  automotive/remoteaccess/impl/default/proto/Android.bp
  broadcastradio/aidl/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Idb39e78e5e4181fef165afd5451ac79597c89bfb
2022-09-29 11:59:23 -07:00
Weilin Xu
3277a210d8 Add VTS on config and parameter for AIDL radio HAL
Invalid and valid configuration and parameter inputs are tested
on broadcast radio AIDL HAL.

Test: atest VtsHalBroadcastradioAidlTargetTest
Bug: 249150763
Change-Id: If75d8318f493a8c5332064e5b09ecae102587266
2022-09-27 17:13:52 +00:00
Weilin Xu
b23d0ea0a9 Add VTS test for BroadcastRadio AIDL HAL
Tested methods defined in IBroadcastRadio. Methods such as tune,
seek, step and startProgramListUpdates are tested by the times of
that the mock of ITunerCallback, which is registered to
IBroadcastRadio, is called within timeout.

Bug: 249150763
Test: m -j, atest VtsHalBroadcastradioAidlTargetTest
Change-Id: I84cb0da741dbcaf24a6562813846e81c23bbb1f1
2022-09-27 17:12:59 +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
Weilin Xu
a8cebd5c8f Migrate broadcast radio HAL from HIDL to AIDL
Radio HAL is migrated to AIDL by hidl2aidl tool, and the
following changes are applied:
- Result type is returned as service-specific error than normal
return value since AIDL only allows one return value of primitive
types.
- Integer data types were changed to int, long and byte.
- Constant enum was removed and replaced by constants defined in
IBroadcastRadio.
- Rds and Deemphasis enums were removed and defined as const in
AmFmRegionConfig
- MetadataKey was removed, and Metadata was defined as union.
- ITunerSession:scan() was renamed to ITunerSession:seek().
- ITunerSession was removed and its methods were added to
IBroadcastRadio.
- Callback for config flag setting was added to ITunerCallback.
- Callback and timeout behaviors are clarified.

Bug: 170336130
Test: m -j
Change-Id: Id1cdc5651037429ca07a4d4dc4682709cfc4949b
2022-09-21 23:09:50 +00:00
Weilin Xu
bd15745bf2 Added new owner to broadcast AIDL HAL
Bug: 170336130
Test: m -j
Change-Id: I63d6c0f1a32b7f75a17b0c1a4e1d9b47bdc9a17f
2022-08-26 23:54:26 +00:00
Weilin Xu
9f4ff57bc1 Fix invalid DAB station in default radio HAL
The SID and ensemble value of mock DAB station for default
emulator implementation is changed to valid value.

Bug: 240196218
Test: m -j
Change-Id: Ifd34b86a00c29c15c5ef6d21d6d405eb0b1ff072
2022-08-02 18:26:44 +00:00
Weilin Xu
6821a3028f Merge "Fix programList update bug in default radio HAL" 2022-07-07 16:18:14 +00:00
Weilin Xu
ef5fb7de0e Merge "Added new owner to broadcast radio HIDL HAL" am: 093c4dc50b am: 1a6d0bea4b am: 73aa4b8b1c am: 67ccee2530 am: 715a6dff7b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2138233

Change-Id: Ib153cf9624c231a9a40815d43e770a89b9d07b28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 18:56:57 +00:00
Weilin Xu
8de55ffd99 Fix programList update bug in default radio HAL
In default implementation of broadcast radio HIDL2 HAL, the
filtered program list is actually not used in callback function.
Use the filtered program list rather than the whole list for the
program list chunk used in onProgramListUpdated callback. Extra
VTS tests checking whether program list update using AMFM and DAB
filters gets the expected program list results are also added.

Bug: 237412013
Test: m -j
Test: atest VtsHalBroadcastradioV2_0TargetTest
Change-Id: I5969638f14a39b9aea2d8b465f3a7fbcd93a8409
2022-06-29 18:25:33 +00:00
Weilin Xu
c23eb77ff3 Added new owner to broadcast radio HIDL HAL
Bug: 232461611
Test: m -j
Change-Id: Ia788c58763b29723cf16d3a9164c19237a0258dd
2022-06-28 19:58:59 +00:00
Keith Mok
b12109202a broadcast-hal: Fix mThread race condition
Currently mThread is started in initializer list, but
not in constructor, when the thread starts in initializer
list, not all class members are init yet (depends on the
order of class member declarations).
And mThread will use class members.

Putting mThread to starts in constructor ensures all
class member variables  are init before thread starts.

Bug: 231737939
Test: build
Change-Id: I4033efa9f13c2ece95c4b4f99f8c88b6d4816be1
2022-05-07 05:38:01 +00:00
Tom Pratt
9d268857c8 Add vintf fragment for default broadcastradio
Bug: b/145694104
Test: Build and boot emulator locally. Observe
that CarRadio app shows static data provided by
default broadcast radio.

Change-Id: Ia70e8a040cb281f3d0e8fc7f3a8dd25bcd6d09bd
Merged-In: Ia70e8a040cb281f3d0e8fc7f3a8dd25bcd6d09bd
2022-03-14 21:46:12 +00:00
Tom Pratt
7b346190c5 Add vintf fragment for default broadcastradio
Bug: b/145694104
Test: Build and boot emulator locally. Observe
that CarRadio app shows static data provided by
default broadcast radio.

Change-Id: Ia70e8a040cb281f3d0e8fc7f3a8dd25bcd6d09bd
2022-03-10 22:41:56 -08:00
Chih-Hung Hsieh
ad1bf31b78 Add timed out test files to tidy_timeout_srcs
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
  the following settings:
    TIDY_TIMEOUT=90
    WITH_TIDY=1
    CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
  tidy_timeout_srcs files will not be compiled by clang-tidy.
  When developers build locally without TIDY_TIMEOUT,
  tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
  or disable some time consuming checks, and then
  enable clang-tidy to run within limited time.

Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
2022-02-18 17:25:41 -08:00
yidong zhang
f31ae8d496 broadcastradio 2.0: uses correct interface tag.
Served and Declared should be the same.
android.hardware.broadcastradio@2.0::IBroadcastRadio/amfm
android.hardware.broadcastradio@2.0::IBroadcastRadio/dab

Test: run vts -m vts_ibase_test
Change-Id: Iff8e4c562d8cf6492f3c88c2bfe9fccf19906a95
Signed-off-by: yidong zhang <yidong.zhang@amlogic.com>
2022-02-14 14:59:28 +08:00
Yiming Pan
0dd042634b Merge "Backfill owner information for VTS module VtsHalBroadcastradioV1_1TargetTest." 2021-09-30 19:09:29 +00:00
Yiming Pan
84cadeb7e9 Backfill owner information for VTS module VtsHalBroadcastradioV1_1TargetTest.
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: I6545fdf32f1181af8bb179e843b12edb4c2c0073
2021-09-29 20:58:19 -07:00
Yiming Pan
c3a30ff53e Merge "Backfill owner information for VTS module VtsHalBroadcastradioV1_0TargetTest." 2021-09-29 22:42:07 +00:00
Yiming Pan
5fabea0a5b Backfill owner information for VTS module VtsHalBroadcastradioV1_0TargetTest.
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: I06651b2ebbc622e59d240b3b988beffd8887459e
2021-09-29 13:32:51 -07:00
LaMont Jones
f0bb568508 Stop using group_static_libs property
This property is now ignored, so there is no need to set it.
For more details, see the bug and/or "Effecient archive file handling"
in https://lld.llvm.org/NewLLD.html#key-concepts

Bug: 189475744
Test: Manual build succeeds
Change-Id: I2585f840736f0647c50fcf0b7b78bd33383f6451
2021-08-30 23:20:08 +00:00