Loading media/java/android/media/tv/TvInputInfo.java +4 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -424,7 +425,7 @@ public final class TvInputInfo implements Parcelable { * @return a CharSequence containing the TV input's label. If the TV input does not have * a label, its name is returned. */ public CharSequence loadLabel(Context context) { public CharSequence loadLabel(@NonNull Context context) { if (TextUtils.isEmpty(mLabel)) { return mService.loadLabel(context.getPackageManager()); } else { Loading Loading @@ -452,7 +453,7 @@ public final class TvInputInfo implements Parcelable { * @return a Drawable containing the TV input's icon. If the TV input does not have an icon, * application's icon is returned. If it's unavailable too, {@code null} is returned. */ public Drawable loadIcon(Context context) { public Drawable loadIcon(@NonNull Context context) { if (mIconUri == null) { return loadServiceIcon(context); } Loading Loading @@ -506,7 +507,7 @@ public final class TvInputInfo implements Parcelable { * @param flags The flags used for parceling. */ @Override public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString(mId); dest.writeString(mParentId); mService.writeToParcel(dest, flags); Loading media/java/android/media/tv/TvInputManager.java +6 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.graphics.Rect; Loading Loading @@ -932,7 +933,7 @@ public final class TvInputManager { * @return the {@link TvInputInfo} for a given TV input. {@code null} if not found. */ @Nullable public TvInputInfo getTvInputInfo(String inputId) { public TvInputInfo getTvInputInfo(@NonNull String inputId) { if (inputId == null) { throw new IllegalArgumentException("inputId cannot be null"); } Loading @@ -956,7 +957,7 @@ public final class TvInputManager { * @param inputId The id of the TV input. * @throws IllegalArgumentException if the argument is {@code null}. */ public int getInputState(String inputId) { public int getInputState(@NonNull String inputId) { if (inputId == null) { throw new IllegalArgumentException("inputId cannot be null"); } Loading @@ -977,7 +978,7 @@ public final class TvInputManager { * @param handler A {@link Handler} that the status change will be delivered to. * @throws IllegalArgumentException if any of the arguments is {@code null}. */ public void registerCallback(TvInputCallback callback, Handler handler) { public void registerCallback(@NonNull TvInputCallback callback, @NonNull Handler handler) { if (callback == null) { throw new IllegalArgumentException("callback cannot be null"); } Loading @@ -995,7 +996,7 @@ public final class TvInputManager { * @param callback The existing callback to remove. * @throws IllegalArgumentException if any of the arguments is {@code null}. */ public void unregisterCallback(final TvInputCallback callback) { public void unregisterCallback(@NonNull final TvInputCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback cannot be null"); } Loading Loading @@ -1047,7 +1048,7 @@ public final class TvInputManager { * @param rating The TV content rating to check. * @return {@code true} if the given TV content rating is blocked, {@code false} otherwise. */ public boolean isRatingBlocked(TvContentRating rating) { public boolean isRatingBlocked(@NonNull TvContentRating rating) { if (rating == null) { throw new IllegalArgumentException("rating cannot be null"); } Loading media/java/android/media/tv/TvInputService.java +7 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SystemApi; Loading Loading @@ -314,7 +315,7 @@ public abstract class TvInputService extends Service { @SystemApi public void notifySessionEvent(final String eventType, final Bundle eventArgs) { if (eventType == null) { throw new IllegalArgumentException("eventType should not be null."); throw new IllegalArgumentException("eventType cannot be null"); } executeOrPostRunnable(new Runnable() { @Override Loading Loading @@ -544,7 +545,10 @@ public abstract class TvInputService extends Service { * @see #notifyContentAllowed * @see TvInputManager */ public void notifyContentBlocked(final TvContentRating rating) { public void notifyContentBlocked(@NonNull final TvContentRating rating) { if (rating == null) { throw new IllegalArgumentException("rating cannot be null"); } executeOrPostRunnable(new Runnable() { @Override public void run() { Loading Loading @@ -828,7 +832,7 @@ public abstract class TvInputService extends Service { * @hide */ @SystemApi public void onAppPrivateCommand(String action, Bundle data) { public void onAppPrivateCommand(@NonNull String action, Bundle data) { } /** 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.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.Context; Loading Loading @@ -273,7 +274,7 @@ public class TvView extends ViewGroup { * @param inputId The ID of TV input which will play the given channel. * @param channelUri The URI of a channel. */ public void tune(String inputId, Uri channelUri) { public void tune(@NonNull String inputId, Uri channelUri) { tune(inputId, channelUri, null); } Loading Loading @@ -494,7 +495,7 @@ public class TvView extends ViewGroup { * @hide */ @SystemApi public void sendAppPrivateCommand(String action, Bundle data) { public void sendAppPrivateCommand(@NonNull String action, Bundle data) { if (TextUtils.isEmpty(action)) { throw new IllegalArgumentException("action cannot be null or an empty string"); } Loading Loading
media/java/android/media/tv/TvInputInfo.java +4 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -424,7 +425,7 @@ public final class TvInputInfo implements Parcelable { * @return a CharSequence containing the TV input's label. If the TV input does not have * a label, its name is returned. */ public CharSequence loadLabel(Context context) { public CharSequence loadLabel(@NonNull Context context) { if (TextUtils.isEmpty(mLabel)) { return mService.loadLabel(context.getPackageManager()); } else { Loading Loading @@ -452,7 +453,7 @@ public final class TvInputInfo implements Parcelable { * @return a Drawable containing the TV input's icon. If the TV input does not have an icon, * application's icon is returned. If it's unavailable too, {@code null} is returned. */ public Drawable loadIcon(Context context) { public Drawable loadIcon(@NonNull Context context) { if (mIconUri == null) { return loadServiceIcon(context); } Loading Loading @@ -506,7 +507,7 @@ public final class TvInputInfo implements Parcelable { * @param flags The flags used for parceling. */ @Override public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString(mId); dest.writeString(mParentId); mService.writeToParcel(dest, flags); Loading
media/java/android/media/tv/TvInputManager.java +6 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.graphics.Rect; Loading Loading @@ -932,7 +933,7 @@ public final class TvInputManager { * @return the {@link TvInputInfo} for a given TV input. {@code null} if not found. */ @Nullable public TvInputInfo getTvInputInfo(String inputId) { public TvInputInfo getTvInputInfo(@NonNull String inputId) { if (inputId == null) { throw new IllegalArgumentException("inputId cannot be null"); } Loading @@ -956,7 +957,7 @@ public final class TvInputManager { * @param inputId The id of the TV input. * @throws IllegalArgumentException if the argument is {@code null}. */ public int getInputState(String inputId) { public int getInputState(@NonNull String inputId) { if (inputId == null) { throw new IllegalArgumentException("inputId cannot be null"); } Loading @@ -977,7 +978,7 @@ public final class TvInputManager { * @param handler A {@link Handler} that the status change will be delivered to. * @throws IllegalArgumentException if any of the arguments is {@code null}. */ public void registerCallback(TvInputCallback callback, Handler handler) { public void registerCallback(@NonNull TvInputCallback callback, @NonNull Handler handler) { if (callback == null) { throw new IllegalArgumentException("callback cannot be null"); } Loading @@ -995,7 +996,7 @@ public final class TvInputManager { * @param callback The existing callback to remove. * @throws IllegalArgumentException if any of the arguments is {@code null}. */ public void unregisterCallback(final TvInputCallback callback) { public void unregisterCallback(@NonNull final TvInputCallback callback) { if (callback == null) { throw new IllegalArgumentException("callback cannot be null"); } Loading Loading @@ -1047,7 +1048,7 @@ public final class TvInputManager { * @param rating The TV content rating to check. * @return {@code true} if the given TV content rating is blocked, {@code false} otherwise. */ public boolean isRatingBlocked(TvContentRating rating) { public boolean isRatingBlocked(@NonNull TvContentRating rating) { if (rating == null) { throw new IllegalArgumentException("rating cannot be null"); } Loading
media/java/android/media/tv/TvInputService.java +7 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.media.tv; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SystemApi; Loading Loading @@ -314,7 +315,7 @@ public abstract class TvInputService extends Service { @SystemApi public void notifySessionEvent(final String eventType, final Bundle eventArgs) { if (eventType == null) { throw new IllegalArgumentException("eventType should not be null."); throw new IllegalArgumentException("eventType cannot be null"); } executeOrPostRunnable(new Runnable() { @Override Loading Loading @@ -544,7 +545,10 @@ public abstract class TvInputService extends Service { * @see #notifyContentAllowed * @see TvInputManager */ public void notifyContentBlocked(final TvContentRating rating) { public void notifyContentBlocked(@NonNull final TvContentRating rating) { if (rating == null) { throw new IllegalArgumentException("rating cannot be null"); } executeOrPostRunnable(new Runnable() { @Override public void run() { Loading Loading @@ -828,7 +832,7 @@ public abstract class TvInputService extends Service { * @hide */ @SystemApi public void onAppPrivateCommand(String action, Bundle data) { public void onAppPrivateCommand(@NonNull String action, Bundle data) { } /** 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.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.content.Context; Loading Loading @@ -273,7 +274,7 @@ public class TvView extends ViewGroup { * @param inputId The ID of TV input which will play the given channel. * @param channelUri The URI of a channel. */ public void tune(String inputId, Uri channelUri) { public void tune(@NonNull String inputId, Uri channelUri) { tune(inputId, channelUri, null); } Loading Loading @@ -494,7 +495,7 @@ public class TvView extends ViewGroup { * @hide */ @SystemApi public void sendAppPrivateCommand(String action, Bundle data) { public void sendAppPrivateCommand(@NonNull String action, Bundle data) { if (TextUtils.isEmpty(action)) { throw new IllegalArgumentException("action cannot be null or an empty string"); } Loading