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

Commit 5cf0f4b2 authored by Shunkai Yao's avatar Shunkai Yao
Browse files

MusicFxHelper: avoid modify AudioSession list while iterating

Make a copy of the audioSession list before iterating over it.

Bug: 305724110
Test: Tets MusicFx with YoutubeMusic
Change-Id: I2a1f9470802c77d6f93724dba1515d8a69a96aff
parent d25f7518
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -157,7 +157,8 @@ public class MusicFxHelper {
            Log.w(TAG, " inside handle MSG_EFFECT_CLIENT_GONE");
            // Once the uid is no longer running, close all remain audio session(s) for this UID
            if (mClientUidSessionMap.get(Integer.valueOf(uid)) != null) {
                final List<Integer> sessions = mClientUidSessionMap.get(Integer.valueOf(uid));
                final List<Integer> sessions =
                        new ArrayList(mClientUidSessionMap.get(Integer.valueOf(uid)));
                Log.i(TAG, "UID " + uid + " gone, closing " + sessions.size() + " sessions");
                for (Integer session : sessions) {
                    Intent intent = new Intent(