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

Commit 560038ba authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fix crash when tracking audio resources by type.

There was an NPE uncovered in some of the CTS tests runs caused by the
fact we should be calling putOrDefault when querying for a bit in the
audio resources by type map; this is uninitialized by default.

Flag: com.android.server.telecom.flags.enable_call_audio_watchdog
Test: Run full CTS suite with flag on.
Bug: 384570270
Change-Id: I9f04440018b9fa77bd4fbfe9c17e98bdc1856827
parent 29996d5d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -607,7 +607,8 @@ public class CallAudioWatchdog extends CallsManagerListenerBase {
                        Collections.emptySet());

                // Update the known sessions of this resource type in the CommunicationSession.
                Set<Integer> trackedSessions = session.getAudioResourcesByType().get(bit);
                Set<Integer> trackedSessions = putOrDefault(session.getAudioResourcesByType(), bit,
                        new ArraySet<>());
                trackedSessions.clear();
                trackedSessions.addAll(sessionsForThisUid);