Base Implementation of SipTransport

Implements create/destroy procedures for app/ImsService. This is the
first in a series of CLs to implement SipTransport in telephony.

- SipTransportController: manages the SipDelegate connections between IMS app and
ImsService for a single slot. SipDelegates are created and destroyed for the
subId associated with the slot.

- SipDelegateController: SipTransportController creates a new SipDelegateController
for each request from an IMS application. The SipDelegateController maintains
the SipDelegate created for the feature tags assigned to it from SipTransportController.

- SipDelegateBinderConnection: Connection to SipDelegate on ImsService side. Can be
brought up/down as the associated features change.

- DelegateStateTracker/MessageTransportStateTracker: wrapper around binder to IMS
application's implementation of SipDelegateConnection callbacks.

Test: atest TeleServiceTests
Change-Id: Ieabd13aa4c54fa069ef5fa1298b1749e4192e583
diff --git a/tests/src/com/android/TelephonyTestBase.java b/tests/src/com/android/TelephonyTestBase.java
index 132d893..502740d 100644
--- a/tests/src/com/android/TelephonyTestBase.java
+++ b/tests/src/com/android/TelephonyTestBase.java
@@ -27,6 +27,7 @@
 import org.mockito.MockitoAnnotations;
 
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -58,6 +59,23 @@
         PhoneConfigurationManager.unregisterAllMultiSimConfigChangeRegistrants();
     }
 
+    protected final boolean waitForExecutorAction(Executor executor, long timeoutMillis) {
+        final CountDownLatch lock = new CountDownLatch(1);
+        Log.i("BRAD", "waitForExecutorAction");
+        executor.execute(() -> {
+            Log.i("BRAD", "countdown");
+            lock.countDown();
+        });
+        while (lock.getCount() > 0) {
+            try {
+                return lock.await(timeoutMillis, TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                // do nothing
+            }
+        }
+        return true;
+    }
+
     protected final void waitForHandlerAction(Handler h, long timeoutMillis) {
         final CountDownLatch lock = new CountDownLatch(1);
         h.post(lock::countDown);