IParentalControlsComponentV2
This is the top-level component used for interfacing with parental controls.
IParentalControlsComponentV2 is an experimental extension of IParentalControlsComponent
that grants access to IParentalControlsPreferenceWriter and the generic PIN challenge
workflow: invokeValidatePinWorkflow
.
Extends
Methods
gateContentPlayback()
gateContentPlayback(
contentRating
?):Promise
<IGateContentPlaybackResponse
>
Parameters
contentRating?
IContentRating
rating for the content that is a candidate for playback. This field is optional and may be ommitted such as in the case that ratings information is unavailable; in that case parental controls will require a PIN challenge irrespective of the current restriction level.
Returns
Promise
<IGateContentPlaybackResponse
>
a Promise that resolves to an IGateContentPlaybackResponse indicating the outcome of the request (and PIN challenge if it was required).
Brief
Invoke PIN challenge for viewing potentially restricted content.
This method delegates to parental controls to decide whether a PIN challenge is required before permitting the viewing of content with the passed rating information. The ratings parameter is optional; if ratings information is not supplied (such as in the case that it is not available) this method defaults to requiring the PIN challenge.
If the rating information passed is more restrictive than permitted by the current restriction level preference, this method will present a PIN challenge to the user in the form of an unescapable modal dialog; that is, the user must either successfully validate their PIN or cancel the validation. Attempts to navigate away from the PIN challenge (such as by pressing back or a provider shortcut on the remote) will implicitly cancel PIN validation. The action that should be taken by the caller is relayed in the resolved IGateContentPlaybackResponse#canPlaybackProceed value.
The returned Promise is resolved once the request has been resolved by parental controls (either because the PIN challenge was successfully validated or was unnecessary). The modal dialog has no timeout, so integrators should take into account that the Promise may not be resolved immediately. The parental controls dialog will remain in the foreground (as an overlay over the calling app) until it is resolved.
Pre
caller requires privilege
com.amazon.kepler.parental_controls.gates.restricted-content-playback
to invoke this method.
Pre
caller must be an interactive application that is presently running in the foreground.
Inherited from
IParentalControlsComponentV2
.gateContentPlayback
getContentRestrictionLevelsByDescendingRestrictedness()
getContentRestrictionLevelsByDescendingRestrictedness():
Promise
<string
[]>
Get the fully qualified names of all content restriction levels for the device based on the current viewing region for that device.
Returns
Promise
<string
[]>
all content restriction levels in order most to least restrictive, e.g. [General, Family, …, Mature] for the US viewing region.
Inherited from
IParentalControlsComponentV2
.getContentRestrictionLevelsByDescendingRestrictedness
getMajorVersion()
getMajorVersion():
number
Returns
number
Inherited from
IParentalControlsComponentV2
.getMajorVersion
getMinorVersion()
getMinorVersion():
number
Returns
number
Inherited from
IParentalControlsComponentV2
.getMinorVersion
getPatchVersion()
getPatchVersion():
number
Returns
number
Inherited from
IParentalControlsComponentV2
.getPatchVersion
invokeChangePinWorkflow()
invokeChangePinWorkflow():
Promise
<IChangePinResponse
>
Invokes a workflow for the user to change their PCON PIN from a preexisting PIN, regardless if PCON is enabled. This workflow would first prompt the PIN challenge where the user must either successfully validate their existing PIN or cancel the validation. Afterwards, the user may set a new PIN. Note that this will override the previous PIN.
Attempts to navigate away from the PIN challenge or the set PIN workflow (such as by pressing back or a provider shortcut on the remote) will implicitly cancel either workflow. The action that should be taken by the caller is relayed in the IChangePinResponse#wasPinChanged value passed to the IChangePinListener.
The {!ref changePinListener} listener is invoked once the request has been resolved by PCON. The modal dialog has no timeout, so integrators should take into account that the listener may not be invoked immediately. The PCON dialog will remain in the foreground until it is resolved.
Returns
Promise
<IChangePinResponse
>
an instance of ISubscription that can be used to cancel the listener from being called back and associate request context to the callback.
Throws
SecurityError if required privilege(s) are not declared in the caller's application manifest.
!pre caller requires privilege
com.amazon.kepler.parental_controls.gates.change-pin
!pre caller must be an interactive application that is presently running in the foreground.
!pre the device must be internet-connected or the PIN must be cached from a previous successful PIN challenge. First time setup cannot be completed without internet connectivity.
invokeValidatePinWorkflow()
invokeValidatePinWorkflow():
Promise
<IValidatePinResponse
>
Returns
Promise
<IValidatePinResponse
>
an instance of ISubscription that can be used to cancel the listener from being called back and associate request context to the callback.
Brief
Invoke a general-purpose PIN challenge workflow for gating a restricted user action.
This method will present a PIN challenge to the user in the form of an unescapable modal dialog; that is, the user must either successfully validate their PIN or cancel the validation. Attempts to navigate away from the PIN challenge (such as by pressing back or a provider shortcut on the remote) will implicitly cancel PIN validation. The action that should be taken by the caller is relayed in the IValidatePinResponse#isPinValid value passed to the IValidatePinListener.
The PIN is not passed to this method, but rather collected from the user directly using the modal dialog.
The {@ref IValidatePinListener} listener is invoked once the request has been resolved by parental controls (either because the PIN challenge was successfully validated or was unnecessary). The modal dialog has no timeout, so integrators should take into account that the listener may not be invoked immediately. The parental controls dialog will remain in the foreground (as an overlay over the calling app) until it is resolved.
Pre
caller requires privilege
com.amazon.kepler.parental_controls.gates.validate-pin
to invoke this
method.
Pre
caller must be an interactive application that is presently running in the foreground.
Inherited from
IParentalControlsComponentV2
.invokeValidatePinWorkflow
isContentRestricted()
isContentRestricted(
contentRating
?):Promise
<boolean
>
Queries whether content with the supplied rating is considered restricted on the device based on the current content restriction level (aka viewing restrictions). If true, features like automatic playback of preview content should be disabled for this content.
For an interactive version of this API method that prompts the user
for their PIN if the content is restricted, use gateContentPlayback
.
Parameters
contentRating?
IContentRating
Returns
Promise
<boolean
>
Inherited from
IParentalControlsComponentV2
.isContentRestricted
makePreferenceReader()
makePreferenceReader():
IParentalControlsPreferenceReader
Construct an IParentalControlsPreferenceReader object, used for getting the current state of Parental Controls preference settings and determining whether Parental Controls is enabled.
Returns
IParentalControlsPreferenceReader
Inherited from
IParentalControlsComponentV2
.makePreferenceReader
makePreferenceWriter()
makePreferenceWriter():
IParentalControlsPreferenceWriter
Construct an IParentalControlsPreferenceWriter object, used for setting the current state of Parental Controls preference settings and invoking the Parental Controls enablement workflow.
Returns
IParentalControlsPreferenceWriter
Inherited from
IParentalControlsComponentV2
.makePreferenceWriter
Last updated: Sep 30, 2025