Loading media/java/android/media/tv/TvContentRating.java +8 −3 Original line number Diff line number Diff line Loading @@ -783,10 +783,15 @@ public final class TvContentRating { private final int mHashCode; /** * Rating constant denoting unrated content. * Rating constant denoting unrated content. Used to handle the case where the content rating * information is missing. * * <p>TV input services can call {@link TvInputManager#isRatingBlocked} with this constant to * determine whether they should block unrated content. The subsequent call to * {@link TvInputService.Session#notifyContentBlocked} with the same constant notifies * applications that the current program content is blocked by parental controls. */ public static final TvContentRating UNRATED = new TvContentRating("com.android.tv", "", "UNRATED", null); public static final TvContentRating UNRATED = new TvContentRating("null", "null", "null", null); /** * Creates a {@code TvContentRating} object with predefined content rating strings. Loading media/java/android/media/tv/TvInputManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1035,7 +1035,7 @@ public final class TvInputManager { /** * Checks whether a given TV content rating is blocked by the user. * * @param rating The TV content rating to check. * @param rating The TV content rating to check. Can be {@link TvContentRating#UNRATED}. * @return {@code true} if the given TV content rating is blocked, {@code false} otherwise. */ public boolean isRatingBlocked(@NonNull TvContentRating rating) { Loading media/java/android/media/tv/TvInputService.java +8 −6 Original line number Diff line number Diff line Loading @@ -528,11 +528,12 @@ public abstract class TvInputService extends Service { * TvInputManager.isParentalControlsEnabled()} returns {@code true}). Whether the TV input * service should block the content or not is determined by invoking * {@link TvInputManager#isRatingBlocked TvInputManager.isRatingBlocked(TvContentRating)} * with the content rating for the current program. Then the {@link TvInputManager} makes a * judgment based on the user blocked ratings stored in the secure settings and returns the * result. If the rating in question turns out to be blocked, the TV input service must * immediately block the content and call this method with the content rating of the current * program to prompt the PIN verification screen. * with the content rating for the current program or {@link TvContentRating#UNRATED} in * case the rating information is missing. Then the {@link TvInputManager} makes a judgment * based on the user blocked ratings stored in the secure settings and returns the result. * If the rating in question turns out to be blocked, the TV input service must immediately * block the content and call this method with the content rating of the current program to * prompt the PIN verification screen. * * <p>Each TV input service also needs to continuously listen to any changes made to the * parental controls settings by registering a broadcast receiver to receive Loading @@ -540,7 +541,8 @@ public abstract class TvInputService extends Service { * {@link TvInputManager#ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED} and immediately * reevaluate the current program with the new parental controls settings. * * @param rating The content rating for the current TV program. * @param rating The content rating for the current TV program. Can be * {@link TvContentRating#UNRATED}. * @see #notifyContentAllowed * @see TvInputManager */ Loading Loading
media/java/android/media/tv/TvContentRating.java +8 −3 Original line number Diff line number Diff line Loading @@ -783,10 +783,15 @@ public final class TvContentRating { private final int mHashCode; /** * Rating constant denoting unrated content. * Rating constant denoting unrated content. Used to handle the case where the content rating * information is missing. * * <p>TV input services can call {@link TvInputManager#isRatingBlocked} with this constant to * determine whether they should block unrated content. The subsequent call to * {@link TvInputService.Session#notifyContentBlocked} with the same constant notifies * applications that the current program content is blocked by parental controls. */ public static final TvContentRating UNRATED = new TvContentRating("com.android.tv", "", "UNRATED", null); public static final TvContentRating UNRATED = new TvContentRating("null", "null", "null", null); /** * Creates a {@code TvContentRating} object with predefined content rating strings. Loading
media/java/android/media/tv/TvInputManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1035,7 +1035,7 @@ public final class TvInputManager { /** * Checks whether a given TV content rating is blocked by the user. * * @param rating The TV content rating to check. * @param rating The TV content rating to check. Can be {@link TvContentRating#UNRATED}. * @return {@code true} if the given TV content rating is blocked, {@code false} otherwise. */ public boolean isRatingBlocked(@NonNull TvContentRating rating) { Loading
media/java/android/media/tv/TvInputService.java +8 −6 Original line number Diff line number Diff line Loading @@ -528,11 +528,12 @@ public abstract class TvInputService extends Service { * TvInputManager.isParentalControlsEnabled()} returns {@code true}). Whether the TV input * service should block the content or not is determined by invoking * {@link TvInputManager#isRatingBlocked TvInputManager.isRatingBlocked(TvContentRating)} * with the content rating for the current program. Then the {@link TvInputManager} makes a * judgment based on the user blocked ratings stored in the secure settings and returns the * result. If the rating in question turns out to be blocked, the TV input service must * immediately block the content and call this method with the content rating of the current * program to prompt the PIN verification screen. * with the content rating for the current program or {@link TvContentRating#UNRATED} in * case the rating information is missing. Then the {@link TvInputManager} makes a judgment * based on the user blocked ratings stored in the secure settings and returns the result. * If the rating in question turns out to be blocked, the TV input service must immediately * block the content and call this method with the content rating of the current program to * prompt the PIN verification screen. * * <p>Each TV input service also needs to continuously listen to any changes made to the * parental controls settings by registering a broadcast receiver to receive Loading @@ -540,7 +541,8 @@ public abstract class TvInputService extends Service { * {@link TvInputManager#ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED} and immediately * reevaluate the current program with the new parental controls settings. * * @param rating The content rating for the current TV program. * @param rating The content rating for the current TV program. Can be * {@link TvContentRating#UNRATED}. * @see #notifyContentAllowed * @see TvInputManager */ Loading