Example usage for android.media.tv TvInputInfo getParentId

List of usage examples for android.media.tv TvInputInfo getParentId

Introduction

In this page you can find the example usage for android.media.tv TvInputInfo getParentId.

Prototype

public String getParentId() 

Source Link

Document

Returns the parent input ID.

Usage

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

/**
 * Handles screen off to keep the current channel for next screen on.
 *//*from  w  ww  .  ja  va  2  s .c  o  m*/
private void markCurrentChannelDuringScreenOff() {
    mInitChannelUri = mChannelTuner.getCurrentChannelUri();
    if (mChannelTuner.isCurrentChannelPassthrough()) {
        // When ACTION_SCREEN_OFF is invoked, some CEC devices may be already
        // removed. So we need to get the input info from ChannelTuner instead of
        // TvInputManagerHelper.
        TvInputInfo input = mChannelTuner.getCurrentInputInfo();
        mParentInputIdWhenScreenOff = input.getParentId();
        if (DEBUG)
            Log.d(TAG, "Parent input: " + mParentInputIdWhenScreenOff);
    }
}