Skip to content

Conversation

@ittiam-sham
Copy link

To access APIs of tvprovider library without warnings.

Bug: 138150076

To access APIs of tvprovider library without warnings.

Bug: 138150076
// Retrieve the corresponding metadata item and return
return programItem?.let { db.metadata().findById(it.contentId) }
val watchNextProgramItem = TvLauncherUtils.getWatchNextPrograms(context).find { it.id == programId }
return watchNextProgramItem?.let { db.metadata().findById(it.contentId) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this more verbose code block is an improvement over the inline assignment using an elvis operator with less code repetition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ittiam-sham Is there any benefit to expanding the existing code block?


/** Collection of static methods used to handle Android TV Home Screen Launcher operations */
@RequiresApi(26)
@SuppressLint("RestrictedApi")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the referenced library is restricted, so this lint suppression is needed here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal can be merged now that bug #138150076 has been resolved.

* Helper method used to retrieve a metadata item object given its program ID. Restricted API
* is being used to compared programs based on their ID.
*/
@SuppressLint("RestrictedApi")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal can be merged now that bug #138150076 has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants