Fix BasicCallControlCallbacksTest test failure

verifyAnswerCall is failing because the assertion in the coroutine is
exexuting before the onAnswer callback is reached. Moving the assertions
out of the coroutine should guarantee that we always validate after the
call flow has terminated.

Fixes: 286584457
Test: BasicCallControlCallBacksTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:79553aa0a73f1fe70c44afe72937882bd7a78d73)
Merged-In: I97eadbc2415a55178664b45cab04ae1cda614005
Change-Id: I97eadbc2415a55178664b45cab04ae1cda614005
diff --git a/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlCallbacksTest.kt b/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlCallbacksTest.kt
index 1aaf4db..369fd7c 100644
--- a/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlCallbacksTest.kt
+++ b/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlCallbacksTest.kt
@@ -97,21 +97,21 @@
 
     @Suppress("deprecation")
     private fun verifyAnswerCall() {
+        assertFalse(TestUtils.mOnAnswerCallbackCalled)
         runBlocking {
             mCallsManager.addCall(TestUtils.INCOMING_CALL_ATTRIBUTES) {
                 setCallback(TestUtils.mCompleteAllCallControlCallbacksImpl)
                 launch {
                     val call = TestUtils.waitOnInCallServiceToReachXCalls(1)
                     assertNotNull("The returned Call object is <NULL>", call)
-                    assertFalse(TestUtils.mOnAnswerCallbackCalled)
                     call!!.answer(0) // API under test
                     TestUtils.waitOnCallState(call, Call.STATE_ACTIVE)
-                    // Assert that the callback was invoked
-                    assertTrue(TestUtils.mOnAnswerCallbackCalled)
                     // always send the disconnect signal if possible
                     assertTrue(disconnect(DisconnectCause(DisconnectCause.LOCAL)))
                 }
             }
         }
+        // Assert that the callback was invoked
+        assertTrue(TestUtils.mOnAnswerCallbackCalled)
     }
 }
\ No newline at end of file