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

(android) [Intermittent] NO_DEVICES_AVAILABLE after restarting app after leaving shared session #7

Open
Lindsay-Needs-Sleep opened this issue Jan 21, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Lindsay-Needs-Sleep
Copy link

Lindsay-Needs-Sleep commented Jan 21, 2020

Given this situation:

  1. Device 1 and 2 both join the same sesssion
  2. Device 1 does session.leave or session.stop
  3. Restart the app on Device 1, and call chrome.cast.initialize again
  4. (the bug) receiverListener never gets called with availability == true

This is tested in the manual tests on the primary device. The end of tests_manual_primary_1 and
the beginning of tests_manual_primary 2 tests this.

NOTE: The bug lasts longer when doing session.leave. The bug seems to last until one of 2 things happen:

  • The session has been killed AND some time has passed. (since session.leave does not kill the session the bug lasts longer)
  • The app is completely wiped from memory eg. re-install or settings > Apps > > "Force Stop"

This bug is extra strange because if you don't restart the app, it is happy to signal that receivers are available during chrome.cast.initialize.

The source of the bug is here:
ChromecastConnection.java >
initialize() { >
startRouteScan/ScanCallback/onRouteUpdate >
if (getContext().getCastState() != CastState.NO_DEVICES_AVAILABLE) { (line 107)
Never evaluates to true

This is very strange because onRouteUpdate is called with the actual valid route. Meaning there are indeed routes available. Not sure why getContext().getCastState() thinks there isn't.

This also only happens on one device that I have tested.
(Samsung tablet, SM-T350, Galaxy Tab A, Android 7.0)
The other device I test on is fine. (LG Phone, LG-M151, LG K4, Android 6.0.1)

@Lindsay-Needs-Sleep Lindsay-Needs-Sleep changed the title (android) [Intermittent] NO_DEVICES_AVAILABLE (android) [Intermittent] NO_DEVICES_AVAILABLE after restarting app after leaving shared session Jan 22, 2020
@Lindsay-Needs-Sleep
Copy link
Author

Changing:
if (getContext().getCastState() != CastState.NO_DEVICES_AVAILABLE) {
to this:
if (routes.size() > 0) {

Seems like the obvious solution, but it appears that as long as getContext().getCastState() == CastState.NO_DEVICES_AVAILABLE it is impossible to join/rejoin the route (which leads to other bugs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant