Merge "TIF: Annotate constants" into nyc-dev
This commit is contained in:
@@ -114,6 +114,13 @@ public final class TvInputManager {
|
||||
*/
|
||||
public static final int VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY = VIDEO_UNAVAILABLE_REASON_END;
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({VIDEO_UNAVAILABLE_REASON_UNKNOWN, VIDEO_UNAVAILABLE_REASON_TUNING,
|
||||
VIDEO_UNAVAILABLE_REASON_WEAK_SIGNAL, VIDEO_UNAVAILABLE_REASON_BUFFERING,
|
||||
VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY})
|
||||
public @interface VideoUnavailableReason {}
|
||||
|
||||
/**
|
||||
* Status for {@link TvInputService.Session#notifyTimeShiftStatusChanged(int)} and
|
||||
* {@link TvView.TvInputCallback#onTimeShiftStatusChanged(String, int)}: Unknown status. Also
|
||||
@@ -143,6 +150,12 @@ public final class TvInputManager {
|
||||
*/
|
||||
public static final int TIME_SHIFT_STATUS_AVAILABLE = 3;
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({TIME_SHIFT_STATUS_UNKNOWN, TIME_SHIFT_STATUS_UNSUPPORTED,
|
||||
TIME_SHIFT_STATUS_UNAVAILABLE, TIME_SHIFT_STATUS_AVAILABLE})
|
||||
public @interface TimeShiftStatus {}
|
||||
|
||||
/**
|
||||
* Value returned by {@link TvInputService.Session#onTimeShiftGetCurrentPosition()} and
|
||||
* {@link TvInputService.Session#onTimeShiftGetStartPosition()} when time shifting has not
|
||||
@@ -208,6 +221,11 @@ public final class TvInputManager {
|
||||
*/
|
||||
public static final int INPUT_STATE_DISCONNECTED = 2;
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({INPUT_STATE_CONNECTED, INPUT_STATE_CONNECTED_STANDBY, INPUT_STATE_DISCONNECTED})
|
||||
public @interface InputState {}
|
||||
|
||||
/**
|
||||
* Broadcast intent action when the user blocked content ratings change. For use with the
|
||||
* {@link #isRatingBlocked}.
|
||||
@@ -696,7 +714,7 @@ public final class TvInputManager {
|
||||
* <li>{@link TvInputManager#INPUT_STATE_DISCONNECTED}
|
||||
* </ul>
|
||||
*/
|
||||
public void onInputStateChanged(String inputId, int state) {
|
||||
public void onInputStateChanged(String inputId, @InputState int state) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1170,6 +1188,7 @@ public final class TvInputManager {
|
||||
* @param inputId The ID of the TV input.
|
||||
* @throws IllegalArgumentException if the argument is {@code null}.
|
||||
*/
|
||||
@InputState
|
||||
public int getInputState(@NonNull String inputId) {
|
||||
Preconditions.checkNotNull(inputId);
|
||||
synchronized (mLock) {
|
||||
|
||||
@@ -528,7 +528,8 @@ public abstract class TvInputService extends Service {
|
||||
* </ul>
|
||||
* @see #notifyVideoAvailable
|
||||
*/
|
||||
public void notifyVideoUnavailable(final int reason) {
|
||||
public void notifyVideoUnavailable(
|
||||
@TvInputManager.VideoUnavailableReason final int reason) {
|
||||
if (reason < TvInputManager.VIDEO_UNAVAILABLE_REASON_START
|
||||
|| reason > TvInputManager.VIDEO_UNAVAILABLE_REASON_END) {
|
||||
Log.e(TAG, "notifyVideoUnavailable - unknown reason: " + reason);
|
||||
@@ -660,7 +661,7 @@ public abstract class TvInputService extends Service {
|
||||
* <li>{@link TvInputManager#TIME_SHIFT_STATUS_AVAILABLE}
|
||||
* </ul>
|
||||
*/
|
||||
public void notifyTimeShiftStatusChanged(final int status) {
|
||||
public void notifyTimeShiftStatusChanged(@TvInputManager.TimeShiftStatus final int status) {
|
||||
executeOrPostRunnableOnMainThread(new Runnable() {
|
||||
@MainThread
|
||||
@Override
|
||||
|
||||
@@ -964,7 +964,8 @@ public class TvView extends ViewGroup {
|
||||
* <li>{@link TvInputManager#VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY}
|
||||
* </ul>
|
||||
*/
|
||||
public void onVideoUnavailable(String inputId, int reason) {
|
||||
public void onVideoUnavailable(
|
||||
String inputId, @TvInputManager.VideoUnavailableReason int reason) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1009,7 +1010,8 @@ public class TvView extends ViewGroup {
|
||||
* <li>{@link TvInputManager#TIME_SHIFT_STATUS_AVAILABLE}
|
||||
* </ul>
|
||||
*/
|
||||
public void onTimeShiftStatusChanged(String inputId, int status) {
|
||||
public void onTimeShiftStatusChanged(
|
||||
String inputId, @TvInputManager.TimeShiftStatus int status) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user