googlesamples / androidtv-sample-inputs

Sample Channel App (TV Input Service) on Android TV using TIF
https://developer.android.com/training/tv/tif
Apache License 2.0
492 stars 241 forks source link

Philips QM163XE does not add any channel #16

Open cyberdreamandroid opened 7 years ago

cyberdreamandroid commented 7 years ago

I cloned the current version and ran it in Android Studio, deployed it to my Philips 7101 QM163XE Android TV running Marshmallow 6.0.1 with the Live channels app (installed from Google Play Store). When selecting the source called "Rich Input", I see on the right side that channels are added. After the screen returns I get a toast which is called in German "Keine Kanäle hinzugefügt" which should be "No channels added" and it still says "No channels available". The same happens with my own app using TIF. I tried it on Nexus Player, Shield, MIBOX and it worked fine. But there are other apps on Philips TV running fine like Zattoo, Haystack, Bloomberg, Google Movies... I attached the adb log, no errors there. I also added the bugreport file. Thanks in advance.

log.txt

cyberdreamandroid commented 7 years ago

Got it working now. Problem seems to be the updateChannels() method which I replaced. I will provide a working example tomorrow. Please also have a look at the weird lines 97 and 98 of TvContractUtils, they seem to be duplicated.

Fleker commented 7 years ago

Lines 97-98

cursor = resolver.query(channelsUri, projection, null, null, null);
cursor = resolver.query(channelsUri, projection, null, null, null);

Yes, it is being repeated. Is this causing a problem on Philips TVs?

cyberdreamandroid commented 7 years ago

The problem causing the Philips not adding channels is line 306 in Channel.java: values.put(TvContract.Channels.COLUMN_SEARCHABLE, mSearchable); If I disable this line, it is working with your sample. Line 97-98 is not causing a problem, but bad code which should not be in an official Google sample project.

Fleker commented 7 years ago

COLUMN_SEARCHABLE: https://developer.android.com/reference/android/media/tv/TvContract.Channels.html#COLUMN_SEARCHABLE

This seems like a problem in the Philips implementation of TIF or Android TV. That's a field that should exist as part of the Android framework and developers shouldn't have to worry about a problem with that field.

Someone within Google should probably get in contact with Philips about fixing this bug. A workaround could be checking the device name before setting that field.

Tom60chat commented 3 years ago

The problem causing the Philips not adding channels is line 306 in Channel.java: values.put(TvContract.Channels.COLUMN_SEARCHABLE, mSearchable); If I disable this line, it is working with your sample. Line 97-98 is not causing a problem, but bad code which should not be in an official Google sample project.

Removing this line makes the fixed sample project (#44) work, on an android box (API 25) and an emulator (API 30)