method public void setStreamVolume(float);
method public void setTvInputListener(android.media.tv.TvView.TvInputListener);
method public void tune(java.lang.String, android.net.Uri);
- field public static final int ERROR_INPUT_DISCONNECTED = 1; // 0x1
- field public static final int ERROR_INPUT_NOT_CONNECTED = 0; // 0x0
}
public static abstract interface TvView.OnUnhandledInputEventListener {
public static abstract class TvView.TvInputListener {
ctor public TvView.TvInputListener();
method public void onChannelRetuned(java.lang.String, android.net.Uri);
+ method public void onConnectionFailed(java.lang.String);
method public void onContentAllowed(java.lang.String);
method public void onContentBlocked(java.lang.String, android.media.tv.TvContentRating);
- method public void onError(java.lang.String, int);
+ method public void onDisconnected(java.lang.String);
method public void onTrackSelected(java.lang.String, int, java.lang.String);
method public void onTracksChanged(java.lang.String, java.util.List<android.media.tv.TvTrackInfo>);
method public void onVideoAvailable(java.lang.String);
// STOPSHIP: Turn debugging off.
private static final boolean DEBUG = true;
- /**
- * Passed with {@link TvInputListener#onError(String, int)}. Indicates that the connection to
- * the requested TV input was not established thus the view is unable to handle the further
- * operations.
- */
- public static final int ERROR_INPUT_NOT_CONNECTED = 0;
-
- /**
- * Passed with {@link TvInputListener#onError(String, int)}. Indicates that the underlying TV
- * input has been disconnected.
- */
- public static final int ERROR_INPUT_DISCONNECTED = 1;
-
private static final int VIDEO_SIZE_VALUE_UNKNOWN = 0;
private static final int ZORDER_MEDIA = 0;
public abstract static class TvInputListener {
/**
- * This is invoked when an error occurred while handling requested operation.
+ * This is invoked when an error occurred while establishing a connection to the underlying
+ * TV input.
+ *
+ * @param inputId The ID of the TV input bound to this view.
+ */
+ public void onConnectionFailed(String inputId) {
+ }
+
+ /**
+ * This is invoked when the existing connection to the underlying TV input is lost.
*
* @param inputId The ID of the TV input bound to this view.
- * @param errorCode The error code. For the details of error code, please see
- * {@link TvView}.
*/
- public void onError(String inputId, int errorCode) {
+ public void onDisconnected(String inputId) {
}
/**
}
} else {
if (mListener != null) {
- mListener.onError(mInputId, ERROR_INPUT_NOT_CONNECTED);
+ mListener.onConnectionFailed(mInputId);
}
}
}
mSessionCallback = null;
mSession = null;
if (mListener != null) {
- mListener.onError(mInputId, ERROR_INPUT_DISCONNECTED);
+ mListener.onDisconnected(mInputId);
}
}