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

Commit dd41b823 authored by Grant Menke's avatar Grant Menke
Browse files

Remove the UpdatedRcsCallCountTracking flag.

Removes the flag and obsolete code related to UpdatedRcsCallCountTracking. Updates the UT to ensure correct behavior now that the flag has been completely removed.

Flag: EXEMPT flag cleanup
Fixes: 409612515
Test: atest CreateConnectionProcessorTest && atest CallsManagerTest
Change-Id: I834d39fb26479b51572b276d341ac7afafabe97e
parent 2d38b1c4
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"
container: "system"

# OWNER=grantmenke TARGET=24Q2
flag {
  name: "updated_rcs_call_count_tracking"
  namespace: "telecom"
  description: "Ensure that the associatedCallCount of CS and RCS is accurately being tracked."
  bug: "286154316"
}

# OWNER=tjstuart TARGET=24Q4
flag {
  name: "csw_service_interface_is_null"
+4 −10
Original line number Diff line number Diff line
@@ -2573,7 +2573,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,

        service.incrementAssociatedCallCount();

        if (mFlags.updatedRcsCallCountTracking() && remoteService != null) {
        if (remoteService != null) {
            remoteService.incrementAssociatedCallCount();
            mRemoteConnectionService = remoteService;
        }
@@ -2605,17 +2605,11 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        if (mConnectionService != null) {
            ConnectionServiceWrapper serviceTemp = mConnectionService;

            if (mFlags.updatedRcsCallCountTracking()) {
            // Continue to track the former CS for this call so that it doesn't unbind early:
            mRemoteConnectionService = serviceTemp;
            }

            mConnectionService = null;
            serviceTemp.removeCall(this);

            if (!mFlags.updatedRcsCallCountTracking()) {
                serviceTemp.decrementAssociatedCallCount(true /*isSuppressingUnbind*/);
            }
        }

        service.incrementAssociatedCallCount();
@@ -2642,7 +2636,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            // to do.
            decrementAssociatedCallCount(serviceTemp);

            if (mFlags.updatedRcsCallCountTracking() && remoteServiceTemp != null) {
            if (remoteServiceTemp != null) {
                decrementAssociatedCallCount(remoteServiceTemp);
            }
        }
+11 −15
Original line number Diff line number Diff line
@@ -286,7 +286,6 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
                mConnectionAttempt++;
                mCall.setConnectionManagerPhoneAccount(attempt.connectionManagerPhoneAccount);
                mCall.setTargetPhoneAccount(attempt.targetPhoneAccount);
                if (mFlags.updatedRcsCallCountTracking()) {
                if (Objects.equals(attempt.connectionManagerPhoneAccount,
                        attempt.targetPhoneAccount)) {
                    mCall.setConnectionService(mService);
@@ -302,9 +301,6 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
                        mCall.setConnectionService(mService, mRemoteService);
                    }
                }
                } else {
                    mCall.setConnectionService(mService);
                }
                setTimeoutIfNeeded(mService, attempt);
                if (mCall.isIncoming()) {
                    if (mCall.isAdhocConferenceCall()) {
+0 −26
Original line number Diff line number Diff line
@@ -243,7 +243,6 @@ public abstract class ServiceBinder {
    protected final String mPackageAbbreviation;
    protected final FeatureFlags mFlags;


    /** The set of callbacks waiting for notification of the binding's success or failure. */
    private final Set<BindCallback> mCallbacks = new ArraySet<>();

@@ -309,31 +308,6 @@ public abstract class ServiceBinder {
    }

    final void decrementAssociatedCallCount() {
        if (mFlags.updatedRcsCallCountTracking()) {
            decrementAssociatedCallCountUpdated();
        } else {
            decrementAssociatedCallCount(false /*isSuppressingUnbind*/);
        }
    }

    final void decrementAssociatedCallCount(boolean isSuppressingUnbind) {
        // This is the legacy method - will be removed after the Flags.updatedRcsCallCountTracking
        // mendel study completes.
        if (mAssociatedCallCount > 0) {
            mAssociatedCallCount--;
            Log.v(this, "Call count decrement %d, %s", mAssociatedCallCount,
                    mComponentName.flattenToShortString());

            if (!isSuppressingUnbind && mAssociatedCallCount == 0) {
                unbind();
            }
        } else {
            Log.wtf(this, "%s: ignoring a request to decrement mAssociatedCallCount below zero",
                    mComponentName.getClassName());
        }
    }

    final void decrementAssociatedCallCountUpdated() {
        if (mAssociatedCallCount > 0) {
            mAssociatedCallCount--;
            Log.i(this, "Call count decrement %d, %s", mAssociatedCallCount,
+7 −4
Original line number Diff line number Diff line
@@ -225,7 +225,11 @@ public class CreateConnectionProcessorTest extends TelecomTestCase {
        // Include a Connection Manager
        PhoneAccountHandle callManagerPAHandle = getNewConnectionManagerHandleForCall(mMockCall,
                "cm_acct");
        // Get the mock service for the Connection Manager
        ConnectionServiceWrapper service = makeConnMgrConnectionServiceWrapper();
        // Get the mock service for the Target Phone Account
        ConnectionServiceWrapper targetService = makeConnectionServiceWrapper();

        // Make sure the target phone account has the correct permissions
        PhoneAccount mFakeTargetPhoneAccount = makeQuickAccount("cm_acct",
                PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION, null);
@@ -236,7 +240,8 @@ public class CreateConnectionProcessorTest extends TelecomTestCase {

        verify(mMockCall).setConnectionManagerPhoneAccount(eq(callManagerPAHandle));
        verify(mMockCall).setTargetPhoneAccount(eq(pAHandle));
        verify(mMockCall).setConnectionService(eq(service));
        // Verify the TWO-argument setConnectionService was called
        verify(mMockCall).setConnectionService(eq(service), eq(targetService));
        verify(service).createConnection(eq(mMockCall),
                any(CreateConnectionResponse.class));
        // Notify successful connection to call
@@ -248,8 +253,6 @@ public class CreateConnectionProcessorTest extends TelecomTestCase {
    @SmallTest
    @Test
    public void testConnectionManagerConnectionServiceSuccess() throws Exception {
        when(mFeatureFlags.updatedRcsCallCountTracking()).thenReturn(true);

        // Configure the target phone account as the remote connection service:
        PhoneAccountHandle pAHandle = getNewTargetPhoneAccountHandle("tel_acct");
        setTargetPhoneAccount(mMockCall, pAHandle);
@@ -752,7 +755,7 @@ public class CreateConnectionProcessorTest extends TelecomTestCase {
        verify(mMockCall).setConnectionManagerPhoneAccount(
                eq(emerCallManagerPA.getAccountHandle()));
        verify(mMockCall).setTargetPhoneAccount(eq(regularAccount.getAccountHandle()));
        verify(mMockCall).setConnectionService(eq(service));
        verify(mMockCall).setConnectionService(eq(service), eq(service));
        verify(service).createConnection(eq(mMockCall), any(CreateConnectionResponse.class));
    }