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

Commit 7c1fe0a1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'tv-input'

* changes:
  tv.input: add android.hardware.tv.input@1.0-(impl|service)
  tv.input: add HIDL definition for TV Input HAL
parents 5af50b37 7408849a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ subdirs = [
    "tests/pointer/1.0/default/lib",
    "thermal/1.0",
    "thermal/1.0/default",
    "tv/input/1.0",
    "vehicle/2.0",
    "vibrator/1.0",
    "vibrator/1.0/default",
+55 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

genrule {
    name: "android.hardware.tv.input@1.0_genc++",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tv.input@1.0",
    srcs: [
        "types.hal",
        "ITvInput.hal",
        "ITvInputCallback.hal",
    ],
    out: [
        "android/hardware/tv/input/1.0/types.cpp",
        "android/hardware/tv/input/1.0/TvInputAll.cpp",
        "android/hardware/tv/input/1.0/TvInputCallbackAll.cpp",
    ],
}

genrule {
    name: "android.hardware.tv.input@1.0_genc++_headers",
    tool: "hidl-gen",
    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.tv.input@1.0",
    srcs: [
        "types.hal",
        "ITvInput.hal",
        "ITvInputCallback.hal",
    ],
    out: [
        "android/hardware/tv/input/1.0/types.h",
        "android/hardware/tv/input/1.0/ITvInput.h",
        "android/hardware/tv/input/1.0/IHwTvInput.h",
        "android/hardware/tv/input/1.0/BnTvInput.h",
        "android/hardware/tv/input/1.0/BpTvInput.h",
        "android/hardware/tv/input/1.0/BsTvInput.h",
        "android/hardware/tv/input/1.0/ITvInputCallback.h",
        "android/hardware/tv/input/1.0/IHwTvInputCallback.h",
        "android/hardware/tv/input/1.0/BnTvInputCallback.h",
        "android/hardware/tv/input/1.0/BpTvInputCallback.h",
        "android/hardware/tv/input/1.0/BsTvInputCallback.h",
    ],
}

cc_library_shared {
    name: "android.hardware.tv.input@1.0",
    generated_sources: ["android.hardware.tv.input@1.0_genc++"],
    generated_headers: ["android.hardware.tv.input@1.0_genc++_headers"],
    export_generated_headers: ["android.hardware.tv.input@1.0_genc++_headers"],
    shared_libs: [
        "libhidl",
        "libhwbinder",
        "libutils",
        "libcutils",
        "android.hardware.audio.common@2.0",
    ],
}
+79 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.
 */

package android.hardware.tv.input@1.0;

import ITvInputCallback;

interface ITvInput {
    /*
     * Sets a callback for events.
     *
     * Note that initially no device is available in the client side, so the
     * implementation must notify all the currently available devices including
     * static devices via callback once callback is set.
     *
     * @param callback Callback object to pass events.
     */
    @entry
    @exit
    @callflow(next={"getStreamConfigurations"})
    setCallback(ITvInputCallback callback);

    /*
     * Gets stream configurations for a specific device.
     *
     * The configs object is valid only until the next
     * STREAM_CONFIGURATIONS_CHANGED event.
     *
     * @param deviceId Device ID for the configurations.
     * @return result OK upon success. Otherwise,
     *         INVALID_ARGUMENTS if the given device ID is not valid.
     * @return configurations An array of available configurations.
     */
    @callflow(next={"openStream", "getStreamConfigurations", "closeStream"})
    getStreamConfigurations(int32_t deviceId)
            generates (Result result, vec<TvStreamConfig> configurations);

    /*
     * Opens a specific stream in a device.
     *
     * @param deviceId Device ID for the steam to open.
     * @param streamId Steam ID for the steam to open. Must be one of the
     *         stream IDs returned from getStreamConfigurations().
     * @return result OK upon success. Otherwise,
     *         INVALID_ARGUMENTS if any of given IDs are not valid;
     *         INVALID_STATE if the stream with the given ID is already open;
     *         NO_RESOURCE if the client must close other streams to open the
     *                 stream.
     * @return sidebandStream handle for sideband stream.
     */
    @callflow(next={"closeStream", "getStreamConfigurations", "openStream"})
    openStream(int32_t deviceId, int32_t streamId)
            generates (Result result, handle sidebandStream);

    /*
     * Closes a specific stream in a device.
     *
     * @param deviceId Device ID for the steam to open.
     * @param streamId Steam ID for the steam to open.
     * @return result OK upon success. Otherwise,
     *         INVALID_ARGUMENTS if any of given IDs are not valid;
     *         INVALID_STATE if the stream with the given ID is not open.
     */
    @callflow(next={"getStreamConfigurations", "openStream", "closeStream"})
    closeStream(int32_t deviceId, int32_t streamId) generates (Result result);
};
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.
 */

package android.hardware.tv.input@1.0;

interface ITvInputCallback {
    /*
     * Notifies the client that an event has occured. For possible event types,
     * check TvInputEventType.
     *
     * @param event Event passed to the client.
     */
    notify(TvInputEvent event);
};
+44 −0
Original line number Diff line number Diff line
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.tv.input@1.0-impl
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
    TvInput.cpp \

LOCAL_SHARED_LIBRARIES := \
    libbase \
    liblog \
    libhardware \
    libhidl \
    libhwbinder \
    libutils \
    android.hardware.audio.common@2.0 \
    android.hardware.tv.input@1.0 \

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE := android.hardware.tv.input@1.0-service
LOCAL_INIT_RC := android.hardware.tv.input@1.0-service.rc
LOCAL_SRC_FILES := \
    service.cpp \

LOCAL_SHARED_LIBRARIES := \
    liblog \
    libcutils \
    libdl \
    libbase \
    libutils \
    libhardware_legacy \
    libhardware \

LOCAL_SHARED_LIBRARIES += \
    libhwbinder \
    libhidl \
    android.hardware.audio.common@2.0 \
    android.hardware.tv.input@1.0 \

include $(BUILD_EXECUTABLE)
Loading