Export to GitHub

googletv-issues - issue #145

LG G2 GTV throws "Invalid URI: content://com.google.android.tv.provider/channel_listing" when querying provider


Posted on Jan 31, 2013 by Grumpy Lion

Model: LG G2, 47" Android Ver: 3.2 Software Ver: 03.05.03 Builder Number: MASTER.user.20121205.140044

Steps to reproduce:

Attempt to run the "Channel Listing Example", or other code that calls ContentResolver.query...

Observe ""Invalid URI: content://com.google.android.tv.provider/channel_listing"

Attachments

Comment #1

Posted on Jan 31, 2013 by Grumpy Lion

LogCat attached

Attachments

Comment #2

Posted on Feb 1, 2013 by Quick Rhino

Internal issue filed

Comment #3

Posted on Feb 3, 2013 by Quick Rhino

Change your URI to be:

content://com.google.android.tv.provider/channel_list

Regards,

Comment #4

Posted on Feb 3, 2013 by Grumpy Lion

Thanks for your response. Testing indicates that removing the "ing" is ineffective.

The changed URI ("minus ing") fails on both the LG device, and the Sony buddy box.

LG device: Invalid URI: content://com.google.android.tv.provider/channel_list Sony device: Invalid URI: content://com.google.android.tv.provider/channel_list

Whereas the documented URI ("plus ing") works on the Sony device, resulting in several hundred lines of listing like this:

Channel: 10 Callsign: GOAC010 URI: tv://channel/GOAC010?deviceId=irb_0&channelNumber=10 Channel: 10 Callsign: PCN URI: tv://channel/PCN?deviceId=irb_0&channelNumber=10 Channel: 100 Callsign: TVGN URI: tv://channel/TVGN?deviceId=irb_0&channelNumber=100


Also, I draw your attention to the following:

https://developers.google.com/tv/android/docs/gtv_provider :

String constants

The following string values are used with the provider:

provider authority: "com.google.android.tv.provider"
channel listing table path: "channel_listing" <===============

and on the same page:

*/ Uri mProviderUri = Uri.parse("content://" + "com.google.android.tv.provider" + "/" + "channel_listing");

and finally, the example program, line 47:

http://code.google.com/p/googletv-android-samples/source/browse/ChannelChangingSample/src/com/example/google/android/tv/channelchanging/ChannelChangingActivity.java#47

// Constants for accessing the channel listing content provider. private static final String AUTHORITY = "com.google.android.tv.provider";

private static final String CHANNEL_LISTING_PATH = "channel_listing";

Comment #5

Posted on Feb 3, 2013 by Quick Rhino

Thank you for the detailed feedback. I am discussing with the engineering team now on what is happening and will update this ticket when I have more information.

Comment #6

Posted on Feb 4, 2013 by Quick Rhino

There have been some changes in the newest version of the source code. These have not made their way into the sample code yet (will try to resolve that soon). In the interim here are the changes between the versions:

  • AUTHORITY : com.google.android.tv.provider -> com.google.tv.mediadevicesapp.MediaDevicesProvider
  • CHANNEL_LISTING_PATH : channel_listing -> channel_list
  • column name of CHANNEL_URI : channel_uri -> url
  • column name of CHANNEL_NAME : channel_name -> name
  • column name of CHANNEL_NUMBER : channel_number -> channelNumber
  • column name of CHANNEL_CALLSIGN : callsign -> subName
  • required permission : com.google.android.tv.permission.READ_CHANNELS -> com.google.android.tv.mediadevices.permission.READ_STREAMS

Comment #7

Posted on Feb 6, 2013 by Grumpy Lion

Excellent!

All seems in good order with the LG device.

Running the same code on the Sony device results in a Null cursor being returned, which isn't terribly surprising.

What test should I use to decide which flavor of code to run?

Comment #8

Posted on Feb 6, 2013 by Quick Rhino

In order to test what platform version you are on you can try something like this:

int version = 0; try { Class cl = Class.forName("com.google.android.tv.Version"); version = cl.getField("API_LEVEL").getInt(null); } catch (Exception ex) {}

String contentUri;

if (version == 0) { // We're on old (Pre-V3 GoogleTV) contentUri = "content://com.google.android.tv.provider/channel_listing"; } else { // We're on V3 or newer. contentUri = "content://com.google.tv.mediadevicesapp.ChannelListingProvider/channel_listing"; // or, if you're using the framework library: // Uri contentUri = com.google.android.tv.provider.ChannelListingContract.Channels.CHANNEL_LISTING_URI }

/*

Column names are:

callsign channel_name channel_number channel_uri data_source

*/

Comment #9

Posted on Feb 8, 2013 by Grumpy Cat

To test the platform substitue GTV_SDK_INT for API_LEVEL above. Sorry about the typo.

Comment #10

Posted on Feb 8, 2013 by Grumpy Lion

That did the trick, both the Sony and LG devices run appropriate code, and return valid results.

And just to clarify: each version of code needs the column names associated with that version, so you have to setup different queries & etc in addition to the contentURI.

Thank you!

Comment #11

Posted on Feb 11, 2013 by Happy Dog

Can someone please clarify this? Comment #6 states that the column names have changed. Comment #8 states that the column names have not changed. Which is the correct state of things? I'm trying to resolve an issue in our app and I am working this issue remotely since we do not have an OS image for Google TV Version 3.

Thanks, Mike

Status: Fixed

Labels:
Type-Defect