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

Commit 7285ca87 authored by Grace Jia's avatar Grace Jia
Browse files

Fix GsmCdmaCallTracker bug.

The intended behavior is to loop through the ringing call connection. In
previous CL it mistakenly loop the ringing call connection by using
index of foreground call.
Change to use Java for-each loop to avoid similar issue.

Test: atest FrameworksTelephonyTests:GsmCdmaCallTrackerTest
Bug: 154088765
Change-Id: Icc42b45980ba513ecb2b2131ab51d54fea08f54c
parent 69493a1f
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -931,19 +931,21 @@ public class GsmCdmaCallTracker extends CallTracker {
                    // Loop through foreground call connections as
                    // it contains the known logical connections.
                    ArrayList<Connection> connections = mForegroundCall.getConnections();
                    int count = connections.size();
                    for (int n = 0; n < count; n++) {
                        if (Phone.DEBUG_PHONE) log("adding fgCall cn " + n + " to droppedDuringPoll");
                        GsmCdmaConnection cn = (GsmCdmaConnection) connections.get(n);
                        mDroppedDuringPoll.add(cn);
                    for (Connection cn : connections) {
                        if (Phone.DEBUG_PHONE) {
                            log("adding fgCall cn " + cn + "to droppedDuringPoll");
                        }
                        mDroppedDuringPoll.add((GsmCdmaConnection) cn);
                    }
                    count = mRingingCall.getConnectionsCount();

                    connections = mRingingCall.getConnections();
                    // Loop through ringing call connections as
                    // it may contain the known logical connections.
                    for (int n = 0; n < count; n++) {
                        if (Phone.DEBUG_PHONE) log("adding rgCall cn " + n + " to droppedDuringPoll");
                        GsmCdmaConnection cn = (GsmCdmaConnection) connections.get(n);
                        mDroppedDuringPoll.add(cn);
                    for (Connection cn : connections) {
                        if (Phone.DEBUG_PHONE) {
                            log("adding rgCall cn " + cn + "to droppedDuringPoll");
                        }
                        mDroppedDuringPoll.add((GsmCdmaConnection) cn);
                    }

                    // Re-start Ecm timer when the connected emergency call ends