Freigeben über


TvInputService.Session.NotifyContentAllowed Method

Definition

Informs the application that the user is allowed to watch the current program content.

[Android.Runtime.Register("notifyContentAllowed", "()V", "GetNotifyContentAllowedHandler")]
public virtual void NotifyContentAllowed ();
[<Android.Runtime.Register("notifyContentAllowed", "()V", "GetNotifyContentAllowedHandler")>]
abstract member NotifyContentAllowed : unit -> unit
override this.NotifyContentAllowed : unit -> unit
Attributes

Remarks

Informs the application that the user is allowed to watch the current program content.

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. 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 allowed by the user, the TV input service must call this method to notify the application that is permitted to show the content.

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.notifyContentAllowed().

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