Correct capitaliztion of "wi-fi" to "Wi-Fi".
automerge: 5f2de0f

* commit '5f2de0f118c1b40ebbd4329c66722f907c396163':
  Correct capitaliztion of "wi-fi" to "Wi-Fi".
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 663c412..fd06e53 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -371,8 +371,12 @@
     }
 
     public boolean isVideoCall(Context context) {
-        return CallUtil.isVideoEnabled(context) &&
-                VideoProfile.VideoState.isBidirectional(getVideoState());
+        // We want to show Video call buttons even if only one direction is enabled
+        // (That is what is happening when we receive a video call for example)
+        return CallUtil.isVideoEnabled(context) && (
+            VideoProfile.VideoState.isBidirectional(getVideoState()) ||
+            VideoProfile.VideoState.isReceptionEnabled(getVideoState()) ||
+            VideoProfile.VideoState.isTransmissionEnabled(getVideoState()));
     }
 
     public void setSessionModificationState(int state) {
diff --git a/InCallUI/src/com/android/incallui/GlowPadWrapper.java b/InCallUI/src/com/android/incallui/GlowPadWrapper.java
index 4754712..b50fdd8 100644
--- a/InCallUI/src/com/android/incallui/GlowPadWrapper.java
+++ b/InCallUI/src/com/android/incallui/GlowPadWrapper.java
@@ -124,6 +124,7 @@
                 mTargetTriggered = true;
                 break;
             case R.drawable.ic_videocam:
+            case R.drawable.ic_lockscreen_answer_video:
                 mAnswerListener.onAnswer(VideoProfile.VideoState.BIDIRECTIONAL, getContext());
                 mTargetTriggered = true;
                 break;
diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java
index 0b5bb4b..7859a17 100644
--- a/InCallUI/src/com/android/incallui/VideoCallFragment.java
+++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java
@@ -164,7 +164,7 @@
             // orientation change.
             if (mSavedSurfaceTexture == null) {
                 mSavedSurfaceTexture = surfaceTexture;
-                surfaceCreated = createSurface();
+                surfaceCreated = createSurface(width, height);
             } else {
                 // A saved SurfaceTexture was found.
                 surfaceCreated = true;
@@ -266,18 +266,20 @@
             mHeight = height;
 
             if (mSavedSurfaceTexture != null) {
-                createSurface();
+                createSurface(width, height);
             }
         }
 
         /**
          * Creates the {@link Surface}, adjusting the {@link SurfaceTexture} buffer size.
+         * @param width The width of the surface to create.
+         * @param height The height of the surface to create.
          */
-        private boolean createSurface() {
-            if (mWidth != DIMENSIONS_NOT_SET && mHeight != DIMENSIONS_NOT_SET &&
-                    mSavedSurfaceTexture != null) {
+        private boolean createSurface(int width, int height) {
+            if (width != DIMENSIONS_NOT_SET && height != DIMENSIONS_NOT_SET
+                    && mSavedSurfaceTexture != null) {
 
-                mSavedSurfaceTexture.setDefaultBufferSize(mWidth, mHeight);
+                mSavedSurfaceTexture.setDefaultBufferSize(width, height);
                 mSavedSurface = new Surface(mSavedSurfaceTexture);
                 return true;
             }
diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
index ed00241..c566264 100644
--- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
@@ -256,6 +256,8 @@
             mVideoCall.setDisplaySurface(null);
         } else if (surface == VideoCallFragment.SURFACE_PREVIEW) {
             mVideoCall.setPreviewSurface(null);
+            // Also disable camera as preview is closed
+            mVideoCall.setCamera(null);
         }
     }