List of usage examples for android.media.tv TvContract buildChannelUriForPassthroughInput
public static Uri buildChannelUriForPassthroughInput(String inputId)
From source file:com.android.tv.MainActivity.java
private void resumeTvIfNeeded() { if (DEBUG)//from ww w . j a va 2s. c o m Log.d(TAG, "resumeTvIfNeeded()"); if (!mTvView.isPlaying() || mInitChannelUri != null || (mShouldTuneToTunerChannel && mChannelTuner.isCurrentChannelPassthrough())) { if (TvContract.isChannelUriForPassthroughInput(mInitChannelUri)) { // The target input may not be ready yet, especially, just after screen on. String inputId = mInitChannelUri.getPathSegments().get(1); TvInputInfo input = mTvInputManagerHelper.getTvInputInfo(inputId); if (input == null) { input = mTvInputManagerHelper.getTvInputInfo(mParentInputIdWhenScreenOff); if (input == null) { SoftPreconditions.checkState(false, TAG, "Input disappear." + input); finish(); } else { mInitChannelUri = TvContract.buildChannelUriForPassthroughInput(input.getId()); } } } mParentInputIdWhenScreenOff = null; startTv(mInitChannelUri); mInitChannelUri = null; } // Make sure TV app has the main TV view to handle the case that TvView is used in other // application. restoreMainTvView(); mTvView.setBlockScreenType(getDesiredBlockScreenType()); }