androidchromecastgoogle-castcastcompanionlibrary

Android app automatically casting without user interaction (CastCompanionLibrary)


I have an Android app using the CastCompanionLibrary v2.9.1, modified to use play-services-cast:10.0.1 (just a simple change to the gradle dependencies).

Short version: The app is attempting to automatically connect to the ChromeCast device, without user interaction.

Long version:

Since updating the CCL library to use play services 10.0.1, I've had several users mention that the app is automatically connecting/casting to ChromeCast without user interaction.

Some users have said they're not using the app, then they connect to WiFi, and the app automatically attempts to cast. Others have said they are using the app, they don't press the ChromeCast button, and the app begins casting.

--

I'm having trouble figuring out where to look for potential changes to the ChromeCast APIs which might explain what's going on. I'm also not sure whether this issue is only occurring for my app, or for many other ChromeCast enabled apps. Lastly, I'm not able to reproduce this issue on my own ChromeCast device.

Any help would be appreciated.


Solution

  • So it turns out there's a bug in Android Support Library 25.1.0 which was causing this issue.

    https://code.google.com/p/google-cast-sdk/issues/detail?id=1105

    Which is now marked as 'fixed internally'.

    Also related: https://code.google.com/p/android/issues/detail?id=232326