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

Commit 16606119 authored by Jungshik Jang's avatar Jungshik Jang Committed by Android (Google) Code Review
Browse files

Merge "Replace osd message for record status with IHdmiRecordCallback." into lmp-dev

parents db573fc0 12e5dcef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ LOCAL_SRC_FILES += \
	core/java/android/hardware/hdmi/IHdmiDeviceEventListener.aidl \
	core/java/android/hardware/hdmi/IHdmiHotplugEventListener.aidl \
	core/java/android/hardware/hdmi/IHdmiInputChangeListener.aidl \
	core/java/android/hardware/hdmi/IHdmiRecordRequestListener.aidl \
	core/java/android/hardware/hdmi/IHdmiRecordListener.aidl \
	core/java/android/hardware/hdmi/IHdmiSystemAudioModeChangeListener.aidl \
	core/java/android/hardware/hdmi/IHdmiVendorCommandListener.aidl \
	core/java/android/hardware/input/IInputManager.aidl \
+41 −31
Original line number Diff line number Diff line
@@ -69,69 +69,71 @@ public final class HdmiControlManager {
    public static final int RESULT_INCORRECT_MODE = 6;
    public static final int RESULT_COMMUNICATION_FAILED = 7;

    // -- Message ids for display osd.

    /** Place holder for recording status message. Indicates the status of a recording. */
    public static final int MESSAGE_RECORDING_STATUS_MESSAGE_START = 0x100;
    // --- One Touch Recording success result
    /** Recording currently selected source. Indicates the status of a recording. */
    public static final int MESSAGE_RECORDING_CURRENTLY_SELECTED_SOURCE = 0x101;
    public static final int ONE_TOUCH_RECORD_RECORDING_CURRENTLY_SELECTED_SOURCE = 0x01;
    /** Recording Digital Service. Indicates the status of a recording. */
    public static final int MESSAGE_RECORDING_DIGITAL_SERVICE = 0x102;
    public static final int ONE_TOUCH_RECORD_RECORDING_DIGITAL_SERVICE = 0x02;
    /** Recording Analogue Service. Indicates the status of a recording. */
    public static final int MESSAGE_RECORDING_ANALOGUE_SERVICE = 0x103;
    public static final int ONE_TOUCH_RECORD_RECORDING_ANALOGUE_SERVICE = 0x03;
    /** Recording External input. Indicates the status of a recording. */
    public static final int MESSAGE_RECORDING_EXTERNAL_INPUT = 0x104;
    public static final int ONE_TOUCH_RECORD_RECORDING_EXTERNAL_INPUT = 0x04;

    // --- One Touch Record failure result
    /** No recording – unable to record Digital Service. No suitable tuner. */
    public static final int MESSAGE_NO_RECORDNIG_UNABLE_DIGITAL_SERVICE = 0x105;
    public static final int ONE_TOUCH_RECORD_UNABLE_DIGITAL_SERVICE = 0x05;
    /** No recording – unable to record Analogue Service. No suitable tuner. */
    public static final int MESSAGE_NO_RECORDNIG_UNABLE_ANALOGUE_SERVICE = 0x106;
    public static final int ONE_TOUCH_RECORD_UNABLE_ANALOGUE_SERVICE = 0x06;
    /**
     * No recording – unable to select required service. as suitable tuner, but the requested
     * parameters are invalid or out of range for that tuner.
     */
    public static final int MESSAGE_NO_RECORDNIG_UNABLE_SELECTED_SERVICE = 0x107;
    public static final int ONE_TOUCH_RECORD_UNABLE_SELECTED_SERVICE = 0x07;
    /** No recording – invalid External plug number */
    public static final int MESSAGE_NO_RECORDNIG_INVALID_EXTERNAL_PLUG_NUMBER = 0x109;
    public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PLUG_NUMBER = 0x09;
    /** No recording – invalid External Physical Address */
    public static final int MESSAGE_NO_RECORDNIG_INVALID_EXTERNAL_PHYSICAL_ADDRESS = 0x10A;
    public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PHYSICAL_ADDRESS = 0x0A;
    /** No recording – CA system not supported */
    public static final int MESSAGE_NO_RECORDNIG_UNSUPPORTED_CA = 0x10B;
    public static final int ONE_TOUCH_RECORD_UNSUPPORTED_CA = 0x0B;
    /** No Recording – No or Insufficient CA Entitlements” */
    public static final int MESSAGE_NO_RECORDNIG_NO_OR_INSUFFICIENT_CA_ENTITLEMENTS = 0x10C;
    public static final int ONE_TOUCH_RECORD_NO_OR_INSUFFICIENT_CA_ENTITLEMENTS = 0x0C;
    /** No recording – Not allowed to copy source. Source is “copy never”. */
    public static final int MESSAGE_NO_RECORDNIG_DISALLOW_TO_COPY = 0x10D;
    public static final int ONE_TOUCH_RECORD_DISALLOW_TO_COPY = 0x0D;
    /** No recording – No further copies allowed */
    public static final int MESSAGE_NO_RECORDNIG_DISALLOW_TO_FUTHER_COPIES = 0x10E;
    public static final int ONE_TOUCH_RECORD_DISALLOW_TO_FUTHER_COPIES = 0x0E;
    /** No recording – No media */
    public static final int MESSAGE_NO_RECORDNIG_NO_MEDIA = 0x110;
    public static final int ONE_TOUCH_RECORD_NO_MEDIA = 0x10;
    /** No recording – playing */
    public static final int MESSAGE_NO_RECORDNIG_PLAYING = 0x111;
    public static final int ONE_TOUCH_RECORD_PLAYING = 0x11;
    /** No recording – already recording */
    public static final int MESSAGE_NO_RECORDNIG_ALREADY_RECORDING = 0x112;
    public static final int ONE_TOUCH_RECORD_ALREADY_RECORDING = 0x12;
    /** No recording – media protected */
    public static final int MESSAGE_NO_RECORDNIG_MEDIA_PROTECTED = 0x113;
    public static final int ONE_TOUCH_RECORD_MEDIA_PROTECTED = 0x13;
    /** No recording – no source signal */
    public static final int MESSAGE_NO_RECORDNIG_NO_SOURCE_SIGNAL = 0x114;
    public static final int ONE_TOUCH_RECORD_NO_SOURCE_SIGNAL = 0x14;
    /** No recording – media problem */
    public static final int MESSAGE_NO_RECORDNIG_MEDIA_PROBLEM = 0x115;
    public static final int ONE_TOUCH_RECORD_MEDIA_PROBLEM = 0x15;
    /** No recording – not enough space available */
    public static final int MESSAGE_NO_RECORDNIG_NOT_ENOUGH_SPACE = 0x116;
    public static final int ONE_TOUCH_RECORD_NOT_ENOUGH_SPACE = 0x16;
    /** No recording – Parental Lock On */
    public static final int MESSAGE_NO_RECORDNIG_PARENT_LOCK_ON = 0x117;
    public static final int ONE_TOUCH_RECORD_PARENT_LOCK_ON = 0x17;
    /** Recording terminated normally */
    public static final int MESSAGE_RECORDING_TERMINATED_NORMALLY = 0x11A;
    public static final int ONE_TOUCH_RECORD_RECORDING_TERMINATED_NORMALLY = 0x1A;
    /** Recording has already terminated */
    public static final int MESSAGE_RECORDING_ALREADY_TERMINATED = 0x11B;
    public static final int ONE_TOUCH_RECORD_RECORDING_ALREADY_TERMINATED = 0x1B;
    /** No recording – other reason */
    public static final int MESSAGE_NO_RECORDNIG_OTHER_REASON = 0x11F;
    public static final int ONE_TOUCH_RECORD_OTHER_REASON = 0x1F;
    // From here extra message for recording that is not mentioned in CEC spec
    /** No recording. Previous recording request in progress. */
    public static final int MESSAGE_NO_RECORDING_PREVIOUS_RECORDING_IN_PROGRESS = 0x130;
    public static final int ONE_TOUCH_RECORD_PREVIOUS_RECORDING_IN_PROGRESS = 0x30;
    /** No recording. Please check recorder and connection. */
    public static final int MESSAGE_NO_RECORDING_CHECK_RECORDER_CONNECTION = 0x131;
    public static final int ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION = 0x31;
    /** Cannot record currently displayed source. */
    public static final int MESSAGE_NO_RECORDING_FAIL_TO_RECORD_DISPLAYED_SCREEN = 0x132;
    public static final int ONE_TOUCH_RECORD_FAIL_TO_RECORD_DISPLAYED_SCREEN = 0x32;
    /** CEC is disabled. */
    public static final int ONE_TOUCH_RECORD_CEC_DISABLED = 0x33;

    // --- Types for timer recording
    /** Timer recording type for digital service source. */
    public static final int TIMER_RECORDING_TYPE_DIGITAL = 1;
    /** Timer recording type for analogue service source. */
@@ -139,6 +141,14 @@ public final class HdmiControlManager {
    /** Timer recording type for external source. */
    public static final int TIMER_RECORDING_TYPE_EXTERNAL = 3;

    // --- Extra result value for timer recording.
    /** No timer recording - check recorder and connection. */
    public static final int TIME_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION = 0x01;
    /** No timer recording - cannot record selected source. */
    public static final int TIME_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE = 0x02;
    /** CEC is disabled. */
    public static final int TIME_RECORDING_RESULT_EXTRA_CEC_DISABLED = 0x33;

    // True if we have a logical device of type playback hosted in the system.
    private final boolean mHasPlaybackDevice;
    // True if we have a logical device of type TV hosted in the system.
+67 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 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.hdmi;

import android.annotation.SystemApi;
import android.hardware.hdmi.HdmiRecordSources.RecordSource;

/**
 * Listener for hdmi record feature including one touch record and timer recording.
 * @hide
 */
@SystemApi
public abstract class HdmiRecordListener {
    protected HdmiRecordListener() {}

    /**
     * Called when TV received one touch record request from record device. The client of this
     * should use {@link HdmiRecordSources} to return it.
     *
     * @param recorderAddress
     * @return record source to be used for recording. Null if no device is available.
     */
    public abstract RecordSource getOneTouchRecordSource(int recorderAddress);

    /**
     * Called when one touch record is started or failed during initialization.
     *
     * @param result result code. For more details, please look at all constants starting with
     *            "ONE_TOUCH_RECORD_". Only
     *            {@link HdmiControlManager#ONE_TOUCH_RECORD_RECORDING_CURRENTLY_SELECTED_SOURCE},
     *            {@link HdmiControlManager#ONE_TOUCH_RECORD_RECORDING_DIGITAL_SERVICE},
     *            {@link HdmiControlManager#ONE_TOUCH_RECORD_RECORDING_ANALOGUE_SERVICE}, and
     *            {@link HdmiControlManager#ONE_TOUCH_RECORD_RECORDING_EXTERNAL_INPUT} mean normal
     *            start of recording; otherwise, describes failure.
     */
    public void onOneTouchRecordResult(int result) {
    }

    /**
     * Called when timer recording is started or failed during initialization.
     *
     * @param result The most significant three bytes may contain result of <Timer Status>
     *        while the least significant byte may have error message like
     *        {@link HdmiControlManager#TIME_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION}
     *        or
     *        {@link HdmiControlManager #TIME_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE}
     *        . If the least significant byte has non zero value the most significant three bytes
     *        may have 0 value.
     */
    // TODO: implement result parser.
    public void onTimerRecordingResult(int result) {
    }
}
+5 −4
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ public final class HdmiRecordSources {
        /** Indicates that a service is identified by a logical or virtual channel number. */
        private static final int DIGITAL_SERVICE_IDENTIFIED_BY_CHANNEL = 1;

        private static final int EXTRA_DATA_SIZE = 7;
        static final int EXTRA_DATA_SIZE = 7;

        /**
         * Type of identification. It should be one of DIGITAL_SERVICE_IDENTIFIED_BY_DIGITAL_ID and
@@ -609,7 +609,7 @@ public final class HdmiRecordSources {
     */
    @SystemApi
    public static final class AnalogueServiceSource extends RecordSource {
        private static final int EXTRA_DATA_SIZE = 4;
        static final int EXTRA_DATA_SIZE = 4;

        /** Indicates the Analogue broadcast type. */
        private final int mBroadcastType;
@@ -668,7 +668,7 @@ public final class HdmiRecordSources {
     */
    @SystemApi
    public static final class ExternalPlugData extends RecordSource {
        private static final int EXTRA_DATA_SIZE = 1;
        static final int EXTRA_DATA_SIZE = 1;

        /** External Plug number on the Recording Device. */
        private final int mPlugNumber;
@@ -713,7 +713,7 @@ public final class HdmiRecordSources {
     */
    @SystemApi
    public static final class ExternalPhysicalAddress extends RecordSource {
        private static final int EXTRA_DATA_SIZE = 2;
        static final int EXTRA_DATA_SIZE = 2;

        private final int mPhysicalAddress;

@@ -751,6 +751,7 @@ public final class HdmiRecordSources {
     * Check the byte array of record source.
     * @hide
     */
    @SystemApi
    public static boolean checkRecordSource(byte[] recordSource) {
        int recordSourceType = recordSource[0];
        int extraDataSize = recordSource.length - 1;
+35 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

package android.hardware.hdmi;

import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_ANALOGUE;
import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_DIGITAL;
import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_EXTERNAL;

import android.annotation.SystemApi;
import android.hardware.hdmi.HdmiRecordSources.AnalogueServiceSource;
import android.hardware.hdmi.HdmiRecordSources.DigitalServiceSource;
@@ -420,4 +424,35 @@ public class HdmiTimerRecordSources {
            return getDataSize(false);
        }
    }

    /**
     * Check the byte array of timer record source.
     * @param sourcetype
     * @param recordSource
     * @hide
     */
    @SystemApi
    public static boolean checkTimerRecordSource(int sourcetype, byte[] recordSource) {
        int recordSourceSize = recordSource.length - TimerInfo.BASIC_INFO_SIZE;
        switch (sourcetype) {
            case TIMER_RECORDING_TYPE_DIGITAL:
                return DigitalServiceSource.EXTRA_DATA_SIZE == recordSourceSize;
            case TIMER_RECORDING_TYPE_ANALOGUE:
                return AnalogueServiceSource.EXTRA_DATA_SIZE == recordSourceSize;
            case TIMER_RECORDING_TYPE_EXTERNAL:
                int specifier = recordSource[TimerInfo.BASIC_INFO_SIZE];
                if (specifier == EXTERNAL_SOURCE_SPECIFIER_EXTERNAL_PLUG) {
                    // One byte for specifier.
                    return ExternalPlugData.EXTRA_DATA_SIZE + 1 == recordSourceSize;
                } else if (specifier == EXTERNAL_SOURCE_SPECIFIER_EXTERNAL_PHYSICAL_ADDRESS) {
                    // One byte for specifier.
                    return ExternalPhysicalAddress.EXTRA_DATA_SIZE + 1 == recordSourceSize;
                } else {
                    // Invalid specifier.
                    return false;
                }
            default:
                return false;
        }
    }
}
Loading