diff --git a/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java b/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java
index d71ef9d..3eb0bc5 100644
--- a/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java
+++ b/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java
@@ -125,7 +125,7 @@
         }
     }
 
-    private final class TestConnection extends Connection {
+    final class TestConnection extends Connection {
         private final boolean mIsIncoming;
 
         /** Used to cleanup camera and media when done with connection. */
@@ -136,6 +136,8 @@
             // Assume all calls are video capable.
             int capabilities = getConnectionCapabilities();
             capabilities |= CAPABILITY_SUPPORTS_VT_LOCAL;
+            capabilities |= CAPABILITY_SUPPORTS_VT_REMOTE;
+            capabilities |= CAPABILITY_CAN_UPGRADE_TO_VIDEO;
             capabilities |= CAPABILITY_MUTE;
             capabilities |= CAPABILITY_SUPPORT_HOLD;
             capabilities |= CAPABILITY_HOLD;
@@ -212,6 +214,7 @@
         @Override
         public void onAudioStateChanged(AudioState state) { }
 
+
         public void setTestVideoCallProvider(TestVideoProvider testVideoCallProvider) {
             mTestVideoCallProvider = testVideoCallProvider;
         }
@@ -281,7 +284,8 @@
                     handle.getSchemeSpecificPart() + "..", ""),
                     originalRequest.getExtras(),
                     originalRequest.getVideoState());
-
+            connection.setVideoState(originalRequest.getVideoState());
+            addVideoProvider(connection);
             addCall(connection);
             connection.startOutgoing();
 
@@ -312,14 +316,6 @@
             Uri address = providedHandle == null ?
                     Uri.fromParts(PhoneAccount.SCHEME_TEL, getDummyNumber(isVideoCall), null)
                     : providedHandle;
-            if (isVideoCall) {
-                TestVideoProvider testVideoCallProvider =
-                        new TestVideoProvider(getApplicationContext());
-                connection.setVideoProvider(testVideoCallProvider);
-
-                // Keep reference to original so we can clean up the media players later.
-                connection.setTestVideoCallProvider(testVideoCallProvider);
-            }
 
             int videoState = isVideoCall ?
                     VideoProfile.VideoState.BIDIRECTIONAL :
@@ -327,6 +323,8 @@
             connection.setVideoState(videoState);
             connection.setAddress(address, TelecomManager.PRESENTATION_ALLOWED);
 
+            addVideoProvider(connection);
+
             addCall(connection);
 
             ConnectionRequest newRequest = new ConnectionRequest(
@@ -367,6 +365,15 @@
         }
     }
 
+    private void addVideoProvider(TestConnection connection) {
+        TestVideoProvider testVideoCallProvider =
+                new TestVideoProvider(getApplicationContext(), connection);
+        connection.setVideoProvider(testVideoCallProvider);
+
+        // Keep reference to original so we can clean up the media players later.
+        connection.setTestVideoCallProvider(testVideoCallProvider);
+    }
+
     private void activateCall(TestConnection connection) {
         if (mMediaPlayer == null) {
             mMediaPlayer = createMediaPlayer();
diff --git a/testapps/src/com/android/server/telecom/testapps/TestVideoProvider.java b/testapps/src/com/android/server/telecom/testapps/TestVideoProvider.java
index 655d73b..35aaad6 100644
--- a/testapps/src/com/android/server/telecom/testapps/TestVideoProvider.java
+++ b/testapps/src/com/android/server/telecom/testapps/TestVideoProvider.java
@@ -20,6 +20,7 @@
 import com.android.ex.camera2.blocking.BlockingCameraManager.BlockingOpenException;
 import com.android.ex.camera2.blocking.BlockingSessionCallback;
 import com.android.server.telecom.testapps.R;
+import com.android.server.telecom.testapps.TestConnectionService.TestConnection;
 
 import android.content.Context;
 import android.graphics.SurfaceTexture;
@@ -52,6 +53,7 @@
  * Implements the VideoCallProvider.
  */
 public class TestVideoProvider extends Connection.VideoProvider {
+    private TestConnection mConnection;
     private CameraCapabilities mCameraCapabilities;
     private Random random;
     private Surface mDisplaySurface;
@@ -65,11 +67,14 @@
     private CameraCaptureSession mCameraSession;
     private CameraThread mLooperThread;
 
+    private final Handler mHandler = new Handler();
+
     private String mCameraId;
 
     private static final long SESSION_TIMEOUT_MS = 2000;
 
-    public TestVideoProvider(Context context) {
+    public TestVideoProvider(Context context, TestConnection connection) {
+        mConnection = connection;
         mContext = context;
         random = new Random();
         mCameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
@@ -140,15 +145,22 @@
      * the response back via the CallVideoClient.
      */
     @Override
-    public void onSendSessionModifyRequest(VideoProfile requestProfile) {
+    public void onSendSessionModifyRequest(final VideoProfile requestProfile) {
         log("Sent session modify request");
 
-        VideoProfile responseProfile = new VideoProfile(
-                requestProfile.getVideoState(), requestProfile.getQuality());
-        receiveSessionModifyResponse(
-                SESSION_MODIFY_REQUEST_SUCCESS,
-                requestProfile,
-                responseProfile);
+        mHandler.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                final VideoProfile responseProfile = new VideoProfile(
+                        requestProfile.getVideoState(), requestProfile.getQuality());
+                mConnection.setVideoState(requestProfile.getVideoState());
+
+                receiveSessionModifyResponse(
+                        SESSION_MODIFY_REQUEST_SUCCESS,
+                        requestProfile,
+                        responseProfile);
+            }
+        }, 2000);
     }
 
     @Override
