Repository navigation
Migrate TV home screen channels and programs snippets - #1213
Open
barbaralaw wants to merge 2 commits into
Open
barbaralaw wants to merge 2 commits into
barbaralaw wants to merge 2 commits into
Conversation
barbaralaw
marked this pull request as ready for review
October 27, 2026 14:50
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code snippets are for:
This adds the
androidx.tvprovider:tvproviderdependency (1.1.0) to the:tvmodule. The page owners approved adding it.res/xml/previewinputservice.xmlis migrated because the Preview videos page prints it, and the page sets its file name. ThePreviewVideoInputServiceentry in the module's manifest (with itsmeta-datapointing to that file) is there so the service compiles and is registered. The page's own manifest block stays on the page.Lint flags every
tvproviderprogram builder setter (setTitle,setType, and so on) asRestrictedApi, because the setters are inherited from a base class the library restricts. The functions that wrap those snippets carry@SuppressLint("RestrictedApi")outside the region tags, as the android/tv-samples apps do. The docs team approved this.List of modifications:
android_tv_channel_logo): The block that showed the twostoreChannelLogomethod signatures, which aren't valid Kotlin, now shows the realChannelLogoUtils.storeChannelLogocalls with the same arguments.android_tv_channel_query): In the query block,cursor != null and cursor.moveToNext()didn't compile and is nowcursor != null && cursor.moveToNext().android_tv_channel_builder,android_tv_channel_insert,android_tv_channel_update,android_tv_program_builder,android_tv_program_insert,android_tv_program_update,android_tv_program_delete,android_tv_channel_query): Comments end with a full stop, and the formatter changed the indentation and line breaks of the builder chains, the insert and update calls, and the query block.android_tv_preview_program_video_uri):new ComponentName(context, PreviewVideoInputService.class)is Java syntax and is nowComponentName(context, PreviewVideoInputService::class.java).android_tv_preview_video_input_service): InPreviewVideoInputService, the undefinedmPlayeris nowmediaPlayer?(the property the class declares), andcatch (IOException e)is nowcatch (e: IOException).android_tv_preview_video_input_service): The service's import lines show as commented-out imports at the same position; the real imports are at the top of the file.android_tv_preview_input_service_metadata): The XML snippet doesn't show the<?xml version="1.0" encoding="utf-8"?>line, because it must be the first line of the file and can't sit inside a region tag. The line is still in the file.android_tv_preview_program_video_uri,android_tv_preview_program_video_uri_string,android_tv_preview_video_input_service): Comments end with a full stop, and the formatter fixed the indentation of the URI builder chains and the service.android_tv_video_program_builder): The comment ends with a full stop, and the formatter changed the indentation of the builder chain.android_tv_watch_next_program_insert): The formatter changed the indentation of the builder chain and the line breaks of the insert call.Snippets not migrated:
WRITE_EPG_DATApermission and the two<receiver>blocks (manifest), the Gradle dependency (build file), and theadbcommand (CLI).android.support.media.tvimport block, because the page's prose names the support library.ACTION_REQUEST_CHANNEL_BROWSABLEblock, becausestartActivityForResultis deprecated and has no one-to-one replacement.<service>declaration (manifest).Companion CL: cl/1004906645 (https://critique.corp.google.com/cl/1004906645)