Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58f38f11 authored by Weilin Xu's avatar Weilin Xu Committed by Android (Google) Code Review
Browse files

Merge "Create a skeleton Rust broadcast radio HAL" into main

parents c8d5e536 6d71e46f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ aidl_interface {
            sdk_version: "module_current",
            min_sdk_version: "Tiramisu",
        },
        rust: {
            enabled: true,
        },
    },
    versions_with_info: [
        {
@@ -68,3 +71,10 @@ java_defaults {
        latest_android_hardware_broadcastradio + "-java",
    ],
}

rust_defaults {
    name: "latest_android_hardware_broadcastradio_rust",
    rustlibs: [
        latest_android_hardware_broadcastradio + "-rust",
    ],
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

rust_binary {
    name: "android.hardware.broadcastradio-rust-service",
    relative_install_path: "hw",
    vendor: true,
    srcs: ["src/*.rs"],
    crate_root: "src/main.rs",
    defaults: [
        "latest_android_hardware_broadcastradio_rust",
    ],
    vintf_fragments: ["broadcastradio-rust-service.xml"],
    init_rc: ["broadcastradio-rust-service.rc"],
    rustlibs: [
        "libbinder_rs",
    ],
}
+13 −0
Original line number Diff line number Diff line
# Rust Skeleton BroadcastRadio HAL implementation.

WARNING: This is not a reference BroadcastRadio HAL implementation and does
not contain any actual implementation.

This folder contains a skeleton broadcast radio HAL implementation in Rust to
demonstrate  how vendor may implement a Rust broadcast radio HAL. To run this
broadcast radio HAL, include `android.hardware.broadcastradio-rust-service`
in your image.

This implementation returns `StatusCode::UNKNOWN_ERROR` for all operations
and does not pass VTS/CTS. Vendor must replace the logic in
`default_broadcastradio_hal.rs` with the actual implementation
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
service vendor.broadcastradio-default /vendor/bin/hw/android.hardware.broadcastradio-service.default
    interface aidl android.hardware.broadcastradio.IBroadcastRadio/amfm
    class hal
    user audioserver
    group audio
+23 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<manifest version="1.0" type="device">
    <hal format="aidl">
        <name>android.hardware.broadcastradio</name>
        <version>2</version>
        <fqname>IBroadcastRadio/amfm</fqname>
    </hal>
</manifest>
Loading