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

Commit bdef4b98 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Android (Google) Code Review
Browse files

Merge "Create Broadcast radio HAL 1.1; implement DigitalStatus enum."

parents 77b2bf00 213170b6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ LOCAL_SHARED_LIBRARIES := \
    android.hardware.audio.common@2.0 \
    android.hardware.audio.effect@2.0 \
    android.hardware.soundtrigger@2.0 \
    android.hardware.broadcastradio@1.0
    android.hardware.broadcastradio@1.0 \
    android.hardware.broadcastradio@1.1

ifeq ($(strip $(AUDIOSERVER_MULTILIB)),)
LOCAL_MULTILIB := 32
@@ -77,4 +78,8 @@ else
LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
endif

ifeq ($(TARGET_USES_BCRADIO_FUTURE_FEATURES),true)
LOCAL_CFLAGS += -DTARGET_USES_BCRADIO_FUTURE_FEATURES
endif

include $(BUILD_EXECUTABLE)
+15 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
#include <android/hardware/soundtrigger/2.0/ISoundTriggerHw.h>
#include <android/hardware/broadcastradio/1.0/IBroadcastRadioFactory.h>
#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>

using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
@@ -31,7 +32,13 @@ using android::hardware::audio::effect::V2_0::IEffectsFactory;
using android::hardware::audio::V2_0::IDevicesFactory;
using android::hardware::soundtrigger::V2_0::ISoundTriggerHw;
using android::hardware::registerPassthroughServiceImplementation;
using android::hardware::broadcastradio::V1_0::IBroadcastRadioFactory;
namespace broadcastradio = android::hardware::broadcastradio;

#ifdef TARGET_USES_BCRADIO_FUTURE_FEATURES
static const bool useBroadcastRadioFutureFeatures = true;
#else
static const bool useBroadcastRadioFutureFeatures = false;
#endif

using android::OK;

@@ -45,7 +52,13 @@ int main(int /* argc */, char* /* argv */ []) {
    // Soundtrigger and FM radio might be not present.
    status = registerPassthroughServiceImplementation<ISoundTriggerHw>("sound_trigger.primary");
    ALOGE_IF(status != OK, "Error while registering soundtrigger service: %d", status);
    status = registerPassthroughServiceImplementation<IBroadcastRadioFactory>();
    if (useBroadcastRadioFutureFeatures) {
        status = registerPassthroughServiceImplementation<
            broadcastradio::V1_1::IBroadcastRadioFactory>();
    } else {
        status = registerPassthroughServiceImplementation<
            broadcastradio::V1_0::IBroadcastRadioFactory>();
    }
    ALOGE_IF(status != OK, "Error while registering fm radio service: %d", status);
    joinRpcThreadpool();
    return status;
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ using ::android::hardware::broadcastradio::V1_0::ProgramInfo;
using ::android::hardware::broadcastradio::V1_0::MetaData;


// The main test class for Sound Trigger HIDL HAL.
// The main test class for Broadcast Radio HIDL HAL.

class BroadcastRadioHidlTest : public ::testing::Test {
 protected:
+76 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

filegroup {
    name: "android.hardware.broadcastradio@1.1_hal",
    srcs: [
        "types.hal",
        "IBroadcastRadioFactory.hal",
        "ITuner.hal",
        "ITunerCallback.hal",
    ],
}

genrule {
    name: "android.hardware.broadcastradio@1.1_genc++",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.1",
    srcs: [
        ":android.hardware.broadcastradio@1.1_hal",
    ],
    out: [
        "android/hardware/broadcastradio/1.1/types.cpp",
        "android/hardware/broadcastradio/1.1/BroadcastRadioFactoryAll.cpp",
        "android/hardware/broadcastradio/1.1/TunerAll.cpp",
        "android/hardware/broadcastradio/1.1/TunerCallbackAll.cpp",
    ],
}

genrule {
    name: "android.hardware.broadcastradio@1.1_genc++_headers",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.broadcastradio@1.1",
    srcs: [
        ":android.hardware.broadcastradio@1.1_hal",
    ],
    out: [
        "android/hardware/broadcastradio/1.1/types.h",
        "android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h",
        "android/hardware/broadcastradio/1.1/IHwBroadcastRadioFactory.h",
        "android/hardware/broadcastradio/1.1/BnHwBroadcastRadioFactory.h",
        "android/hardware/broadcastradio/1.1/BpHwBroadcastRadioFactory.h",
        "android/hardware/broadcastradio/1.1/BsBroadcastRadioFactory.h",
        "android/hardware/broadcastradio/1.1/ITuner.h",
        "android/hardware/broadcastradio/1.1/IHwTuner.h",
        "android/hardware/broadcastradio/1.1/BnHwTuner.h",
        "android/hardware/broadcastradio/1.1/BpHwTuner.h",
        "android/hardware/broadcastradio/1.1/BsTuner.h",
        "android/hardware/broadcastradio/1.1/ITunerCallback.h",
        "android/hardware/broadcastradio/1.1/IHwTunerCallback.h",
        "android/hardware/broadcastradio/1.1/BnHwTunerCallback.h",
        "android/hardware/broadcastradio/1.1/BpHwTunerCallback.h",
        "android/hardware/broadcastradio/1.1/BsTunerCallback.h",
    ],
}

cc_library_shared {
    name: "android.hardware.broadcastradio@1.1",
    generated_sources: ["android.hardware.broadcastradio@1.1_genc++"],
    generated_headers: ["android.hardware.broadcastradio@1.1_genc++_headers"],
    export_generated_headers: ["android.hardware.broadcastradio@1.1_genc++_headers"],
    shared_libs: [
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "liblog",
        "libutils",
        "libcutils",
        "android.hardware.broadcastradio@1.0",
    ],
    export_shared_lib_headers: [
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "libutils",
        "android.hardware.broadcastradio@1.0",
    ],
}
+19 −0
Original line number Diff line number Diff line
#
# Copyright (C) 2017 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.
#

LOCAL_PATH := $(call my-dir)

include $(call all-subdir-makefiles)
Loading