Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4335c023 authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Fix CME in MediaDataCombineListener

Same issue as in ag/11604129

Fixes: 157858313
Test: atest SystemUITests
Change-Id: I301e22c322050605d12a2dcd2452a63fbc841f06
parent 005ce7ca
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ class MediaDataCombineLatest @Inject constructor(
        val (entry, device) = entries[key] ?: null to null
        if (entry != null && device != null) {
            val data = entry.copy(device = device)
            listeners.forEach {
            val listenersCopy = listeners.toSet()
            listenersCopy.forEach {
                it.onMediaDataLoaded(key, data)
            }
        }
@@ -73,7 +74,8 @@ class MediaDataCombineLatest @Inject constructor(

    private fun remove(key: String) {
        entries.remove(key)?.let {
            listeners.forEach {
            val listenersCopy = listeners.toSet()
            listenersCopy.forEach {
                it.onMediaDataRemoved(key)
            }
        }