Fix MockInCallService's default starting values

mIsServiceUnbound in MockInCallService used to have no initial value,
which means that it defaulted to false, effectively meaning that
MockInCallService started out thinking that it was bound. This caused
test failures in tests that did not make use of MockInCallService
because the cleanup code asserted that MockInCallService was unbound.

This change renames mIsServiceUnbound to mIsServiceBound and explicitly
sets the initial value to false.

Bug: 26641212
Merged-In: I03c6fb0b994c4b55bf55f9dbedd85fd3add8ef5e
Change-Id: I03c6fb0b994c4b55bf55f9dbedd85fd3add8ef5e
(cherry picked from commit 16d7c3485d18c208b67835c76423c170c1ad76de)
diff --git a/tests/tests/telecom/src/android/telecom/cts/BaseTelecomTestWithMockServices.java b/tests/tests/telecom/src/android/telecom/cts/BaseTelecomTestWithMockServices.java
index 052e820..8385b9b 100644
--- a/tests/tests/telecom/src/android/telecom/cts/BaseTelecomTestWithMockServices.java
+++ b/tests/tests/telecom/src/android/telecom/cts/BaseTelecomTestWithMockServices.java
@@ -867,12 +867,12 @@
                 new Condition() {
                     @Override
                     public Object expected() {
-                        return true;
+                        return false;
                     }
 
                     @Override
                     public Object actual() {
-                        return MockInCallService.isServiceUnbound();
+                        return MockInCallService.isServiceBound();
                     }
                 },
                 WAIT_FOR_STATE_CHANGE_TIMEOUT_MS,
diff --git a/tests/tests/telecom/src/android/telecom/cts/MockInCallService.java b/tests/tests/telecom/src/android/telecom/cts/MockInCallService.java
index 0f1f538..c371ed1 100644
--- a/tests/tests/telecom/src/android/telecom/cts/MockInCallService.java
+++ b/tests/tests/telecom/src/android/telecom/cts/MockInCallService.java
@@ -16,7 +16,7 @@
 
 package android.telecom.cts;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import android.content.Intent;
 import android.telecom.Call;
@@ -39,7 +39,7 @@
             new ArrayMap<Call, MockVideoCallCallback>();
 
     private static final Object sLock = new Object();
-    private static boolean mIsServiceUnbound;
+    private static boolean mIsServiceBound = false;
 
     public static abstract class InCallServiceCallbacks {
         private MockInCallService mService;
@@ -162,7 +162,7 @@
         if (getCallbacks() != null) {
             getCallbacks().setService(this);
         }
-        mIsServiceUnbound = false;
+        mIsServiceBound = true;
         return super.onBind(intent);
     }
 
@@ -323,13 +323,13 @@
 
     @Override
     public boolean onUnbind(Intent intent) {
-        Log.i(LOG_TAG, "Service unbounded");
-        assertFalse(mIsServiceUnbound);
-        mIsServiceUnbound = true;
+        Log.i(LOG_TAG, "Service has been unbound");
+        assertTrue(mIsServiceBound);
+        mIsServiceBound = false;
         return super.onUnbind(intent);
     }
 
-    public static boolean isServiceUnbound() {
-        return mIsServiceUnbound;
+    public static boolean isServiceBound() {
+        return mIsServiceBound;
     }
 }