Loading flags/telecom_connection_service_wrapper_flags.aconfig +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" Loading src/com/android/server/telecom/Call.java +4 −10 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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(); Loading @@ -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); } } Loading src/com/android/server/telecom/CreateConnectionProcessor.java +11 −15 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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()) { Loading src/com/android/server/telecom/ServiceBinder.java +0 −26 Original line number Diff line number Diff line Loading @@ -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<>(); Loading Loading @@ -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, Loading tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java +7 −4 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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 Loading @@ -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); Loading Loading @@ -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)); } Loading Loading
flags/telecom_connection_service_wrapper_flags.aconfig +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" Loading
src/com/android/server/telecom/Call.java +4 −10 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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(); Loading @@ -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); } } Loading
src/com/android/server/telecom/CreateConnectionProcessor.java +11 −15 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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()) { Loading
src/com/android/server/telecom/ServiceBinder.java +0 −26 Original line number Diff line number Diff line Loading @@ -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<>(); Loading Loading @@ -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, Loading
tests/src/com/android/server/telecom/tests/CreateConnectionProcessorTest.java +7 −4 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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 Loading @@ -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); Loading Loading @@ -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)); } Loading