Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launching the demo with custom exolist.json does not work on recent Android TV #438

Closed
1 task done
kaidokert opened this issue Jun 5, 2023 · 3 comments · Fixed by #439
Closed
1 task done

Launching the demo with custom exolist.json does not work on recent Android TV #438

kaidokert opened this issue Jun 5, 2023 · 3 comments · Fixed by #439
Assignees

Comments

@kaidokert
Copy link
Contributor

kaidokert commented Jun 5, 2023

Media3 Version

Media3 1.0.2

Devices that reproduce the issue

  • Chromecast HD ( sabrina ) on STTE.230319.008.R1 build ( just factory reset, to doublecheck it's not a app/config issue )

Devices that do not reproduce the issue

I didn't check others, but seems like other AndroidTVs with OS version > 10 might be generally affected

Reproducible in the demo app?

Yes

Reproduction steps

  • Build and install the demo app with gradle ./gradlew :demo:installWithDecoderExtensionsRelease
  • Following official instructions here make a custom .exolist.json file and put it on a public URL
  • Launch the demo app with android.intent.action.VIEW as instructed
adb shell am start -a android.intent.action.VIEW -d https://gist.githubusercontent.com/kaidokert/888032c77e4c68cbb0d0c44928d5ba3d/raw/16849f69e04cc59b11dd1f92741f7facb252bcc1/yts.exolist.json

Expected result

The app should open with the picker UI in SampleChooserActivity

Actual result

Actual result: "You don't have an app that can do this" toast message from Android system.

I believe the relevant loglines from logcat output are:

 I ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=https://gist.githubusercontent.com/... flg=0x10000000 cmp=com.android.tv.frameworkpackagestubs/.Stubs$BrowserStub} from uid 2000
W ActivityTaskManager: Can't find TaskDisplayArea to determine support for multi window. Task id=17 attached=false
W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (3155300)
and
W NotificationService: Toast already killed. pkg=com.android.tv.frameworkpackagestubs token=android.os.BinderProxy@7791677

If i modify the sample app to also allow android.intent.action.PICK in the intent-filter it works as expected, and relevant adb logcat lines read ( commit here kaidokert@498d483 )

I ActivityTaskManager: START u0 {act=android.intent.action.PICK dat=https://gist.githubusercontent.com/... flg=0x10000000 cmp=androidx.media3.demo.main/.SampleChooserActivity} from uid 2000
W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (3118823)
I ActivityTaskManager: Displayed androidx.media3.demo.main/.SampleChooserActivity: +100ms

This isn't an androidx.media issue per se, but it's still an issue with the default demo code / instructions. Happy to pull request the ".PICK" workaround if that's helpful

Media

https://gist.githubusercontent.com/kaidokert/888032c77e4c68cbb0d0c44928d5ba3d/raw/16849f69e04cc59b11dd1f92741f7facb252bcc1/yts.exolist.json

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
kaidokert added a commit to kaidokert/media that referenced this issue Jun 5, 2023
This works around the issue described in androidx#438
@marcbaechinger
Copy link
Contributor

marcbaechinger commented Jun 5, 2023

Thanks for your report!

Can you repro this with Sabrina when the json file is served with content type application/json? I see yours comes with text/plain.

When I do this for instance with this file that is served as json, then this works as intended I think. When I do the same with a file from the device that has a file:///-URI, then it always works without problems. It can be that the content type makes a difference when served over https.

When I test this with a a device with for instance API 30 or an ATV emulator, then Android presents me a selection of the apps that can handle the given file which is Chrome and the demo app. I can select the ExoPlayer demo app and it starts as expected.

It's a bit different with a device that runs Android 13. There, the json file is always opened by Chrome. When I disable Chrome, the ExoPlayer demo app is started directly without asking. The behavior corresponds to these two apps being able to open on API 30, but on Android 13, I don't know how to convince Android to ask me which app to use instead of defaulting to Chrome.

However, as you point out. The demo app should just be properly documented and work as documented. I'm going to fix this by adding an action androidx.media3.demo.main.action.BROWSE and update the documentation once this is released. A specific action resolves all possible collision with other apps supoporting a *.json file I think.

@marcbaechinger

This comment was marked as spam.

@kaidokert
Copy link
Contributor Author

kaidokert commented Jun 5, 2023

Just tested with your link and same result. Action VIEW produces a toast, with my PICK hack included opens just fine. Agreed btw that BROWSE probably makes more sense here.

I also tested with this that certainly has application/json as MIME type and same results.

I actually have a suspicion it might be related to a specific system-installed, un-removeable com.droidlogic app that is present on these devices, because i see adjacent log lines hinting at it. It seems like there's some system level intent filtering going on, but that's a wild guess and probably off topic here.

kaidokert added a commit to kaidokert/media that referenced this issue Jun 5, 2023
This works around the issue described in androidx#438
kaidokert added a commit to kaidokert/media that referenced this issue Jun 5, 2023
This works around the issue described in androidx#438
tof-tof pushed a commit that referenced this issue Jun 7, 2023
This works around the issue described in #438
@androidx androidx locked and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants