Example usage for android.media.tv TvInputManager ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED

List of usage examples for android.media.tv TvInputManager ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED

Introduction

In this page you can find the example usage for android.media.tv TvInputManager ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED.

Prototype

String ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED

To view the source code for android.media.tv TvInputManager ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED.

Click Source Link

Document

Broadcast intent action when the parental controls enabled state changes.

Usage

From source file:com.android.tv.MainActivity.java

@Override
protected void onStart() {
    if (DEBUG)/*from ww  w.j  a v  a 2  s .co  m*/
        Log.d(TAG, "onStart()");
    super.onStart();
    mScreenOffIntentReceived = false;
    mActivityStarted = true;
    mTracker.sendMainStart();
    mMainDurationTimer.start();

    applyParentalControlSettings();
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(TvInputManager.ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED);
    intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
    intentFilter.addAction(Intent.ACTION_SCREEN_ON);
    registerReceiver(mBroadcastReceiver, intentFilter);

    Intent notificationIntent = new Intent(this, NotificationService.class);
    notificationIntent.setAction(NotificationService.ACTION_SHOW_RECOMMENDATION);
    startService(notificationIntent);
}