diff options
author | Thomas Stuart <tjstuart@google.com> | 2023-11-07 11:38:02 -0800 |
---|---|---|
committer | Thomas Stuart <tjstuart@google.com> | 2023-12-02 00:27:05 +0000 |
commit | 663bd936c7f48c30a662e1404a12774e3413b54e (patch) | |
tree | f449ad619bbbe3cbff5c2802c86df54d8df16ddc | |
parent | 22808895b09bed6ed9a4b83791df78d602f1b695 (diff) | |
download | Telecomm-663bd936c7f48c30a662e1404a12774e3413b54e.tar.gz |
add flag for transactional CS changes
b/267234374 was merged to V without a flag to gate the new logic.
This CL gates all the changes in b/267234374 and updates 2 tests.
Fixes: 309541257
Bug: 267234374 (root bug)
Test: 2 modified tests
Change-Id: I26967870b19be3670248ea237ccd8198f624c079
-rw-r--r-- | flags/Android.bp | 1 | ||||
-rw-r--r-- | flags/telecom_call_flags.aconfig | 8 | ||||
-rw-r--r-- | src/com/android/server/telecom/Call.java | 12 | ||||
-rw-r--r-- | tests/src/com/android/server/telecom/tests/MissedInformationTest.java | 4 | ||||
-rw-r--r-- | tests/src/com/android/server/telecom/tests/TransactionTests.java | 3 |
5 files changed, 22 insertions, 6 deletions
diff --git a/flags/Android.bp b/flags/Android.bp index 6fa147a86..63a67aeb3 100644 --- a/flags/Android.bp +++ b/flags/Android.bp @@ -29,6 +29,7 @@ aconfig_declarations { "telecom_incallservice_flags.aconfig", "telecom_default_phone_account_flags.aconfig", "telecom_callaudioroutestatemachine_flags.aconfig", + "telecom_call_flags.aconfig", "telecom_calls_manager_flags.aconfig", "telecom_anomaly_report_flags.aconfig", "telecom_callaudiomodestatemachine_flags.aconfig", diff --git a/flags/telecom_call_flags.aconfig b/flags/telecom_call_flags.aconfig new file mode 100644 index 000000000..b5ea6a28e --- /dev/null +++ b/flags/telecom_call_flags.aconfig @@ -0,0 +1,8 @@ +package: "com.android.server.telecom.flags" + +flag { + name: "transactional_cs_verifier" + namespace: "telecom" + description: "verify connection service callbacks via a transaction" + bug: "309541257" +}
\ No newline at end of file diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java index 7ef2a12a4..c0fb17f3f 100644 --- a/src/com/android/server/telecom/Call.java +++ b/src/com/android/server/telecom/Call.java @@ -849,7 +849,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, ClockProxy clockProxy, ToastFactory toastFactory, FeatureFlags featureFlags) { - mFlags = featureFlags; mId = callId; mConnectionId = callId; @@ -1370,8 +1369,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, Log.addEvent(this, event, stringData); } - for (CallStateListener listener : mCallStateListeners) { - listener.onCallStateChanged(newState); + if (mFlags.transactionalCsVerifier()) { + for (CallStateListener listener : mCallStateListeners) { + listener.onCallStateChanged(newState); + } } mCallStateChangedAtomWriter @@ -2957,7 +2958,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, if (mTransactionalService != null) { mTransactionalService.onSetInactive(this); } else if (mConnectionService != null) { - awaitCallStateChangeAndMaybeDisconnectCall(CallState.ON_HOLD, isSelfManaged(), "hold"); + if (mFlags.transactionalCsVerifier()) { + awaitCallStateChangeAndMaybeDisconnectCall(CallState.ON_HOLD, isSelfManaged(), + "hold"); + } mConnectionService.hold(this); } else { Log.e(this, new NullPointerException(), diff --git a/tests/src/com/android/server/telecom/tests/MissedInformationTest.java b/tests/src/com/android/server/telecom/tests/MissedInformationTest.java index f28966edd..5bba742e4 100644 --- a/tests/src/com/android/server/telecom/tests/MissedInformationTest.java +++ b/tests/src/com/android/server/telecom/tests/MissedInformationTest.java @@ -361,7 +361,7 @@ public class MissedInformationTest extends TelecomSystemTest { setUpIncomingCall(); doReturn(mNotificationManager).when(mSpyContext) .getSystemService(Context.NOTIFICATION_SERVICE); - doReturn(false).when(mNotificationManager).matchesCallFilter(any(Uri.class)); + doReturn(false).when(mNotificationManager).matchesCallFilter(any(Bundle.class)); doReturn(false).when(mIncomingCall).wasDndCheckComputedForCall(); mCallsManager.getRinger().setNotificationManager(mNotificationManager); @@ -372,7 +372,7 @@ public class MissedInformationTest extends TelecomSystemTest { // Wait for ringer attributes build completed verify(mNotificationManager, timeout(TEST_TIMEOUT_MILLIS)) - .matchesCallFilter(any(Uri.class)); + .matchesCallFilter(any(Bundle.class)); mCallsManager.getRinger().waitForAttributesCompletion(); mCallsManager.markCallAsDisconnected(mIncomingCall, diff --git a/tests/src/com/android/server/telecom/tests/TransactionTests.java b/tests/src/com/android/server/telecom/tests/TransactionTests.java index b35f88edc..e58c6c4d0 100644 --- a/tests/src/com/android/server/telecom/tests/TransactionTests.java +++ b/tests/src/com/android/server/telecom/tests/TransactionTests.java @@ -51,6 +51,7 @@ import com.android.server.telecom.CallerInfoLookupHelper; import com.android.server.telecom.CallsManager; import com.android.server.telecom.ClockProxy; import com.android.server.telecom.ConnectionServiceWrapper; +import com.android.server.telecom.flags.FeatureFlags; import com.android.server.telecom.PhoneNumberUtilsAdapter; import com.android.server.telecom.TelecomSystem; import com.android.server.telecom.ui.ToastFactory; @@ -272,6 +273,7 @@ public class TransactionTests extends TelecomTestCase { @Test public void testCallStateChangeTimesOut() throws ExecutionException, InterruptedException, TimeoutException { + when(mFeatureFlags.transactionalCsVerifier()).thenReturn(true); VerifyCallStateChangeTransaction t = new VerifyCallStateChangeTransaction(mCallsManager, mMockCall1, CallState.ON_HOLD, true); // WHEN @@ -300,6 +302,7 @@ public class TransactionTests extends TelecomTestCase { @Test public void testCallStateIsSuccessfullyChanged() throws ExecutionException, InterruptedException, TimeoutException { + when(mFeatureFlags.transactionalCsVerifier()).thenReturn(true); VerifyCallStateChangeTransaction t = new VerifyCallStateChangeTransaction(mCallsManager, mMockCall1, CallState.ON_HOLD, true); // WHEN |