microg / microg/GmsCore

Minor chromecast ConcurrentModificationException

Open
#2,449 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Describe the bug
This bug may be related to MicroG not picking up any Chromecast devices, or a missing verification in the code.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to a WiFi network with a Chromecast enabled device
  2. This error gets picked up in logcat

Expected behavior

System
Android Version: 14
Custom ROM: LineageOS for MicroG

Additional context

FATAL EXCEPTION: main
Process: com.google.android.gms, PID: 4352
java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1574)
	at java.util.HashMap$ValueIterator.next(HashMap.java:1602)
	at org.microg.gms.cast.CastMediaRouteProvider.publishRoutes(CastMediaRouteProvider.java:329)
	at org.microg.gms.cast.CastMediaRouteProvider.access$500(CastMediaRouteProvider.java:54)
	at org.microg.gms.cast.CastMediaRouteProvider$2.run(CastMediaRouteProvider.java:322)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8501)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in CastMediaRouteProvider.java around lines 322-329, where publishRoutes iterates the route collection and the ConcurrentModificationException is reported. Reproduce with a Chromecast-enabled device on Android 14 and inspect logcat. Done means the reported exception no longer occurs during route publication.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.