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.IHdmiDeviceEventListener;
23 import android.hardware.hdmi.IHdmiHotplugEventListener;
24 import android.hardware.hdmi.IHdmiInputChangeListener;
25 import android.hardware.hdmi.IHdmiMhlVendorCommandListener;
26 import android.hardware.hdmi.IHdmiRecordListener;
27 import android.hardware.hdmi.IHdmiSystemAudioModeChangeListener;
28 import android.hardware.hdmi.IHdmiVendorCommandListener;
29 
30 import java.util.List;
31 
32 /**
33  * Binder interface that clients running in the application process
34  * will use to perform HDMI-CEC features by communicating with other devices
35  * on the bus.
36  *
37  * @hide
38  */
39 interface IHdmiControlService {
getSupportedTypes()40     int[] getSupportedTypes();
getActiveSource()41     HdmiDeviceInfo getActiveSource();
oneTouchPlay(IHdmiControlCallback callback)42     void oneTouchPlay(IHdmiControlCallback callback);
queryDisplayStatus(IHdmiControlCallback callback)43     void queryDisplayStatus(IHdmiControlCallback callback);
addHotplugEventListener(IHdmiHotplugEventListener listener)44     void addHotplugEventListener(IHdmiHotplugEventListener listener);
removeHotplugEventListener(IHdmiHotplugEventListener listener)45     void removeHotplugEventListener(IHdmiHotplugEventListener listener);
addDeviceEventListener(IHdmiDeviceEventListener listener)46     void addDeviceEventListener(IHdmiDeviceEventListener listener);
deviceSelect(int deviceId, IHdmiControlCallback callback)47     void deviceSelect(int deviceId, IHdmiControlCallback callback);
portSelect(int portId, IHdmiControlCallback callback)48     void portSelect(int portId, IHdmiControlCallback callback);
sendKeyEvent(int deviceType, int keyCode, boolean isPressed)49     void sendKeyEvent(int deviceType, int keyCode, boolean isPressed);
sendVolumeKeyEvent(int deviceType, int keyCode, boolean isPressed)50     void sendVolumeKeyEvent(int deviceType, int keyCode, boolean isPressed);
getPortInfo()51     List<HdmiPortInfo> getPortInfo();
canChangeSystemAudioMode()52     boolean canChangeSystemAudioMode();
getSystemAudioMode()53     boolean getSystemAudioMode();
getPhysicalAddress()54     int getPhysicalAddress();
setSystemAudioMode(boolean enabled, IHdmiControlCallback callback)55     void setSystemAudioMode(boolean enabled, IHdmiControlCallback callback);
addSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener)56     void addSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener);
removeSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener)57     void removeSystemAudioModeChangeListener(IHdmiSystemAudioModeChangeListener listener);
setArcMode(boolean enabled)58     void setArcMode(boolean enabled);
setProhibitMode(boolean enabled)59     void setProhibitMode(boolean enabled);
setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex)60     void setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex);
setSystemAudioMute(boolean mute)61     void setSystemAudioMute(boolean mute);
setInputChangeListener(IHdmiInputChangeListener listener)62     void setInputChangeListener(IHdmiInputChangeListener listener);
getInputDevices()63     List<HdmiDeviceInfo> getInputDevices();
getDeviceList()64     List<HdmiDeviceInfo> getDeviceList();
powerOffRemoteDevice(int logicalAddress, int powerStatus)65     void powerOffRemoteDevice(int logicalAddress, int powerStatus);
powerOnRemoteDevice(int logicalAddress, int powerStatus)66     void powerOnRemoteDevice(int logicalAddress, int powerStatus);
askRemoteDeviceToBecomeActiveSource(int physicalAddress)67     void askRemoteDeviceToBecomeActiveSource(int physicalAddress);
sendVendorCommand(int deviceType, int targetAddress, in byte[] params, boolean hasVendorId)68     void sendVendorCommand(int deviceType, int targetAddress, in byte[] params,
69             boolean hasVendorId);
addVendorCommandListener(IHdmiVendorCommandListener listener, int deviceType)70     void addVendorCommandListener(IHdmiVendorCommandListener listener, int deviceType);
sendStandby(int deviceType, int deviceId)71     void sendStandby(int deviceType, int deviceId);
setHdmiRecordListener(IHdmiRecordListener callback)72     void setHdmiRecordListener(IHdmiRecordListener callback);
startOneTouchRecord(int recorderAddress, in byte[] recordSource)73     void startOneTouchRecord(int recorderAddress, in byte[] recordSource);
stopOneTouchRecord(int recorderAddress)74     void stopOneTouchRecord(int recorderAddress);
startTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource)75     void startTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource);
clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource)76     void clearTimerRecording(int recorderAddress, int sourceType, in byte[] recordSource);
sendMhlVendorCommand(int portId, int offset, int length, in byte[] data)77     void sendMhlVendorCommand(int portId, int offset, int length, in byte[] data);
addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener)78     void addHdmiMhlVendorCommandListener(IHdmiMhlVendorCommandListener listener);
setStandbyMode(boolean isStandbyModeOn)79     void setStandbyMode(boolean isStandbyModeOn);
reportAudioStatus(int deviceType, int volume, int maxVolume, boolean isMute)80     void reportAudioStatus(int deviceType, int volume, int maxVolume, boolean isMute);
setSystemAudioModeOnForAudioOnlySource()81     void setSystemAudioModeOnForAudioOnlySource();
82 }
83