Merge "CEC: Fix apilint errors." into lmp-mr1-dev

This commit is contained in:
Yuncheol Heo
2014-10-24 08:48:28 +00:00
committed by Android (Google) Code Review
11 changed files with 127 additions and 99 deletions

View File

@@ -16,11 +16,13 @@ import android.util.Log;
public abstract class HdmiClient { public abstract class HdmiClient {
private static final String TAG = "HdmiClient"; private static final String TAG = "HdmiClient";
protected final IHdmiControlService mService; /* package */ final IHdmiControlService mService;
protected abstract int getDeviceType(); private IHdmiVendorCommandListener mIHdmiVendorCommandListener;
public HdmiClient(IHdmiControlService service) { /* package */ abstract int getDeviceType();
/* package */ HdmiClient(IHdmiControlService service) {
mService = service; mService = service;
} }
@@ -40,7 +42,7 @@ public abstract class HdmiClient {
} }
/** /**
* Send a key event to other logical device. * Sends a key event to other logical device.
* *
* @param keyCode key code to send. Defined in {@link android.view.KeyEvent}. * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
* @param isPressed true if this is key press event * @param isPressed true if this is key press event
@@ -54,7 +56,7 @@ public abstract class HdmiClient {
} }
/** /**
* Send vendor-specific command. * Sends vendor-specific command.
* *
* @param targetAddress address of the target device * @param targetAddress address of the target device
* @param params vendor-specific parameter. For <Vendor Command With ID> do not * @param params vendor-specific parameter. For <Vendor Command With ID> do not
@@ -71,18 +73,23 @@ public abstract class HdmiClient {
} }
/** /**
* Add a listener used to receive incoming vendor-specific command. * Sets a listener used to receive incoming vendor-specific command.
* *
* @param listener listener object * @param listener listener object
*/ */
public void addVendorCommandListener(@NonNull VendorCommandListener listener) { public void setVendorCommandListener(@NonNull VendorCommandListener listener) {
if (listener == null) { if (listener == null) {
throw new IllegalArgumentException("listener cannot be null"); throw new IllegalArgumentException("listener cannot be null");
} }
if (mIHdmiVendorCommandListener != null) {
throw new IllegalStateException("listener was already set");
}
try { try {
mService.addVendorCommandListener(getListenerWrapper(listener), getDeviceType()); IHdmiVendorCommandListener wrappedListener = getListenerWrapper(listener);
mService.addVendorCommandListener(wrappedListener, getDeviceType());
mIHdmiVendorCommandListener = wrappedListener;
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "failed to add vendor command listener: ", e); Log.e(TAG, "failed to set vendor command listener: ", e);
} }
} }

View File

@@ -21,6 +21,8 @@ import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.os.RemoteException; import android.os.RemoteException;
import android.util.ArrayMap;
import android.util.Log;
/** /**
* The {@link HdmiControlManager} class is used to send HDMI control messages * The {@link HdmiControlManager} class is used to send HDMI control messages
@@ -36,6 +38,8 @@ import android.os.RemoteException;
*/ */
@SystemApi @SystemApi
public final class HdmiControlManager { public final class HdmiControlManager {
private static final String TAG = "HdmiControlManager";
@Nullable private final IHdmiControlService mService; @Nullable private final IHdmiControlService mService;
/** /**
@@ -56,7 +60,7 @@ public final class HdmiControlManager {
/** /**
* Message used by TV to receive volume status from Audio Receiver. It should check volume value * Message used by TV to receive volume status from Audio Receiver. It should check volume value
* that is retrieved from extra value with the key {@link #EXTRA_MESSAGE_EXTRAM_PARAM1}. If the * that is retrieved from extra value with the key {@link #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 is in range of [0,100], it is current volume of Audio Receiver. And there is another
* value, {@link #AVR_VOLUME_MUTED}, which is used to inform volume mute. * value, {@link #AVR_VOLUME_MUTED}, which is used to inform volume mute.
*/ */
@@ -71,7 +75,7 @@ public final class HdmiControlManager {
* Used as an extra field in the intent {@link #ACTION_OSD_MESSAGE}. Contains the extra value * Used as an extra field in the intent {@link #ACTION_OSD_MESSAGE}. Contains the extra value
* of the message. * of the message.
*/ */
public static final String EXTRA_MESSAGE_EXTRAM_PARAM1 = public static final String EXTRA_MESSAGE_EXTRA_PARAM1 =
"android.hardware.hdmi.extra.MESSAGE_EXTRA_PARAM1"; "android.hardware.hdmi.extra.MESSAGE_EXTRA_PARAM1";
/** /**
@@ -251,10 +255,9 @@ public final class HdmiControlManager {
private final boolean mHasTvDevice; private final boolean mHasTvDevice;
/** /**
* @hide - hide this constructor because it has a parameter of type * {@hide} - hide this constructor because it has a parameter of type IHdmiControlService,
* IHdmiControlService, which is a system private class. The right way * which is a system private class. The right way to create an instance of this class is
* to create an instance of this class is using the factory * using the factory Context.getSystemService.
* Context.getSystemService.
*/ */
public HdmiControlManager(IHdmiControlService service) { public HdmiControlManager(IHdmiControlService service) {
mService = service; mService = service;
@@ -340,6 +343,9 @@ public final class HdmiControlManager {
void onReceived(HdmiHotplugEvent event); void onReceived(HdmiHotplugEvent event);
} }
private final ArrayMap<HotplugEventListener, IHdmiHotplugEventListener>
mHotplugEventListeners = new ArrayMap<>();
/** /**
* Listener used to get vendor-specific commands. * Listener used to get vendor-specific commands.
*/ */
@@ -384,12 +390,19 @@ public final class HdmiControlManager {
*/ */
public void addHotplugEventListener(HotplugEventListener listener) { public void addHotplugEventListener(HotplugEventListener listener) {
if (mService == null) { if (mService == null) {
Log.e(TAG, "HdmiControlService is not available");
return; return;
} }
if (mHotplugEventListeners.containsKey(listener)) {
Log.e(TAG, "listener is already registered");
return;
}
IHdmiHotplugEventListener wrappedListener = getHotplugEventListenerWrapper(listener);
mHotplugEventListeners.put(listener, wrappedListener);
try { try {
mService.addHotplugEventListener(getHotplugEventListenerWrapper(listener)); mService.addHotplugEventListener(wrappedListener);
} catch (RemoteException e) { } catch (RemoteException e) {
// Do nothing. Log.e(TAG, "failed to add hotplug event listener: ", e);
} }
} }
@@ -400,12 +413,18 @@ public final class HdmiControlManager {
*/ */
public void removeHotplugEventListener(HotplugEventListener listener) { public void removeHotplugEventListener(HotplugEventListener listener) {
if (mService == null) { if (mService == null) {
Log.e(TAG, "HdmiControlService is not available");
return;
}
IHdmiHotplugEventListener wrappedListener = mHotplugEventListeners.remove(listener);
if (wrappedListener == null) {
Log.e(TAG, "tried to remove not-registered listener");
return; return;
} }
try { try {
mService.removeHotplugEventListener(getHotplugEventListenerWrapper(listener)); mService.removeHotplugEventListener(wrappedListener);
} catch (RemoteException e) { } catch (RemoteException e) {
// Do nothing. Log.e(TAG, "failed to remove hotplug event listener: ", e);
} }
} }

View File

@@ -237,14 +237,14 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return the id of the device. * Returns the id of the device.
*/ */
public int getId() { public int getId() {
return mId; return mId;
} }
/** /**
* Return the id to be used for CEC device. * Returns the id to be used for CEC device.
* *
* @param address logical address of CEC device * @param address logical address of CEC device
* @return id for CEC device * @return id for CEC device
@@ -255,7 +255,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return the id to be used for MHL device. * Returns the id to be used for MHL device.
* *
* @param portId port which the MHL device is connected to * @param portId port which the MHL device is connected to
* @return id for MHL device * @return id for MHL device
@@ -266,7 +266,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return the id to be used for hardware port. * Returns the id to be used for hardware port.
* *
* @param portId port id * @param portId port id
* @return id for hardware port * @return id for hardware port
@@ -276,28 +276,28 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return the CEC logical address of the device. * Returns the CEC logical address of the device.
*/ */
public int getLogicalAddress() { public int getLogicalAddress() {
return mLogicalAddress; return mLogicalAddress;
} }
/** /**
* Return the physical address of the device. * Returns the physical address of the device.
*/ */
public int getPhysicalAddress() { public int getPhysicalAddress() {
return mPhysicalAddress; return mPhysicalAddress;
} }
/** /**
* Return the port ID. * Returns the port ID.
*/ */
public int getPortId() { public int getPortId() {
return mPortId; return mPortId;
} }
/** /**
* Return CEC type of the device. For more details, refer constants between {@link #DEVICE_TV} * Returns CEC type of the device. For more details, refer constants between {@link #DEVICE_TV}
* and {@link #DEVICE_INACTIVE}. * and {@link #DEVICE_INACTIVE}.
*/ */
public int getDeviceType() { public int getDeviceType() {
@@ -305,7 +305,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return device's power status. It should be one of the following values. * Returns device's power status. It should be one of the following values.
* <ul> * <ul>
* <li>{@link HdmiControlManager#POWER_STATUS_ON} * <li>{@link HdmiControlManager#POWER_STATUS_ON}
* <li>{@link HdmiControlManager#POWER_STATUS_STANDBY} * <li>{@link HdmiControlManager#POWER_STATUS_STANDBY}
@@ -319,21 +319,21 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return MHL device id. Return -1 for non-MHL device. * Returns MHL device id. Return -1 for non-MHL device.
*/ */
public int getDeviceId() { public int getDeviceId() {
return mDeviceId; return mDeviceId;
} }
/** /**
* Return MHL adopter id. Return -1 for non-MHL device. * Returns MHL adopter id. Return -1 for non-MHL device.
*/ */
public int getAdopterId() { public int getAdopterId() {
return mAdopterId; return mAdopterId;
} }
/** /**
* Return {@code true} if the device is of a type that can be an input source. * Returns {@code true} if the device is of a type that can be an input source.
*/ */
public boolean isSourceType() { public boolean isSourceType() {
return mDeviceType == DEVICE_PLAYBACK return mDeviceType == DEVICE_PLAYBACK
@@ -342,7 +342,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return {@code true} if the device represents an HDMI-CEC device. {@code false} if the device * Returns {@code true} if the device represents an HDMI-CEC device. {@code false} if the device
* is either MHL or other device. * is either MHL or other device.
*/ */
public boolean isCecDevice() { public boolean isCecDevice() {
@@ -350,7 +350,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return {@code true} if the device represents an MHL device. {@code false} if the device is * Returns {@code true} if the device represents an MHL device. {@code false} if the device is
* either CEC or other device. * either CEC or other device.
*/ */
public boolean isMhlDevice() { public boolean isMhlDevice() {
@@ -358,14 +358,14 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Return display (OSD) name of the device. * Returns display (OSD) name of the device.
*/ */
public String getDisplayName() { public String getDisplayName() {
return mDisplayName; return mDisplayName;
} }
/** /**
* Return vendor id of the device. Vendor id is used to distinguish devices built by other * Returns vendor id of the device. Vendor id is used to distinguish devices built by other
* manufactures. This is required for vendor-specific command on CEC standard. * manufactures. This is required for vendor-specific command on CEC standard.
*/ */
public int getVendorId() { public int getVendorId() {
@@ -373,7 +373,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Describe the kinds of special objects contained in this Parcelable's marshalled * Describes the kinds of special objects contained in this Parcelable's marshalled
* representation. * representation.
*/ */
@Override @Override
@@ -382,7 +382,7 @@ public class HdmiDeviceInfo implements Parcelable {
} }
/** /**
* Serialize this object into a {@link Parcel}. * Serializes this object into a {@link Parcel}.
* *
* @param dest The Parcel in which the object should be written. * @param dest The Parcel in which the object should be written.
* @param flags Additional flags about how the object should be written. May be 0 or * @param flags Additional flags about how the object should be written. May be 0 or

View File

@@ -44,7 +44,7 @@ public final class HdmiHotplugEvent implements Parcelable {
} }
/** /**
* Return the port number for which the event occurred. * Returns the port number for which the event occurred.
* *
* @return port number * @return port number
*/ */
@@ -53,7 +53,7 @@ public final class HdmiHotplugEvent implements Parcelable {
} }
/** /**
* Return the connection status associated with this event * Returns the connection status associated with this event
* *
* @return true if the device gets connected; otherwise false * @return true if the device gets connected; otherwise false
*/ */
@@ -62,7 +62,7 @@ public final class HdmiHotplugEvent implements Parcelable {
} }
/** /**
* Describe the kinds of special objects contained in this Parcelable's * Describes the kinds of special objects contained in this Parcelable's
* marshalled representation. * marshalled representation.
*/ */
@Override @Override
@@ -71,7 +71,7 @@ public final class HdmiHotplugEvent implements Parcelable {
} }
/** /**
* Flatten this object in to a Parcel. * Flattens this object in to a Parcel.
* *
* @param dest The Parcel in which the object should be written. * @param dest The Parcel in which the object should be written.
* @param flags Additional flags about how the object should be written. * @param flags Additional flags about how the object should be written.
@@ -86,17 +86,19 @@ public final class HdmiHotplugEvent implements Parcelable {
public static final Parcelable.Creator<HdmiHotplugEvent> CREATOR public static final Parcelable.Creator<HdmiHotplugEvent> CREATOR
= new Parcelable.Creator<HdmiHotplugEvent>() { = new Parcelable.Creator<HdmiHotplugEvent>() {
/** /**
* Rebuild a {@link HdmiHotplugEvent} previously stored with * Rebuilds a {@link HdmiHotplugEvent} previously stored with
* {@link Parcelable#writeToParcel(Parcel, int)}. * {@link Parcelable#writeToParcel(Parcel, int)}.
* *
* @param p {@link HdmiHotplugEvent} object to read the Rating from * @param p {@link HdmiHotplugEvent} object to read the Rating from
* @return a new {@link HdmiHotplugEvent} created from the data in the parcel * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
*/ */
@Override
public HdmiHotplugEvent createFromParcel(Parcel p) { public HdmiHotplugEvent createFromParcel(Parcel p) {
int port = p.readInt(); int port = p.readInt();
boolean connected = p.readByte() == 1; boolean connected = p.readByte() == 1;
return new HdmiHotplugEvent(port, connected); return new HdmiHotplugEvent(port, connected);
} }
@Override
public HdmiHotplugEvent[] newArray(int size) { public HdmiHotplugEvent[] newArray(int size) {
return new HdmiHotplugEvent[size]; return new HdmiHotplugEvent[size];
} }

View File

@@ -64,12 +64,12 @@ public final class HdmiPlaybackClient extends HdmiClient {
public void onComplete(int status); public void onComplete(int status);
} }
HdmiPlaybackClient(IHdmiControlService service) { /* package */ HdmiPlaybackClient(IHdmiControlService service) {
super(service); super(service);
} }
/** /**
* Perform the feature 'one touch play' from playback device to turn on display * Performs the feature 'one touch play' from playback device to turn on display
* and switch the input. * and switch the input.
* *
* @param callback {@link OneTouchPlayCallback} object to get informed * @param callback {@link OneTouchPlayCallback} object to get informed
@@ -90,7 +90,7 @@ public final class HdmiPlaybackClient extends HdmiClient {
} }
/** /**
* Get the status of display device connected through HDMI bus. * Gets the status of display device connected through HDMI bus.
* *
* @param callback {@link DisplayStatusCallback} object to get informed * @param callback {@link DisplayStatusCallback} object to get informed
* of the result * of the result

View File

@@ -114,7 +114,7 @@ public final class HdmiPortInfo implements Parcelable {
} }
/** /**
* Describe the kinds of special objects contained in this Parcelable's * Describes the kinds of special objects contained in this Parcelable's
* marshalled representation. * marshalled representation.
*/ */
@Override @Override
@@ -146,7 +146,7 @@ public final class HdmiPortInfo implements Parcelable {
}; };
/** /**
* Serialize this object into a {@link Parcel}. * Serializes this object into a {@link Parcel}.
* *
* @param dest The Parcel in which the object should be written. * @param dest The Parcel in which the object should be written.
* @param flags Additional flags about how the object should be written. * @param flags Additional flags about how the object should be written.

View File

@@ -25,7 +25,7 @@ import android.hardware.hdmi.HdmiRecordSources.RecordSource;
*/ */
@SystemApi @SystemApi
public abstract class HdmiRecordListener { public abstract class HdmiRecordListener {
protected HdmiRecordListener() {} public HdmiRecordListener() {}
/** /**
* Called when TV received one touch record request from record device. The client of this * Called when TV received one touch record request from record device. The client of this
@@ -34,7 +34,7 @@ public abstract class HdmiRecordListener {
* @param recorderAddress * @param recorderAddress
* @return record source to be used for recording. Null if no device is available. * @return record source to be used for recording. Null if no device is available.
*/ */
public abstract RecordSource getOneTouchRecordSource(int recorderAddress); public abstract RecordSource onOneTouchRecordSourceRequested(int recorderAddress);
/** /**
* Called when one touch record is started or failed during initialization. * Called when one touch record is started or failed during initialization.

View File

@@ -59,21 +59,21 @@ public final class HdmiRecordSources {
*/ */
@SystemApi @SystemApi
public static abstract class RecordSource { public static abstract class RecordSource {
protected final int mSourceType; /* package */ final int mSourceType;
protected final int mExtraDataSize; /* package */ final int mExtraDataSize;
protected RecordSource(int sourceType, int extraDataSize) { /* package */ RecordSource(int sourceType, int extraDataSize) {
mSourceType = sourceType; mSourceType = sourceType;
mExtraDataSize = extraDataSize; mExtraDataSize = extraDataSize;
} }
abstract int extraParamToByteArray(byte[] data, int index); /* package */ abstract int extraParamToByteArray(byte[] data, int index);
final int getDataSize(boolean includeType) { /* package */ final int getDataSize(boolean includeType) {
return includeType ? mExtraDataSize + 1 : mExtraDataSize; return includeType ? mExtraDataSize + 1 : mExtraDataSize;
} }
final int toByteArray(boolean includeType, byte[] data, int index) { /* package */ final int toByteArray(boolean includeType, byte[] data, int index) {
if (includeType) { if (includeType) {
// 1 to 8 bytes (depends on source). // 1 to 8 bytes (depends on source).
// {[Record Source Type]} | // {[Record Source Type]} |
@@ -94,7 +94,7 @@ public final class HdmiRecordSources {
// ---- Own source ----------------------------------------------------------------------------- // ---- Own source -----------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------
/** /**
* Create {@link OwnSource} of own source. * Creates {@link OwnSource} of own source.
*/ */
public static OwnSource ofOwnSource() { public static OwnSource ofOwnSource() {
return new OwnSource(); return new OwnSource();
@@ -311,7 +311,7 @@ public final class HdmiRecordSources {
*/ */
public static final class DigitalChannelData implements DigitalServiceIdentification { public static final class DigitalChannelData implements DigitalServiceIdentification {
/** Identifies the logical or virtual channel number of a service. */ /** Identifies the logical or virtual channel number of a service. */
private ChannelIdentifier mChannelIdentifier; private final ChannelIdentifier mChannelIdentifier;
public static DigitalChannelData ofTwoNumbers(int majorNumber, int minorNumber) { public static DigitalChannelData ofTwoNumbers(int majorNumber, int minorNumber) {
return new DigitalChannelData( return new DigitalChannelData(
@@ -338,7 +338,7 @@ public final class HdmiRecordSources {
} }
/** /**
* Create {@link DigitalServiceSource} with channel type. * Creates {@link DigitalServiceSource} with channel type.
* *
* @param broadcastSystem digital broadcast system. It should be one of * @param broadcastSystem digital broadcast system. It should be one of
* <ul> * <ul>
@@ -389,7 +389,7 @@ public final class HdmiRecordSources {
} }
/** /**
* Create {@link DigitalServiceSource} of ARIB type. * Creates {@link DigitalServiceSource} of ARIB type.
* *
* @param aribType ARIB type. It should be one of * @param aribType ARIB type. It should be one of
* <ul> * <ul>
@@ -420,7 +420,7 @@ public final class HdmiRecordSources {
} }
/** /**
* Create {@link DigitalServiceSource} of ATSC type. * Creates {@link DigitalServiceSource} of ATSC type.
* *
* @param atscType ATSC type. It should be one of * @param atscType ATSC type. It should be one of
* <ul> * <ul>
@@ -451,7 +451,7 @@ public final class HdmiRecordSources {
} }
/** /**
* Create {@link DigitalServiceSource} of ATSC type. * Creates {@link DigitalServiceSource} of ATSC type.
* *
* @param dvbType DVB type. It should be one of * @param dvbType DVB type. It should be one of
* <ul> * <ul>
@@ -572,7 +572,7 @@ public final class HdmiRecordSources {
public static final int BROADCAST_SYSTEM_PAL_OTHER_SYSTEM = 31; public static final int BROADCAST_SYSTEM_PAL_OTHER_SYSTEM = 31;
/** /**
* Create {@link AnalogueServiceSource} of analogue service. * Creates {@link AnalogueServiceSource} of analogue service.
* *
* @param broadcastType * @param broadcastType
* @param frequency * @param frequency
@@ -615,7 +615,7 @@ public final class HdmiRecordSources {
*/ */
@SystemApi @SystemApi
public static final class AnalogueServiceSource extends RecordSource { public static final class AnalogueServiceSource extends RecordSource {
static final int EXTRA_DATA_SIZE = 4; /* package */ static final int EXTRA_DATA_SIZE = 4;
/** Indicates the Analogue broadcast type. */ /** Indicates the Analogue broadcast type. */
private final int mBroadcastType; private final int mBroadcastType;
@@ -635,7 +635,7 @@ public final class HdmiRecordSources {
} }
@Override @Override
protected int extraParamToByteArray(byte[] data, int index) { /* package */ int extraParamToByteArray(byte[] data, int index) {
// [Analogue Broadcast Type] - 1 byte // [Analogue Broadcast Type] - 1 byte
data[index] = (byte) mBroadcastType; data[index] = (byte) mBroadcastType;
// [Analogue Frequency] - 2 bytes // [Analogue Frequency] - 2 bytes
@@ -651,7 +651,7 @@ public final class HdmiRecordSources {
// ---- External plug data --------------------------------------------------------------------- // ---- External plug data ---------------------------------------------------------------------
// --------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------
/** /**
* Create {@link ExternalPlugData} of external plug type. * Creates {@link ExternalPlugData} of external plug type.
* *
* @param plugNumber plug number. It should be in range of [1, 255] * @param plugNumber plug number. It should be in range of [1, 255]
* @hide * @hide
@@ -695,7 +695,7 @@ public final class HdmiRecordSources {
// ---- External physical address -------------------------------------------------------------- // ---- External physical address --------------------------------------------------------------
// --------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------
/** /**
* Create {@link ExternalPhysicalAddress} of external physical address. * Creates {@link ExternalPhysicalAddress} of external physical address.
* *
* @param physicalAddress * @param physicalAddress
* @hide * @hide
@@ -754,7 +754,7 @@ public final class HdmiRecordSources {
} }
/** /**
* Check the byte array of record source. * Checks the byte array of record source.
* @hide * @hide
*/ */
@SystemApi @SystemApi

View File

@@ -67,7 +67,7 @@ public class HdmiTimerRecordSources {
private HdmiTimerRecordSources() {} private HdmiTimerRecordSources() {}
/** /**
* Create {@link TimerRecordSource} for digital source which is used for &lt;Set Digital * Creates {@link TimerRecordSource} for digital source which is used for &lt;Set Digital
* Timer&gt;. * Timer&gt;.
* *
* @param timerInfo timer info used for timer recording * @param timerInfo timer info used for timer recording
@@ -82,7 +82,7 @@ public class HdmiTimerRecordSources {
} }
/** /**
* Create {@link TimerRecordSource} for analogue source which is used for &lt;Set Analogue * Creates {@link TimerRecordSource} for analogue source which is used for &lt;Set Analogue
* Timer&gt;. * Timer&gt;.
* *
* @param timerInfo timer info used for timer recording * @param timerInfo timer info used for timer recording
@@ -97,7 +97,7 @@ public class HdmiTimerRecordSources {
} }
/** /**
* Create {@link TimerRecordSource} for external plug which is used for &lt;Set External * Creates {@link TimerRecordSource} for external plug which is used for &lt;Set External
* Timer&gt;. * Timer&gt;.
* *
* @param timerInfo timer info used for timer recording * @param timerInfo timer info used for timer recording
@@ -112,7 +112,7 @@ public class HdmiTimerRecordSources {
} }
/** /**
* Create {@link TimerRecordSource} for external physical address which is used for &lt;Set * Creates {@link TimerRecordSource} for external physical address which is used for &lt;Set
* External Timer&gt;. * External Timer&gt;.
* *
* @param timerInfo timer info used for timer recording * @param timerInfo timer info used for timer recording
@@ -140,7 +140,7 @@ public class HdmiTimerRecordSources {
} }
/** /**
* Create {@link Duration} for time value. * Creates {@link Duration} for time value.
* *
* @param hour hour in range of [0, 23] * @param hour hour in range of [0, 23]
* @param minute minute in range of [0, 60] * @param minute minute in range of [0, 60]
@@ -162,7 +162,7 @@ public class HdmiTimerRecordSources {
} }
/** /**
* Create {@link Duration} for duration value. * Creates {@link Duration} for duration value.
* *
* @param hour hour in range of [0, 99] * @param hour hour in range of [0, 99]
* @param minute minute in range of [0, 59] * @param minute minute in range of [0, 59]
@@ -184,21 +184,21 @@ public class HdmiTimerRecordSources {
} }
private static class TimeUnit { private static class TimeUnit {
protected final int mHour; /* package */ final int mHour;
protected final int mMinute; /* package */ final int mMinute;
protected TimeUnit(int hour, int minute) { /* package */ TimeUnit(int hour, int minute) {
mHour = hour; mHour = hour;
mMinute = minute; mMinute = minute;
} }
protected int toByteArray(byte[] data, int index) { /* package */ int toByteArray(byte[] data, int index) {
data[index] = toBcdByte(mHour); data[index] = toBcdByte(mHour);
data[index + 1] = toBcdByte(mMinute); data[index + 1] = toBcdByte(mMinute);
return 2; return 2;
} }
protected static byte toBcdByte(int value) { /* package */ static byte toBcdByte(int value) {
int digitOfTen = (value / 10) % 10; int digitOfTen = (value / 10) % 10;
int digitOfOne = value % 10; int digitOfOne = value % 10;
return (byte) ((digitOfTen << 4) | digitOfOne); return (byte) ((digitOfTen << 4) | digitOfOne);
@@ -247,7 +247,7 @@ public class HdmiTimerRecordSources {
RECORDING_SEQUENCE_REPEAT_SATUREDAY); RECORDING_SEQUENCE_REPEAT_SATUREDAY);
/** /**
* Create {@link TimerInfo} with the given information. * Creates {@link TimerInfo} with the given information.
* *
* @param dayOfMonth day of month * @param dayOfMonth day of month
* @param monthOfYear month of year * @param monthOfYear month of year
@@ -426,7 +426,7 @@ public class HdmiTimerRecordSources {
} }
/** /**
* Check the byte array of timer record source. * Checks the byte array of timer record source.
* @param sourcetype * @param sourcetype
* @param recordSource * @param recordSource
* @hide * @hide

View File

@@ -22,11 +22,11 @@ import android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource;
import android.os.RemoteException; import android.os.RemoteException;
import android.util.Log; import android.util.Log;
import libcore.util.EmptyArray;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import libcore.util.EmptyArray;
/** /**
* HdmiTvClient represents HDMI-CEC logical device of type TV in the Android system * HdmiTvClient represents HDMI-CEC logical device of type TV in the Android system
* which acts as TV/Display. It provides with methods that manage, interact with other * which acts as TV/Display. It provides with methods that manage, interact with other
@@ -43,13 +43,13 @@ public final class HdmiTvClient extends HdmiClient {
*/ */
public static final int VENDOR_DATA_SIZE = 16; public static final int VENDOR_DATA_SIZE = 16;
HdmiTvClient(IHdmiControlService service) { /* package */ HdmiTvClient(IHdmiControlService service) {
super(service); super(service);
} }
// Factory method for HdmiTvClient. // Factory method for HdmiTvClient.
// Declared package-private. Accessed by HdmiControlManager only. // Declared package-private. Accessed by HdmiControlManager only.
static HdmiTvClient create(IHdmiControlService service) { /* package */ static HdmiTvClient create(IHdmiControlService service) {
return new HdmiTvClient(service); return new HdmiTvClient(service);
} }
@@ -71,7 +71,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Select a CEC logical device to be a new active source. * Selects a CEC logical device to be a new active source.
* *
* @param logicalAddress logical address of the device to select * @param logicalAddress logical address of the device to select
* @param callback callback to get the result with * @param callback callback to get the result with
@@ -98,7 +98,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Select a HDMI port to be a new route path. * Selects a HDMI port to be a new route path.
* *
* @param portId HDMI port to select * @param portId HDMI port to select
* @param callback callback to get the result with * @param callback callback to get the result with
@@ -128,7 +128,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Set the listener used to get informed of the input change event. * Sets the listener used to get informed of the input change event.
* *
* @param listener listener object * @param listener listener object
*/ */
@@ -168,7 +168,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Set system audio volume * Sets system audio volume
* *
* @param oldIndex current volume index * @param oldIndex current volume index
* @param newIndex volume index to be set * @param newIndex volume index to be set
@@ -183,7 +183,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Set system audio mute status * Sets system audio mute status
* *
* @param mute {@code true} if muted; otherwise, {@code false} * @param mute {@code true} if muted; otherwise, {@code false}
*/ */
@@ -196,7 +196,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Set record listener * Sets record listener
* *
* @param listener * @param listener
*/ */
@@ -216,7 +216,7 @@ public final class HdmiTvClient extends HdmiClient {
@Override @Override
public byte[] getOneTouchRecordSource(int recorderAddress) { public byte[] getOneTouchRecordSource(int recorderAddress) {
HdmiRecordSources.RecordSource source = HdmiRecordSources.RecordSource source =
callback.getOneTouchRecordSource(recorderAddress); callback.onOneTouchRecordSourceRequested(recorderAddress);
if (source == null) { if (source == null) {
return EmptyArray.BYTE; return EmptyArray.BYTE;
} }
@@ -244,13 +244,13 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Start one touch recording with the given recorder address and recorder source. * Starts one touch recording with the given recorder address and recorder source.
* <p> * <p>
* Usage * Usage
* <pre> * <pre>
* HdmiTvClient tvClient = ....; * HdmiTvClient tvClient = ....;
* // for own source. * // for own source.
* OwnSource ownSource = ownHdmiRecordSources.ownSource(); * OwnSource ownSource = HdmiRecordSources.ofOwnSource();
* tvClient.startOneTouchRecord(recorderAddress, ownSource); * tvClient.startOneTouchRecord(recorderAddress, ownSource);
* </pre> * </pre>
*/ */
@@ -269,7 +269,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Stop one touch record. * Stops one touch record.
* *
* @param recorderAddress recorder address where recoding will be stopped * @param recorderAddress recorder address where recoding will be stopped
*/ */
@@ -282,7 +282,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Start timer recording with the given recoder address and recorder source. * Starts timer recording with the given recoder address and recorder source.
* <p> * <p>
* Usage * Usage
* <pre> * <pre>
@@ -331,7 +331,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Clear timer recording with the given recorder address and recording source. * Clears timer recording with the given recorder address and recording source.
* For more details, please refer {@link #startTimerRecording(int, int, TimerRecordSource)}. * For more details, please refer {@link #startTimerRecording(int, int, TimerRecordSource)}.
*/ */
public void clearTimerRecording(int recorderAddress, int sourceType, TimerRecordSource source) { public void clearTimerRecording(int recorderAddress, int sourceType, TimerRecordSource source) {
@@ -357,7 +357,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Set {@link HdmiMhlVendorCommandListener} to get incoming MHL vendor command. * Sets {@link HdmiMhlVendorCommandListener} to get incoming MHL vendor command.
* *
* @param listener to receive incoming MHL vendor command * @param listener to receive incoming MHL vendor command
*/ */
@@ -383,7 +383,7 @@ public final class HdmiTvClient extends HdmiClient {
} }
/** /**
* Send MHL vendor command to the device connected to a port of the given portId. * Sends MHL vendor command to the device connected to a port of the given portId.
* *
* @param portId id of port to send MHL vendor command * @param portId id of port to send MHL vendor command
* @param offset offset in the in given data * @param offset offset in the in given data

View File

@@ -2087,7 +2087,7 @@ public final class HdmiControlService extends SystemService {
assertRunOnServiceThread(); assertRunOnServiceThread();
Intent intent = new Intent(HdmiControlManager.ACTION_OSD_MESSAGE); Intent intent = new Intent(HdmiControlManager.ACTION_OSD_MESSAGE);
intent.putExtra(HdmiControlManager.EXTRA_MESSAGE_ID, messageId); intent.putExtra(HdmiControlManager.EXTRA_MESSAGE_ID, messageId);
intent.putExtra(HdmiControlManager.EXTRA_MESSAGE_EXTRAM_PARAM1, extra); intent.putExtra(HdmiControlManager.EXTRA_MESSAGE_EXTRA_PARAM1, extra);
getContext().sendBroadcastAsUser(intent, UserHandle.ALL, getContext().sendBroadcastAsUser(intent, UserHandle.ALL,
HdmiControlService.PERMISSION); HdmiControlService.PERMISSION);
} }