diff --git a/src/com/android/telecomm/TelephonyUtil.java b/src/com/android/telecomm/TelephonyUtil.java
index a8cfb3e..83303c7 100644
--- a/src/com/android/telecomm/TelephonyUtil.java
+++ b/src/com/android/telecomm/TelephonyUtil.java
@@ -28,8 +28,7 @@
 public final class TelephonyUtil {
     private static final String TAG = TelephonyUtil.class.getSimpleName();
 
-    private static final String TELEPHONY_PACKAGE_NAME =
-            "com.android.phone";
+    private static final String TELEPHONY_PACKAGE_NAME = "com.android.phone";
 
     private static final String PSTN_CALL_SERVICE_CLASS_NAME =
             "com.android.services.telephony.PstnConnectionService";
@@ -37,13 +36,9 @@
     private TelephonyUtil() {}
 
     static boolean isPstnCallService(CallServiceDescriptor descriptor) {
-        ComponentName componentName = descriptor.getServiceComponent();
-        if (TELEPHONY_PACKAGE_NAME.equals(componentName.getPackageName())) {
-            String className = componentName.getClassName();
-            return PSTN_CALL_SERVICE_CLASS_NAME.equals(className);
-        }
-
-        return false;
+        final ComponentName pstnComponentName = new ComponentName(
+                TELEPHONY_PACKAGE_NAME, PSTN_CALL_SERVICE_CLASS_NAME);
+        return pstnComponentName.equals(descriptor.getServiceComponent());
     }
 
     /**
diff --git a/tests/src/com/android/telecomm/testapps/TestConnectionService.java b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
index c6f9fe3..6315e9a 100644
--- a/tests/src/com/android/telecomm/testapps/TestConnectionService.java
+++ b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
@@ -62,11 +62,6 @@
             }
 
             @Override
-            public void onAudioStateChanged(RemoteConnection connection, CallAudioState state) {
-                setAudioState(state);
-            }
-
-            @Override
             public void onDisconnected(RemoteConnection connection, int cause, String message) {
                 setDisconnected(cause, message);
                 destroyCall(TestConnection.this);
@@ -180,6 +175,13 @@
             }
         }
 
+        @Override
+        protected void onSetAudioState(CallAudioState state) {
+            if (mRemoteConnection != null) {
+                mRemoteConnection.setAudioState(state);
+            }
+        }
+
         private void setState(int state) {
             switch (state) {
                 case Connection.State.ACTIVE:
@@ -257,14 +259,6 @@
 
     /** {@inheritDoc} */
     @Override
-    public void onAdapterAttached(CallServiceAdapter callServiceAdapter) {
-        log("onAdapterAttached");
-        mMediaPlayer = createMediaPlayer();
-        super.onAdapterAttached(callServiceAdapter);
-    }
-
-    /** {@inheritDoc} */
-    @Override
     public boolean onUnbind(Intent intent) {
         log("onUnbind");
         mMediaPlayer = null;
@@ -273,7 +267,10 @@
 
     private void activateCall(TestConnection connection) {
         if (!connection.isProxy()) {
-            if (mMediaPlayer != null && !mMediaPlayer.isPlaying()) {
+            if (mMediaPlayer == null) {
+                mMediaPlayer = createMediaPlayer();
+            }
+            if (!mMediaPlayer.isPlaying()) {
                 mMediaPlayer.start();
             }
         }
