Aidl changes related to VideoCallProvider in Ims.

+ Added a getVideoCallProvider function in IImsCallSession
+ Added IImsVideoCallProvider aidl. This is used for communication
between Telephony and the ImsService. It is redundant with
IVideoCallProvider on some level, but see associated bug and comments
in the class for more detail.
+ Added IImsVideoCallCallback. This is used for communicationing
callback invocations from ImsService to Telephony. It is redundant
with IVideoCallCallback for same reason in bugs/comments.
+ Some minor formatting changes.

Bug: 16886403
Change-Id: I03de12d4432f837e0930bc077307509b645493e0
diff --git a/Android.mk b/Android.mk
index 5485e9f..cd2cebb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -368,6 +368,8 @@
 	telephony/java/com/android/ims/internal/IImsStreamMediaSession.aidl \
 	telephony/java/com/android/ims/internal/IImsUt.aidl \
 	telephony/java/com/android/ims/internal/IImsUtListener.aidl \
+	telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl \
+	telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl \
 	telephony/java/com/android/ims/ImsConfigListener.aidl \
 	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
 	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 5e6bf87..34d35bf 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -1073,7 +1073,7 @@
             // To be implemented by subclass.
         }
 
-        /**te
+        /**
          * Provides a response to a request to change the current call session video
          * properties.
          * This is in response to a request the InCall UI has received via
@@ -1139,8 +1139,8 @@
          * @param requestedProfile The original request which was sent to the remote device.
          * @param responseProfile The actual profile changes made by the remote device.
          */
-        public void receiveSessionModifyResponse(int status,
-                                                 VideoCallProfile requestedProfile, VideoCallProfile responseProfile) {
+        public void receiveSessionModifyResponse(
+                int status, VideoCallProfile requestedProfile, VideoCallProfile responseProfile) {
             if (mVideoCallListener != null) {
                 try {
                     mVideoCallListener.receiveSessionModifyResponse(
diff --git a/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl b/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl
index a71ab0a..1a8f68e 100644
--- a/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl
@@ -19,14 +19,14 @@
 import android.telecomm.CallCameraCapabilities;
 import android.telecomm.VideoCallProfile;
 
- /**
-  * Internal definition of the a callback interface, used for an InCallUi to respond to video
-  * telephony changes.
-  *
-  * @see android.telecomm.InCallService.VideoCall.Listener
-  *
-  * {@hide}
-  */
+/**
+ * Internal definition of a callback interface, used for an InCallUi to respond to video telephony
+ * changes.
+ *
+ * @see android.telecomm.InCallService.VideoCall.Listener
+ *
+ * {@hide}
+ */
 oneway interface IVideoCallCallback {
     void receiveSessionModifyRequest(in VideoCallProfile videoCallProfile);
 
diff --git a/telephony/java/com/android/ims/internal/IImsCallSession.aidl b/telephony/java/com/android/ims/internal/IImsCallSession.aidl
index 5f2ff36..ba4cb01 100644
--- a/telephony/java/com/android/ims/internal/IImsCallSession.aidl
+++ b/telephony/java/com/android/ims/internal/IImsCallSession.aidl
@@ -19,6 +19,7 @@
 import com.android.ims.ImsCallProfile;
 import com.android.ims.ImsStreamMediaProfile;
 import com.android.ims.internal.IImsCallSessionListener;
+import com.android.ims.internal.IImsVideoCallProvider;
 
 /**
  * An IMS session that is associated with a SIP dialog which is established from/to
@@ -216,4 +217,11 @@
      * @param ussdMessage USSD message to send
      */
     void sendUssd(String ussdMessage);
+
+    /**
+     * Returns a binder for the video call provider implementation contained within the IMS service
+     * process. This binder is used by the VideoCallProvider subclass in Telephony which
+     * intermediates between the propriety implementation and Telecomm/InCall.
+     */
+    IImsVideoCallProvider getVideoCallProvider();
 }
diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl
new file mode 100644
index 0000000..6b8ec52
--- /dev/null
+++ b/telephony/java/com/android/ims/internal/IImsVideoCallCallback.aidl
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ims.internal;
+
+import android.telecomm.CallCameraCapabilities;
+import android.telecomm.VideoCallProfile;
+
+/**
+ * Internal remote interface for IMS's video call provider.
+ *
+ * At least initially, this aidl mirrors telecomm's {@link VideoCallCallback}. We created a
+ * separate aidl interface for invoking callbacks in Telephony from the IMS Service to without
+ * accessing internal interfaces. See {@link IImsVideoCallProvider} for additional detail.
+ *
+ * @see android.telecomm.internal.IVideoCallCallback
+ * @see android.telecomm.VideoCallImpl
+ *
+ * {@hide}
+ */
+oneway interface IImsVideoCallCallback {
+    void receiveSessionModifyRequest(in VideoCallProfile videoCallProfile);
+
+    void receiveSessionModifyResponse(int status, in VideoCallProfile requestedProfile,
+        in VideoCallProfile responseProfile);
+
+    void handleCallSessionEvent(int event);
+
+    void changePeerDimensions(int width, int height);
+
+    void changeCallDataUsage(int dataUsage);
+
+    void changeCameraCapabilities(in CallCameraCapabilities callCameraCapabilities);
+}
diff --git a/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl b/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl
new file mode 100644
index 0000000..f8389ec
--- /dev/null
+++ b/telephony/java/com/android/ims/internal/IImsVideoCallProvider.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ims.internal;
+
+import android.view.Surface;
+import android.telecomm.VideoCallProfile;
+
+import com.android.ims.internal.IImsVideoCallCallback;
+
+/**
+ * Internal remote interface for IMS's video call provider.
+ *
+ * At least initially, this aidl mirrors telecomm's {@link IVideoCallProvider}. We created a
+ * separate aidl interface even though the methods and parameters are same because the
+ * {@link IVideoCallProvider} was specifically created as a binder for inter-process communication
+ * between Telecomm and Telephony.
+ *
+ * We don't want to use the same aidl in other places for communication, namely communication
+ * between Telephony and the IMS Service, even if that communication may be for similar methods.
+ * This decouples the communication among these processes. Similarly, third parties implementing a
+ * video call provider will not have the benefit of accessing the internal
+ * {@link IVideoCallProvider} aidl for interprocess communication.
+ *
+ * @see android.telecomm.internal.IVideoCallProvider
+ * @see android.telecomm.VideoCallProvider
+ * @hide
+ */
+oneway interface IImsVideoCallProvider {
+    void setCallback(IImsVideoCallCallback callback);
+
+    void setCamera(String cameraId);
+
+    void setPreviewSurface(in Surface surface);
+
+    void setDisplaySurface(in Surface surface);
+
+    void setDeviceOrientation(int rotation);
+
+    void setZoom(float value);
+
+    void sendSessionModifyRequest(in VideoCallProfile reqProfile);
+
+    void sendSessionModifyResponse(in VideoCallProfile responseProfile);
+
+    void requestCameraCapabilities();
+
+    void requestCallDataUsage();
+
+    void setPauseImage(String uri);
+}