public final class HdmiControlManager extends Object
HdmiControlManager
class is used to send HDMI control messages
to attached CEC devices.
Provides various HDMI client instances that represent HDMI-CEC logical devices
hosted in the system. getTvClient()
, for instance will return an
HdmiTvClient
object if the system is configured to host one. Android system
can host more than one logical CEC devices. If multiple types are configured they
all work as if they were independent logical devices running in the system.
Modifier and Type | Class and Description |
---|---|
static interface |
HdmiControlManager.HotplugEventListener
Listener used to get hotplug event from HDMI port.
|
static interface |
HdmiControlManager.VendorCommandListener
Listener used to get vendor-specific commands.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_OSD_MESSAGE
Broadcast Action: Display OSD message.
|
static int |
AVR_VOLUME_MUTED
Volume value for mute state.
|
static int |
CLEAR_TIMER_STATUS_CEC_DISABLE
Clear timer error - CEC is disabled.
|
static int |
CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION
Clear timer error - check recorder and connection.
|
static int |
CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE
Clear timer error - cannot clear timer for selected source.
|
static int |
CLEAR_TIMER_STATUS_TIMER_CLEARED
Timer cleared.
|
static int |
CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_INFO_AVAILABLE
Timer not cleared – no info available.
|
static int |
CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_MATCHING
Timer not cleared – no matching.
|
static int |
CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_RECORDING
Timer not cleared – recording.
|
static int |
CONTROL_STATE_CHANGED_REASON_SETTING
The state of HdmiControlService is changed by changing of settings.
|
static int |
CONTROL_STATE_CHANGED_REASON_STANDBY
The HdmiControlService will be disabled to standby.
|
static int |
CONTROL_STATE_CHANGED_REASON_START
The HdmiControlService is started.
|
static int |
CONTROL_STATE_CHANGED_REASON_WAKEUP
The HdmiControlService is enabled to wake up.
|
static int |
DEVICE_EVENT_ADD_DEVICE |
static int |
DEVICE_EVENT_REMOVE_DEVICE |
static int |
DEVICE_EVENT_UPDATE_DEVICE |
static String |
EXTRA_MESSAGE_EXTRA_PARAM1
Used as an extra field in the intent
ACTION_OSD_MESSAGE . |
static String |
EXTRA_MESSAGE_ID
Used as an extra field in the intent
ACTION_OSD_MESSAGE . |
static int |
ONE_TOUCH_RECORD_ALREADY_RECORDING
No recording – already recording
|
static int |
ONE_TOUCH_RECORD_CEC_DISABLED
CEC is disabled.
|
static int |
ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION
No recording.
|
static int |
ONE_TOUCH_RECORD_DISALLOW_TO_COPY
No recording – Not allowed to copy source.
|
static int |
ONE_TOUCH_RECORD_DISALLOW_TO_FUTHER_COPIES
No recording – No further copies allowed
|
static int |
ONE_TOUCH_RECORD_FAIL_TO_RECORD_DISPLAYED_SCREEN
Cannot record currently displayed source.
|
static int |
ONE_TOUCH_RECORD_INVALID_EXTERNAL_PHYSICAL_ADDRESS
No recording – invalid External Physical Address
|
static int |
ONE_TOUCH_RECORD_INVALID_EXTERNAL_PLUG_NUMBER
No recording – invalid External plug number
|
static int |
ONE_TOUCH_RECORD_MEDIA_PROBLEM
No recording – media problem
|
static int |
ONE_TOUCH_RECORD_MEDIA_PROTECTED
No recording – media protected
|
static int |
ONE_TOUCH_RECORD_NO_MEDIA
No recording – No media
|
static int |
ONE_TOUCH_RECORD_NO_OR_INSUFFICIENT_CA_ENTITLEMENTS
No Recording – No or Insufficient CA Entitlements
|
static int |
ONE_TOUCH_RECORD_NO_SOURCE_SIGNAL
No recording – no source signal
|
static int |
ONE_TOUCH_RECORD_NOT_ENOUGH_SPACE
No recording – not enough space available
|
static int |
ONE_TOUCH_RECORD_OTHER_REASON
No recording – other reason
|
static int |
ONE_TOUCH_RECORD_PARENT_LOCK_ON
No recording – Parental Lock On
|
static int |
ONE_TOUCH_RECORD_PLAYING
No recording – playing
|
static int |
ONE_TOUCH_RECORD_PREVIOUS_RECORDING_IN_PROGRESS
No recording.
|
static int |
ONE_TOUCH_RECORD_RECORDING_ALREADY_TERMINATED
Recording has already terminated
|
static int |
ONE_TOUCH_RECORD_RECORDING_ANALOGUE_SERVICE
Recording Analogue Service.
|
static int |
ONE_TOUCH_RECORD_RECORDING_CURRENTLY_SELECTED_SOURCE
Recording currently selected source.
|
static int |
ONE_TOUCH_RECORD_RECORDING_DIGITAL_SERVICE
Recording Digital Service.
|
static int |
ONE_TOUCH_RECORD_RECORDING_EXTERNAL_INPUT
Recording External input.
|
static int |
ONE_TOUCH_RECORD_RECORDING_TERMINATED_NORMALLY
Recording terminated normally
|
static int |
ONE_TOUCH_RECORD_UNABLE_ANALOGUE_SERVICE
No recording – unable to record Analogue Service.
|
static int |
ONE_TOUCH_RECORD_UNABLE_DIGITAL_SERVICE
No recording – unable to record Digital Service.
|
static int |
ONE_TOUCH_RECORD_UNABLE_SELECTED_SERVICE
No recording – unable to select required service. as suitable tuner, but the requested
parameters are invalid or out of range for that tuner.
|
static int |
ONE_TOUCH_RECORD_UNSUPPORTED_CA
No recording – CA system not supported
|
static int |
OSD_MESSAGE_ARC_CONNECTED_INVALID_PORT
Message that ARC enabled device is connected to invalid port (non-ARC port).
|
static int |
OSD_MESSAGE_AVR_VOLUME_CHANGED
Message used by TV to receive volume status from Audio Receiver.
|
static int |
POWER_STATUS_ON |
static int |
POWER_STATUS_STANDBY |
static int |
POWER_STATUS_TRANSIENT_TO_ON |
static int |
POWER_STATUS_TRANSIENT_TO_STANDBY |
static int |
POWER_STATUS_UNKNOWN |
static int |
RESULT_ALREADY_IN_PROGRESS
Deprecated.
|
static int |
RESULT_COMMUNICATION_FAILED |
static int |
RESULT_EXCEPTION |
static int |
RESULT_INCORRECT_MODE |
static int |
RESULT_SOURCE_NOT_AVAILABLE |
static int |
RESULT_SUCCESS |
static int |
RESULT_TARGET_NOT_AVAILABLE |
static int |
RESULT_TIMEOUT |
static int |
TIMER_RECORDING_RESULT_EXTRA_CEC_DISABLED
CEC is disabled.
|
static int |
TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION
No timer recording - check recorder and connection.
|
static int |
TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE
No timer recording - cannot record selected source.
|
static int |
TIMER_RECORDING_RESULT_EXTRA_NO_ERROR
No extra error.
|
static int |
TIMER_RECORDING_TYPE_ANALOGUE
Timer recording type for analogue service source.
|
static int |
TIMER_RECORDING_TYPE_DIGITAL
Timer recording type for digital service source.
|
static int |
TIMER_RECORDING_TYPE_EXTERNAL
Timer recording type for external source.
|
static int |
TIMER_STATUS_MEDIA_INFO_NOT_PRESENT
[Timer Status Data/Media Info] - Media not present.
|
static int |
TIMER_STATUS_MEDIA_INFO_PRESENT_NOT_PROTECTED
[Timer Status Data/Media Info] - Media present and not protected.
|
static int |
TIMER_STATUS_MEDIA_INFO_PRESENT_PROTECTED
[Timer Status Data/Media Info] - Media present, but protected.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_CA_NOT_SUPPORTED
[Timer Status Data/Not Programmed Error Info] - CA system not supported.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_CLOCK_FAILURE
[Timer Status Data/Not Programmed Error Info] - Clock Failure.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_DATE_OUT_OF_RANGE
[Timer Status Data/Not Programmed Error Info] - Date out of range.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_DUPLICATED
[Timer Status Data/Not Programmed Error Info] - Duplicate: already programmed.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PHYSICAL_NUMBER
[Timer Status Data/Not Programmed Error Info] - Invalid External Physical Address.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PLUG_NUMBER
[Timer Status Data/Not Programmed Error Info] - Invalid External Plug Number.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_INVALID_SEQUENCE
[Timer Status Data/Not Programmed Error Info] - Recording Sequence error.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_NO_CA_ENTITLEMENTS
[Timer Status Data/Not Programmed Error Info] - No or insufficient CA Entitlements.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_NO_FREE_TIME
[Timer Status Data/Not Programmed Error Info] - No free timer available.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_PARENTAL_LOCK_ON
[Timer Status Data/Not Programmed Error Info] - Parental Lock On.
|
static int |
TIMER_STATUS_NOT_PROGRAMMED_UNSUPPORTED_RESOLUTION
[Timer Status Data/Not Programmed Error Info] - Does not support resolution.
|
static int |
TIMER_STATUS_PROGRAMMED_INFO_ENOUGH_SPACE
[Timer Status Data/Programmed Info] - Enough space available for recording.
|
static int |
TIMER_STATUS_PROGRAMMED_INFO_MIGHT_NOT_ENOUGH_SPACE
[Timer Status Data/Programmed Info] - Might not enough space available for recording.
|
static int |
TIMER_STATUS_PROGRAMMED_INFO_NO_MEDIA_INFO
[Timer Status Data/Programmed Info] - No media info available.
|
static int |
TIMER_STATUS_PROGRAMMED_INFO_NOT_ENOUGH_SPACE
[Timer Status Data/Programmed Info] - Not enough space available for recording.
|
Constructor and Description |
---|
HdmiControlManager(IHdmiControlService service)
- hide this constructor because it has a parameter of type IHdmiControlService,
which is a system private class.
|
Modifier and Type | Method and Description |
---|---|
void |
addHotplugEventListener(HdmiControlManager.HotplugEventListener listener)
Adds a listener to get informed of
HdmiHotplugEvent . |
HdmiClient |
getClient(int type)
Gets an object that represents an HDMI-CEC logical device of a specified type.
|
HdmiPlaybackClient |
getPlaybackClient()
Gets an object that represents an HDMI-CEC logical device of type playback on the system.
|
HdmiTvClient |
getTvClient()
Gets an object that represents an HDMI-CEC logical device of type TV on the system.
|
void |
removeHotplugEventListener(HdmiControlManager.HotplugEventListener listener)
Removes a listener to stop getting informed of
HdmiHotplugEvent . |
public static final String ACTION_OSD_MESSAGE
Send when the service has a message to display on screen for events that need user's attention such as ARC status change.
Always contains the extra fields EXTRA_MESSAGE_ID
.
Requires android.Manifest.permission#HDMI_CEC
to receive.
public static final int OSD_MESSAGE_ARC_CONNECTED_INVALID_PORT
public static final int OSD_MESSAGE_AVR_VOLUME_CHANGED
EXTRA_MESSAGE_EXTRA_PARAM1
. If the
value is in range of [0,100], it is current volume of Audio Receiver. And there is another
value, AVR_VOLUME_MUTED
, which is used to inform volume mute.public static final String EXTRA_MESSAGE_ID
ACTION_OSD_MESSAGE
. Contains the ID of
the message to display on screen.public static final String EXTRA_MESSAGE_EXTRA_PARAM1
ACTION_OSD_MESSAGE
. Contains the extra value
of the message.public static final int AVR_VOLUME_MUTED
public static final int POWER_STATUS_UNKNOWN
public static final int POWER_STATUS_ON
public static final int POWER_STATUS_STANDBY
public static final int POWER_STATUS_TRANSIENT_TO_ON
public static final int POWER_STATUS_TRANSIENT_TO_STANDBY
public static final int RESULT_SUCCESS
public static final int RESULT_TIMEOUT
public static final int RESULT_SOURCE_NOT_AVAILABLE
public static final int RESULT_TARGET_NOT_AVAILABLE
@Deprecated public static final int RESULT_ALREADY_IN_PROGRESS
public static final int RESULT_EXCEPTION
public static final int RESULT_INCORRECT_MODE
public static final int RESULT_COMMUNICATION_FAILED
public static final int DEVICE_EVENT_ADD_DEVICE
public static final int DEVICE_EVENT_REMOVE_DEVICE
public static final int DEVICE_EVENT_UPDATE_DEVICE
public static final int ONE_TOUCH_RECORD_RECORDING_CURRENTLY_SELECTED_SOURCE
public static final int ONE_TOUCH_RECORD_RECORDING_DIGITAL_SERVICE
public static final int ONE_TOUCH_RECORD_RECORDING_ANALOGUE_SERVICE
public static final int ONE_TOUCH_RECORD_RECORDING_EXTERNAL_INPUT
public static final int ONE_TOUCH_RECORD_UNABLE_DIGITAL_SERVICE
public static final int ONE_TOUCH_RECORD_UNABLE_ANALOGUE_SERVICE
public static final int ONE_TOUCH_RECORD_UNABLE_SELECTED_SERVICE
public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PLUG_NUMBER
public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PHYSICAL_ADDRESS
public static final int ONE_TOUCH_RECORD_UNSUPPORTED_CA
public static final int ONE_TOUCH_RECORD_NO_OR_INSUFFICIENT_CA_ENTITLEMENTS
public static final int ONE_TOUCH_RECORD_DISALLOW_TO_COPY
public static final int ONE_TOUCH_RECORD_DISALLOW_TO_FUTHER_COPIES
public static final int ONE_TOUCH_RECORD_NO_MEDIA
public static final int ONE_TOUCH_RECORD_PLAYING
public static final int ONE_TOUCH_RECORD_ALREADY_RECORDING
public static final int ONE_TOUCH_RECORD_MEDIA_PROTECTED
public static final int ONE_TOUCH_RECORD_NO_SOURCE_SIGNAL
public static final int ONE_TOUCH_RECORD_MEDIA_PROBLEM
public static final int ONE_TOUCH_RECORD_NOT_ENOUGH_SPACE
public static final int ONE_TOUCH_RECORD_PARENT_LOCK_ON
public static final int ONE_TOUCH_RECORD_RECORDING_TERMINATED_NORMALLY
public static final int ONE_TOUCH_RECORD_RECORDING_ALREADY_TERMINATED
public static final int ONE_TOUCH_RECORD_OTHER_REASON
public static final int ONE_TOUCH_RECORD_PREVIOUS_RECORDING_IN_PROGRESS
public static final int ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION
public static final int ONE_TOUCH_RECORD_FAIL_TO_RECORD_DISPLAYED_SCREEN
public static final int ONE_TOUCH_RECORD_CEC_DISABLED
public static final int TIMER_RECORDING_TYPE_DIGITAL
public static final int TIMER_RECORDING_TYPE_ANALOGUE
public static final int TIMER_RECORDING_TYPE_EXTERNAL
public static final int TIMER_STATUS_MEDIA_INFO_PRESENT_NOT_PROTECTED
public static final int TIMER_STATUS_MEDIA_INFO_PRESENT_PROTECTED
public static final int TIMER_STATUS_MEDIA_INFO_NOT_PRESENT
public static final int TIMER_STATUS_PROGRAMMED_INFO_ENOUGH_SPACE
public static final int TIMER_STATUS_PROGRAMMED_INFO_NOT_ENOUGH_SPACE
public static final int TIMER_STATUS_PROGRAMMED_INFO_MIGHT_NOT_ENOUGH_SPACE
public static final int TIMER_STATUS_PROGRAMMED_INFO_NO_MEDIA_INFO
public static final int TIMER_STATUS_NOT_PROGRAMMED_NO_FREE_TIME
public static final int TIMER_STATUS_NOT_PROGRAMMED_DATE_OUT_OF_RANGE
public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_SEQUENCE
public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PLUG_NUMBER
public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PHYSICAL_NUMBER
public static final int TIMER_STATUS_NOT_PROGRAMMED_CA_NOT_SUPPORTED
public static final int TIMER_STATUS_NOT_PROGRAMMED_NO_CA_ENTITLEMENTS
public static final int TIMER_STATUS_NOT_PROGRAMMED_UNSUPPORTED_RESOLUTION
public static final int TIMER_STATUS_NOT_PROGRAMMED_PARENTAL_LOCK_ON
public static final int TIMER_STATUS_NOT_PROGRAMMED_CLOCK_FAILURE
public static final int TIMER_STATUS_NOT_PROGRAMMED_DUPLICATED
public static final int TIMER_RECORDING_RESULT_EXTRA_NO_ERROR
public static final int TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION
public static final int TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE
public static final int TIMER_RECORDING_RESULT_EXTRA_CEC_DISABLED
public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_RECORDING
public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_MATCHING
public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_INFO_AVAILABLE
public static final int CLEAR_TIMER_STATUS_TIMER_CLEARED
public static final int CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION
public static final int CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE
public static final int CLEAR_TIMER_STATUS_CEC_DISABLE
public static final int CONTROL_STATE_CHANGED_REASON_START
public static final int CONTROL_STATE_CHANGED_REASON_SETTING
public static final int CONTROL_STATE_CHANGED_REASON_WAKEUP
public static final int CONTROL_STATE_CHANGED_REASON_STANDBY
public HdmiControlManager(IHdmiControlService service)
public HdmiClient getClient(int type)
type
- CEC device typeHdmiClient
instance. null
on failure.
See HdmiDeviceInfo.DEVICE_PLAYBACK
See HdmiDeviceInfo.DEVICE_TV
public HdmiPlaybackClient getPlaybackClient()
Used to send HDMI control messages to other devices like TV or audio amplifier through HDMI bus. It is also possible to communicate with other logical devices hosted in the same system if the system is configured to host more than one type of HDMI-CEC logical devices.
HdmiPlaybackClient
instance. null
on failure.public HdmiTvClient getTvClient()
Used to send HDMI control messages to other devices and manage them through HDMI bus. It is also possible to communicate with other logical devices hosted in the same system if the system is configured to host more than one type of HDMI-CEC logical devices.
HdmiTvClient
instance. null
on failure.public void addHotplugEventListener(HdmiControlManager.HotplugEventListener listener)
HdmiHotplugEvent
.
To stop getting the notification,
use removeHotplugEventListener(HotplugEventListener)
.
listener
- HdmiControlManager.HotplugEventListener
instanceremoveHotplugEventListener(HotplugEventListener)
public void removeHotplugEventListener(HdmiControlManager.HotplugEventListener listener)
HdmiHotplugEvent
.listener
- HdmiControlManager.HotplugEventListener
instance to be removed