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

Commit 22057bbd authored by Grant Menke's avatar Grant Menke
Browse files

Prevent concurrent modifiation of Call mExtras.

The entrypoints to Call#putExtras and Call#removeExtras are not all threadsafe which was resulting in Concurrent Modification Exceptions being thrown. To resolve this, this CL ensures all points of entry to these methods are synchronized upstream on Telecom's mLock.

Bug: 261946446
Test: Manual Test
Change-Id: If3e0291df9a3fc93a844b0289468e051411fd676
(cherry picked from commit faf81163)
parent fb849665
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -871,6 +871,9 @@ public class CallsManager extends Call.ListenerBase
            return;
        }

        // Store the shouldSuppress value in the call object which will be passed to InCallServices
        incomingCall.setCallIsSuppressedByDoNotDisturb(result.shouldSuppressCallDueToDndStatus);

        // Inform our connection service that call filtering is done (if it was performed at all).
        if (incomingCall.isUsingCallFiltering()) {
            boolean isInContacts = incomingCall.getCallerInfo() != null
+0 −3
Original line number Diff line number Diff line
@@ -55,9 +55,6 @@ public class DndCallFilter extends CallFilter {
        // query NotificationManager to determine if the call should ring or be suppressed
        boolean shouldSuppress = !mRinger.shouldRingForContact(mCall);

        // store the shouldSuppress value in the call object which will be passed to InCallServices
        mCall.setCallIsSuppressedByDoNotDisturb(shouldSuppress);

        // end timer
        Log.addEvent(mCall, LogUtils.Events.DND_PRE_CHECK_COMPLETED, shouldSuppress);

+1 −0
Original line number Diff line number Diff line
@@ -359,6 +359,7 @@ public class MissedInformationTest extends TelecomSystemTest {
        doReturn(mNotificationManager).when(mSpyContext)
                .getSystemService(Context.NOTIFICATION_SERVICE);
        doReturn(false).when(mNotificationManager).matchesCallFilter(any(Bundle.class));
        doReturn(false).when(mIncomingCall).wasDndCheckComputedForCall();
        mCallsManager.getRinger().setNotificationManager(mNotificationManager);

        CallFilteringResult result = new CallFilteringResult.Builder()