1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.hardware.hdmi;
18 
19 import android.hardware.hdmi.HdmiDeviceInfo;
20 import android.hardware.hdmi.HdmiPortInfo;
21 import android.hardware.hdmi.IHdmiControlCallback;
22 import android.hardware.hdmi.IHdmiControlStatusChangeListener;
23 import android.hardware.hdmi.IHdmiDeviceEventListener;
24 import android.hardware.hdmi.IHdmiHotplugEventListener;
25 import android.hardware.hdmi.IHdmiInputChangeListener;
26 import android.hardware.hdmi.IHdmiMhlVendorCommandListener;
27 import android.hardware.hdmi.IHdmiRecordListener;
28 import android.hardware.hdmi.IHdmiSystemAudioModeChangeListener;
29 import android.hardware.hdmi.IHdmiVendorCommandListener;
30 
31 import java.util.List;
32 
33 /**
34  * Binder interface that clients running in the application process
35  * will use to perform HDMI-CEC features by communicating with other devices
36  * on the bus.
37  *
38  * @hide
39  */
40 interface IHdmiControlService {
getSupportedTypes()41     int[] getSupportedTypes();
getActiveSource()42     HdmiDeviceInfo getActiveSource();
oneTouchPlay(IHdmiControlCallback callback)43     void oneTouchPlay(IHdmiControlCallback callback);
queryDisplayStatus(IHdmiControlCallback callback)44     void queryDisplayStatus(IHdmiControlCallback callback);
addHdmiControlStatusChangeListener(IHdmiControlStatusChangeListener listener)45     void addHdmiControlStatusChangeListener(IHdmiControlStatusChangeListener listener);
removeHdmiControlStatusChangeListener(IHdmiControlStatusChangeListener listener)46     void removeHdmiControlStatusChangeListener(IHdmiControlStatusChangeListener listener);
addHotplugEventListener(IHdmiHotplugEventListener listener)47     void addHotplugEventListener(IHdmiHotplugEventListener listener);
removeHotplugEventListener(IHdmiHotplugEventListener listener)48     void removeHotplugEventListener(IHdmiHotplugEventListener listener);
addDeviceEventListener(IHdmiDeviceEventListener listener)49     void addDeviceEventListener(IHdmiDeviceEventListener listener);
deviceSelect(int deviceId, IHdmiControlCallback callback)50     void deviceSelect(int deviceId, IHdmiControlCallback callback);
portSelect(int portId, IHdmiControlCallback callback)51     void portSelect(int portId, IHdmiControlCallback callback);
sendKeyEvent(int deviceType, int keyCode, boolean isPressed)52     void sendKeyEvent(int deviceType, int keyCode, boolean isPressed);
sendVolumeKeyEvent(int deviceType, int keyCode, boolean isPressed)53     void sendVolumeKeyEvent(int deviceType, int keyCode, boolean isPressed);
getPortInfo()54     List<HdmiPortInfo> getPortInfo();
canChangeSystemAudioMode()55     boolean canChangeSystemAudioMode();
getSystemAudioMode()56     boolean getSystemAudioMode();
getPhysicalAddress()57     int getPhysicalAddress();
setSystemAudioMode(boolean enabled, IHdmiControlCallback callback)58     void setSystemAudioMode(boolean enabled, IHdmiControlCallback callback);
addSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener)59     void addSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener);
removeSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener)60     void removeSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener);
setArcMode(boolean enabled)61     void setArcMode(boolean enabled);
setProhibitMode(boolean enabled)62     void setProhibitMode(boolean enabled);
setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex)63     void setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex);
setSystemAudioMute(boolean mute)64     void setSystemAudioMute(boolean mute);
setInputChangeListener(IHdmiInputChangeListener listener)65     void setInputChangeListener(IHdmiInputChangeListener listener);
getInputDevices()66     List<HdmiDeviceInfo> getInputDevices();
getDeviceList()67     List<HdmiDeviceInfo> getDeviceList();
powerOffRemoteDevice(int logicalAddress, int powerStatus)68     void powerOffRemoteDevice(int logicalAddress, int powerStatus);
powerOnRemoteDevice(int logicalAddress, int powerStatus)69     void powerOnRemoteDevice(int logicalAddress, int powerStatus);
askRemoteDeviceToBecomeActiveSource(int physicalAddress)70     void askRemoteDeviceToBecomeActiveSource(int physicalAddress);
sendVendorCommand(int deviceType, int targetAddress, in byte[] params, boolean hasVendorId)71     void sendVendorCommand(int deviceType, int targetAddress, in byte[] params,
72             boolean hasVendorId);
addVendorCommandListener(IHdmiVendorCommandListener listener, int deviceType)73     void addVendorCommandListener(IHdmiVendorCommandListener listener, int deviceType);
sendStandby(int deviceType, int deviceId)74     void sendStandby(int deviceType, int deviceId);
setHdmiRecordListener(IHdmiRecordListener callback)75     void setHdmiRecordListener(IHdmiRecordListener callback);
startOneTouchRecord(int recorderAddress, in byte[] recordSource)76     void startOneTouchRecord(int recorderAddress, in byte[] recordSource);
stopOneTouchRecord(int recorderAddress)77     void stopOneTouchRecord(int recorderAddress);
startTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource)78     void startTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource);
clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource)79     void clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource);
sendMhlVendorCommand(int portId, int offset, int length, in byte[] data)80     void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data);
addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener)81     void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener);
setStandbyMode(boolean isStandbyModeOn)82     void setStandbyMode(boolean isStandbyModeOn);
reportAudioStatus(int deviceType, int volume, int maxVolume, boolean isMute)83     void reportAudioStatus(int deviceType, int volume, int maxVolume, boolean isMute);
setSystemAudioModeOnForAudioOnlySource()84     void setSystemAudioModeOnForAudioOnlySource();
85 }
86