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

Commit 391eaf11 authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge changes from topic "telecom-cts-presubmit"

* changes:
  Remove extra space
  Add CtsTelecomTestCases to presubmit
parents 3c1fc532 6c13622d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -15,6 +15,14 @@
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        }
      ]
    },
    {
      "name": "CtsTelecomTestCases",
      "options": [
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        }
      ]
    }
  ]
}
+4 −1
Original line number Diff line number Diff line
@@ -436,7 +436,10 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
                            mPhoneAccountRegistrar.getOutgoingPhoneAccountForSchemeOfCurrentUser(
                                    mCall.getHandle() == null
                                            ? null : mCall.getHandle().getScheme()));
                    if (!mAttemptRecords.contains(callAttemptRecord)) {
                    // If the target phone account is null, we'll run into a NPE during the retry
                    // process, so skip it now if it's null.
                    if (callAttemptRecord.targetPhoneAccount != null
                            && !mAttemptRecords.contains(callAttemptRecord)) {
                        Log.i(this, "Will try Connection Manager account %s for emergency",
                                callManager);
                        mAttemptRecords.add(callAttemptRecord);
+26 −0
Original line number Diff line number Diff line
@@ -1721,6 +1721,32 @@ public class TelecomServiceImpl {
            }
        }

        /**
         * A method intended for use in testing to clean up any calls that get stuck in the
         * {@link CallState#DISCONNECTED} or {@link CallState#DISCONNECTING} states. Stuck calls
         * during CTS cause cascading failures, so if the CTS test detects such a state, it should
         * call this method via a shell command to clean up before moving on to the next test.
         */
        @Override
        public void cleanupStuckCalls() {
            Log.startSession("TCI.cSC");
            try {
                synchronized (mLock) {
                    enforceShellOnly(Binder.getCallingUid(), "cleanupStuckCalls");
                    Binder.withCleanCallingIdentity(() -> {
                        for (Call call : mCallsManager.getCalls()) {
                            if (call.getState() == CallState.DISCONNECTED
                                    || call.getState() == CallState.DISCONNECTING) {
                                mCallsManager.markCallAsRemoved(call);
                            }
                        }
                    });
                }
            } finally {
                Log.endSession();
            }
        }

        @Override
        public void setTestDefaultCallRedirectionApp(String packageName) {
            try {
+1 −1

File changed.

Contains only whitespace changes.