Skip to content

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

@Lindsay-Needs-Sleep

Description

@Lindsay-Needs-Sleep

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions