TvInputService.Session.NotifyContentBlocked(TvContentRating) Method

Definition

Informs the application that the current program content is blocked by parent controls.

[Android.Runtime.Register("notifyContentBlocked", "(Landroid/media/tv/TvContentRating;)V", "GetNotifyContentBlocked_Landroid_media_tv_TvContentRating_Handler")]
public virtual void NotifyContentBlocked (Android.Media.TV.TvContentRating rating);
[<Android.Runtime.Register("notifyContentBlocked", "(Landroid/media/tv/TvContentRating;)V", "GetNotifyContentBlocked_Landroid_media_tv_TvContentRating_Handler")>]
abstract member NotifyContentBlocked : Android.Media.TV.TvContentRating -> unit
override this.NotifyContentBlocked : Android.Media.TV.TvContentRating -> unit

Parameters

rating
TvContentRating

The content rating for the current TV program. Can be TvContentRating#UNRATED.

Attributes

Remarks

Informs the application that the current program content is blocked by parent controls.

Each TV input service is required to query the system whether the user is allowed to watch the current program before showing it to the user if the parental controls is enabled (i.e. TvInputManager#isParentalControlsEnabled TvInputManager.isParentalControlsEnabled() returns true). Whether the TV input service should block the content or not is determined by invoking TvInputManager#isRatingBlocked TvInputManager.isRatingBlocked(TvContentRating) with the content rating for the current program or TvContentRating#UNRATED in case the rating information is missing. Then the 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.

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 TvInputManager#ACTION_BLOCKED_RATINGS_CHANGED and TvInputManager#ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED and immediately reevaluate the current program with the new parental controls settings.

Java documentation for android.media.tv.TvInputService.Session.notifyContentBlocked(android.media.tv.TvContentRating).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to