Loading media/java/android/media/tv/TvContract.java +7 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.ComponentName; import android.content.ContentResolver; Loading Loading @@ -156,7 +157,7 @@ public final class TvContract { * @param inputId The ID of the TV input to build a channels URI for. If {@code null}, builds a * URI for all the TV inputs. */ public static final Uri buildChannelsUriForInput(String inputId) { public static final Uri buildChannelsUriForInput(@Nullable String inputId) { return buildChannelsUriForInput(inputId, false); } Loading @@ -171,7 +172,8 @@ public final class TvContract { * @hide */ @SystemApi public static final Uri buildChannelsUriForInput(String inputId, boolean browsableOnly) { public static final Uri buildChannelsUriForInput(@Nullable String inputId, boolean browsableOnly) { Uri.Builder builder = Channels.CONTENT_URI.buildUpon(); if (inputId != null) { builder.appendQueryParameter(PARAM_INPUT, inputId); Loading @@ -193,8 +195,8 @@ public final class TvContract { * @hide */ @SystemApi public static final Uri buildChannelsUriForInput(String inputId, String genre, boolean browsableOnly) { public static final Uri buildChannelsUriForInput(@Nullable String inputId, @Nullable String genre, boolean browsableOnly) { if (genre == null) { return buildChannelsUriForInput(inputId, browsableOnly); } Loading Loading @@ -509,6 +511,7 @@ public final class TvContract { * is not defined for the given video format. * @see #COLUMN_VIDEO_FORMAT */ @Nullable public static final String getVideoResolution(String videoFormat) { return VIDEO_FORMAT_TO_RESOLUTION_MAP.get(videoFormat); } Loading media/java/android/media/tv/TvInputManager.java +7 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SystemApi; import android.graphics.Rect; import android.media.MediaPlayer; Loading Loading @@ -229,7 +230,7 @@ public final class TvInputManager { * @param session A {@link TvInputManager.Session} instance created. This can be * {@code null} if the creation request failed. */ public void onSessionCreated(Session session) { public void onSessionCreated(@Nullable Session session) { } /** Loading Loading @@ -270,7 +271,7 @@ public final class TvInputManager { * @param trackId The ID of the selected track. When {@code null} the currently selected * track for a given type should be unselected. */ public void onTrackSelected(Session session, int type, String trackId) { public void onTrackSelected(Session session, int type, @Nullable String trackId) { } /** Loading Loading @@ -930,6 +931,7 @@ public final class TvInputManager { * @param inputId The ID of the TV input. * @return the {@link TvInputInfo} for a given TV input. {@code null} if not found. */ @Nullable public TvInputInfo getTvInputInfo(String inputId) { if (inputId == null) { throw new IllegalArgumentException("inputId cannot be null"); Loading Loading @@ -1501,7 +1503,7 @@ public final class TvInputManager { * track of the given type will be unselected. * @see #getTracks */ public void selectTrack(int type, String trackId) { public void selectTrack(int type, @Nullable String trackId) { synchronized (mMetadataLock) { if (type == TvTrackInfo.TYPE_AUDIO) { if (trackId != null && !containsTrack(mAudioTracks, trackId)) { Loading Loading @@ -1550,6 +1552,7 @@ public final class TvInputManager { * {@link TvTrackInfo#TYPE_VIDEO} or {@link TvTrackInfo#TYPE_SUBTITLE}. * @return the list of tracks for the given type. */ @Nullable public List<TvTrackInfo> getTracks(int type) { synchronized (mMetadataLock) { if (type == TvTrackInfo.TYPE_AUDIO) { Loading Loading @@ -1579,6 +1582,7 @@ public final class TvInputManager { * @return the ID of the selected track. * @see #selectTrack */ @Nullable public String getSelectedTrack(int type) { synchronized (mMetadataLock) { if (type == TvTrackInfo.TYPE_AUDIO) { Loading media/java/android/media/tv/TvInputService.java +8 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.app.Service; Loading Loading @@ -166,6 +167,7 @@ public abstract class TvInputService extends Service { * </p> * @param inputId The ID of the TV input associated with the session. */ @Nullable public abstract Session onCreateSession(String inputId); /** Loading @@ -176,6 +178,7 @@ public abstract class TvInputService extends Service { * @param hardwareInfo {@link TvInputHardwareInfo} object just added. * @hide */ @Nullable @SystemApi public TvInputInfo onHardwareAdded(TvInputHardwareInfo hardwareInfo) { return null; Loading @@ -189,6 +192,7 @@ public abstract class TvInputService extends Service { * @param hardwareInfo {@link TvInputHardwareInfo} object just removed. * @hide */ @Nullable @SystemApi public String onHardwareRemoved(TvInputHardwareInfo hardwareInfo) { return null; Loading @@ -202,6 +206,7 @@ public abstract class TvInputService extends Service { * @param deviceInfo {@link HdmiDeviceInfo} object just added. * @hide */ @Nullable @SystemApi public TvInputInfo onHdmiDeviceAdded(HdmiDeviceInfo deviceInfo) { return null; Loading @@ -215,6 +220,7 @@ public abstract class TvInputService extends Service { * @param deviceInfo {@link HdmiDeviceInfo} object just removed. * @hide */ @Nullable @SystemApi public String onHdmiDeviceRemoved(HdmiDeviceInfo deviceInfo) { return null; Loading Loading @@ -707,7 +713,7 @@ public abstract class TvInputService extends Service { * input session. * @return {@code true} if the surface was set, {@code false} otherwise. */ public abstract boolean onSetSurface(Surface surface); public abstract boolean onSetSurface(@Nullable Surface surface); /** * Called after any structural changes (format or size) have been made to the Loading Loading @@ -812,7 +818,7 @@ public abstract class TvInputService extends Service { * @return {@code true} if the track selection was successful, {@code false} otherwise. * @see #notifyTrackSelected */ public boolean onSelectTrack(int type, String trackId) { public boolean onSelectTrack(int type, @Nullable String trackId) { return false; } Loading media/java/android/media/tv/TvView.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.Context; import android.graphics.Canvas; Loading Loading @@ -174,7 +175,7 @@ public class TvView extends ViewGroup { * @param callback The callback to receive events. A value of {@code null} removes the existing * callback. */ public void setCallback(TvInputCallback callback) { public void setCallback(@Nullable TvInputCallback callback) { mCallback = callback; } Loading Loading @@ -473,7 +474,7 @@ public class TvView extends ViewGroup { * @param callback The callback to receive time shift position changes. A value of {@code null} * removes the existing callback. */ public void setTimeShiftPositionCallback(TimeShiftPositionCallback callback) { public void setTimeShiftPositionCallback(@Nullable TimeShiftPositionCallback callback) { mTimeShiftPositionCallback = callback; ensurePositionTracking(); } Loading Loading
media/java/android/media/tv/TvContract.java +7 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.ComponentName; import android.content.ContentResolver; Loading Loading @@ -156,7 +157,7 @@ public final class TvContract { * @param inputId The ID of the TV input to build a channels URI for. If {@code null}, builds a * URI for all the TV inputs. */ public static final Uri buildChannelsUriForInput(String inputId) { public static final Uri buildChannelsUriForInput(@Nullable String inputId) { return buildChannelsUriForInput(inputId, false); } Loading @@ -171,7 +172,8 @@ public final class TvContract { * @hide */ @SystemApi public static final Uri buildChannelsUriForInput(String inputId, boolean browsableOnly) { public static final Uri buildChannelsUriForInput(@Nullable String inputId, boolean browsableOnly) { Uri.Builder builder = Channels.CONTENT_URI.buildUpon(); if (inputId != null) { builder.appendQueryParameter(PARAM_INPUT, inputId); Loading @@ -193,8 +195,8 @@ public final class TvContract { * @hide */ @SystemApi public static final Uri buildChannelsUriForInput(String inputId, String genre, boolean browsableOnly) { public static final Uri buildChannelsUriForInput(@Nullable String inputId, @Nullable String genre, boolean browsableOnly) { if (genre == null) { return buildChannelsUriForInput(inputId, browsableOnly); } Loading Loading @@ -509,6 +511,7 @@ public final class TvContract { * is not defined for the given video format. * @see #COLUMN_VIDEO_FORMAT */ @Nullable public static final String getVideoResolution(String videoFormat) { return VIDEO_FORMAT_TO_RESOLUTION_MAP.get(videoFormat); } Loading
media/java/android/media/tv/TvInputManager.java +7 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SystemApi; import android.graphics.Rect; import android.media.MediaPlayer; Loading Loading @@ -229,7 +230,7 @@ public final class TvInputManager { * @param session A {@link TvInputManager.Session} instance created. This can be * {@code null} if the creation request failed. */ public void onSessionCreated(Session session) { public void onSessionCreated(@Nullable Session session) { } /** Loading Loading @@ -270,7 +271,7 @@ public final class TvInputManager { * @param trackId The ID of the selected track. When {@code null} the currently selected * track for a given type should be unselected. */ public void onTrackSelected(Session session, int type, String trackId) { public void onTrackSelected(Session session, int type, @Nullable String trackId) { } /** Loading Loading @@ -930,6 +931,7 @@ public final class TvInputManager { * @param inputId The ID of the TV input. * @return the {@link TvInputInfo} for a given TV input. {@code null} if not found. */ @Nullable public TvInputInfo getTvInputInfo(String inputId) { if (inputId == null) { throw new IllegalArgumentException("inputId cannot be null"); Loading Loading @@ -1501,7 +1503,7 @@ public final class TvInputManager { * track of the given type will be unselected. * @see #getTracks */ public void selectTrack(int type, String trackId) { public void selectTrack(int type, @Nullable String trackId) { synchronized (mMetadataLock) { if (type == TvTrackInfo.TYPE_AUDIO) { if (trackId != null && !containsTrack(mAudioTracks, trackId)) { Loading Loading @@ -1550,6 +1552,7 @@ public final class TvInputManager { * {@link TvTrackInfo#TYPE_VIDEO} or {@link TvTrackInfo#TYPE_SUBTITLE}. * @return the list of tracks for the given type. */ @Nullable public List<TvTrackInfo> getTracks(int type) { synchronized (mMetadataLock) { if (type == TvTrackInfo.TYPE_AUDIO) { Loading Loading @@ -1579,6 +1582,7 @@ public final class TvInputManager { * @return the ID of the selected track. * @see #selectTrack */ @Nullable public String getSelectedTrack(int type) { synchronized (mMetadataLock) { if (type == TvTrackInfo.TYPE_AUDIO) { Loading
media/java/android/media/tv/TvInputService.java +8 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.app.Service; Loading Loading @@ -166,6 +167,7 @@ public abstract class TvInputService extends Service { * </p> * @param inputId The ID of the TV input associated with the session. */ @Nullable public abstract Session onCreateSession(String inputId); /** Loading @@ -176,6 +178,7 @@ public abstract class TvInputService extends Service { * @param hardwareInfo {@link TvInputHardwareInfo} object just added. * @hide */ @Nullable @SystemApi public TvInputInfo onHardwareAdded(TvInputHardwareInfo hardwareInfo) { return null; Loading @@ -189,6 +192,7 @@ public abstract class TvInputService extends Service { * @param hardwareInfo {@link TvInputHardwareInfo} object just removed. * @hide */ @Nullable @SystemApi public String onHardwareRemoved(TvInputHardwareInfo hardwareInfo) { return null; Loading @@ -202,6 +206,7 @@ public abstract class TvInputService extends Service { * @param deviceInfo {@link HdmiDeviceInfo} object just added. * @hide */ @Nullable @SystemApi public TvInputInfo onHdmiDeviceAdded(HdmiDeviceInfo deviceInfo) { return null; Loading @@ -215,6 +220,7 @@ public abstract class TvInputService extends Service { * @param deviceInfo {@link HdmiDeviceInfo} object just removed. * @hide */ @Nullable @SystemApi public String onHdmiDeviceRemoved(HdmiDeviceInfo deviceInfo) { return null; Loading Loading @@ -707,7 +713,7 @@ public abstract class TvInputService extends Service { * input session. * @return {@code true} if the surface was set, {@code false} otherwise. */ public abstract boolean onSetSurface(Surface surface); public abstract boolean onSetSurface(@Nullable Surface surface); /** * Called after any structural changes (format or size) have been made to the Loading Loading @@ -812,7 +818,7 @@ public abstract class TvInputService extends Service { * @return {@code true} if the track selection was successful, {@code false} otherwise. * @see #notifyTrackSelected */ public boolean onSelectTrack(int type, String trackId) { public boolean onSelectTrack(int type, @Nullable String trackId) { return false; } Loading
media/java/android/media/tv/TvView.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.Context; import android.graphics.Canvas; Loading Loading @@ -174,7 +175,7 @@ public class TvView extends ViewGroup { * @param callback The callback to receive events. A value of {@code null} removes the existing * callback. */ public void setCallback(TvInputCallback callback) { public void setCallback(@Nullable TvInputCallback callback) { mCallback = callback; } Loading Loading @@ -473,7 +474,7 @@ public class TvView extends ViewGroup { * @param callback The callback to receive time shift position changes. A value of {@code null} * removes the existing callback. */ public void setTimeShiftPositionCallback(TimeShiftPositionCallback callback) { public void setTimeShiftPositionCallback(@Nullable TimeShiftPositionCallback callback) { mTimeShiftPositionCallback = callback; ensurePositionTracking(); } Loading