Final structural tweaks to Telecomm API (7/8)
Ihab Awad [Tue, 12 Aug 2014 23:00:06 +0000 (16:00 -0700)]
Bug: 16416927
Bug: 16494880
Change-Id: I572145da40cda2bd9cc20d5277491c99cc66bb95

src/java/com/android/ims/internal/ImsVideoCallProvider.java
src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java

index 01a8bbb..0ac8672 100644 (file)
 package com.android.ims.internal;
 
 import android.os.Handler;
-import android.os.IBinder;
 import android.os.Looper;
 import android.os.Message;
 import android.os.RemoteException;
-import android.telecomm.CallCameraCapabilities;
-import android.telecomm.VideoCallProfile;
+import android.telecomm.CameraCapabilities;
+import android.telecomm.Connection;
+import android.telecomm.VideoProfile;
 import android.view.Surface;
 
 public abstract class ImsVideoCallProvider {
@@ -68,10 +68,10 @@ public abstract class ImsVideoCallProvider {
                     onSetZoom((Float) msg.obj);
                     break;
                 case MSG_SEND_SESSION_MODIFY_REQUEST:
-                    onSendSessionModifyRequest((VideoCallProfile) msg.obj);
+                    onSendSessionModifyRequest((VideoProfile) msg.obj);
                     break;
                 case MSG_SEND_SESSION_MODIFY_RESPONSE:
-                    onSendSessionModifyResponse((VideoCallProfile) msg.obj);
+                    onSendSessionModifyResponse((VideoProfile) msg.obj);
                     break;
                 case MSG_REQUEST_CAMERA_CAPABILITIES:
                     onRequestCameraCapabilities();
@@ -116,12 +116,12 @@ public abstract class ImsVideoCallProvider {
             mProviderHandler.obtainMessage(MSG_SET_ZOOM, value).sendToTarget();
         }
 
-        public void sendSessionModifyRequest(VideoCallProfile requestProfile) {
+        public void sendSessionModifyRequest(VideoProfile requestProfile) {
             mProviderHandler.obtainMessage(
                     MSG_SEND_SESSION_MODIFY_REQUEST, requestProfile).sendToTarget();
         }
 
-        public void sendSessionModifyResponse(VideoCallProfile responseProfile) {
+        public void sendSessionModifyResponse(VideoProfile responseProfile) {
             mProviderHandler.obtainMessage(
                     MSG_SEND_SESSION_MODIFY_RESPONSE, responseProfile).sendToTarget();
         }
@@ -150,49 +150,49 @@ public abstract class ImsVideoCallProvider {
         return mBinder;
     }
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSetCamera */
+    /** @see Connection.VideoProvider#onSetCamera */
     public abstract void onSetCamera(String cameraId);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSetPreviewSurface */
+    /** @see Connection.VideoProvider#onSetPreviewSurface */
     public abstract void onSetPreviewSurface(Surface surface);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSetDisplaySurface */
+    /** @see Connection.VideoProvider#onSetDisplaySurface */
     public abstract void onSetDisplaySurface(Surface surface);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSetDeviceOrientation */
+    /** @see Connection.VideoProvider#onSetDeviceOrientation */
     public abstract void onSetDeviceOrientation(int rotation);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSetZoom */
+    /** @see Connection.VideoProvider#onSetZoom */
     public abstract void onSetZoom(float value);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSendSessionModifyRequest */
-    public abstract void onSendSessionModifyRequest(VideoCallProfile requestProfile);
+    /** @see Connection.VideoProvider#onSendSessionModifyRequest */
+    public abstract void onSendSessionModifyRequest(VideoProfile requestProfile);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSendSessionModifyResponse */
-    public abstract void onSendSessionModifyResponse(VideoCallProfile responseProfile);
+    /** @see Connection.VideoProvider#onSendSessionModifyResponse */
+    public abstract void onSendSessionModifyResponse(VideoProfile responseProfile);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onRequestCameraCapabilities */
+    /** @see Connection.VideoProvider#onRequestCameraCapabilities */
     public abstract void onRequestCameraCapabilities();
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onRequestCallDataUsage */
+    /** @see Connection.VideoProvider#onRequestCallDataUsage */
     public abstract void onRequestCallDataUsage();
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#onSetPauseImage */
+    /** @see Connection.VideoProvider#onSetPauseImage */
     public abstract void onSetPauseImage(String uri);
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#receiveSessionModifyRequest */
-    public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
+    /** @see Connection.VideoProvider#receiveSessionModifyRequest */
+    public void receiveSessionModifyRequest(VideoProfile VideoProfile) {
         if (mCallback != null) {
             try {
-                mCallback.receiveSessionModifyRequest(videoCallProfile);
+                mCallback.receiveSessionModifyRequest(VideoProfile);
             } catch (RemoteException ignored) {
             }
         }
     }
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#receiveSessionModifyResponse */
+    /** @see Connection.VideoProvider#receiveSessionModifyResponse */
     public void receiveSessionModifyResponse(
-            int status, VideoCallProfile requestedProfile, VideoCallProfile responseProfile) {
+            int status, VideoProfile requestedProfile, VideoProfile responseProfile) {
         if (mCallback != null) {
             try {
                 mCallback.receiveSessionModifyResponse(status, requestedProfile, responseProfile);
@@ -201,7 +201,7 @@ public abstract class ImsVideoCallProvider {
         }
     }
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#handleCallSessionEvent */
+    /** @see Connection.VideoProvider#handleCallSessionEvent */
     public void handleCallSessionEvent(int event) {
         if (mCallback != null) {
             try {
@@ -211,7 +211,7 @@ public abstract class ImsVideoCallProvider {
         }
     }
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#changePeerDimensions */
+    /** @see Connection.VideoProvider#changePeerDimensions */
     public void changePeerDimensions(int width, int height) {
         if (mCallback != null) {
             try {
@@ -221,7 +221,7 @@ public abstract class ImsVideoCallProvider {
         }
     }
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#changeCallDataUsage */
+    /** @see Connection.VideoProvider#changeCallDataUsage */
     public void changeCallDataUsage(int dataUsage) {
         if (mCallback != null) {
             try {
@@ -231,11 +231,11 @@ public abstract class ImsVideoCallProvider {
         }
     }
 
-    /** @see android.telecomm.ConnectionService.VideoCallProvider#changeCameraCapabilities */
-    public void changeCameraCapabilities(CallCameraCapabilities callCameraCapabilities) {
+    /** @see Connection.VideoProvider#changeCameraCapabilities */
+    public void changeCameraCapabilities(CameraCapabilities CameraCapabilities) {
         if (mCallback != null) {
             try {
-                mCallback.changeCameraCapabilities(callCameraCapabilities);
+                mCallback.changeCameraCapabilities(CameraCapabilities);
             } catch (RemoteException ignored) {
             }
         }
index 4edb311..ef42c78 100644 (file)
@@ -21,17 +21,15 @@ import android.os.IBinder;
 import android.os.Looper;
 import android.os.Message;
 import android.os.RemoteException;
-import android.telecomm.CallCameraCapabilities;
-import android.telecomm.ConnectionService;
-import android.telecomm.VideoCallProfile;
+import android.telecomm.CameraCapabilities;
+import android.telecomm.Connection;
+import android.telecomm.VideoProfile;
 import android.view.Surface;
 
 import com.android.internal.os.SomeArgs;
 
-import java.lang.RuntimeException;
-
 /**
- * Subclass implementation of {@link ConnectionService.VideoCallProvider}. This intermediates and
+ * Subclass implementation of {@link Connection.VideoProvider}. This intermediates and
  * communicates with the actual implementation of the video call provider in the IMS service; it is
  * in essence, a wrapper around the IMS's video call provider implementation.
  *
@@ -41,7 +39,7 @@ import java.lang.RuntimeException;
  *
  * @hide
  */
-public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProvider {
+public class ImsVideoCallProviderWrapper extends Connection.VideoProvider {
     private static final int MSG_RECEIVE_SESSION_MODIFY_REQUEST = 1;
     private static final int MSG_RECEIVE_SESSION_MODIFY_RESPONSE = 2;
     private static final int MSG_HANDLE_CALL_SESSION_EVENT = 3;
@@ -64,14 +62,14 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
      */
     private final class ImsVideoCallCallback extends IImsVideoCallCallback.Stub {
         @Override
-        public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
+        public void receiveSessionModifyRequest(VideoProfile VideoProfile) {
             mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_REQUEST,
-                    videoCallProfile).sendToTarget();
+                    VideoProfile).sendToTarget();
         }
 
         @Override
         public void receiveSessionModifyResponse(
-                int status, VideoCallProfile requestProfile, VideoCallProfile responseProfile) {
+                int status, VideoProfile requestProfile, VideoProfile responseProfile) {
             SomeArgs args = SomeArgs.obtain();
             args.arg1 = status;
             args.arg2 = requestProfile;
@@ -98,7 +96,7 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
         }
 
         @Override
-        public void changeCameraCapabilities(CallCameraCapabilities cameraCapabilities) {
+        public void changeCameraCapabilities(CameraCapabilities cameraCapabilities) {
             mHandler.obtainMessage(MSG_CHANGE_CAMERA_CAPABILITIES,
                     cameraCapabilities).sendToTarget();
         }
@@ -111,14 +109,14 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
             SomeArgs args;
             switch (msg.what) {
                 case MSG_RECEIVE_SESSION_MODIFY_REQUEST:
-                    receiveSessionModifyRequest((VideoCallProfile) msg.obj);
+                    receiveSessionModifyRequest((VideoProfile) msg.obj);
                     break;
                 case MSG_RECEIVE_SESSION_MODIFY_RESPONSE:
                     args = (SomeArgs) msg.obj;
                     try {
                         int status = (int) args.arg1;
-                        VideoCallProfile requestProfile = (VideoCallProfile) args.arg2;
-                        VideoCallProfile responseProfile = (VideoCallProfile) args.arg3;
+                        VideoProfile requestProfile = (VideoProfile) args.arg2;
+                        VideoProfile responseProfile = (VideoProfile) args.arg3;
 
                         receiveSessionModifyResponse(status, requestProfile, responseProfile);
                     } finally {
@@ -142,7 +140,7 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
                     changeCallDataUsage(msg.arg1);
                     break;
                 case MSG_CHANGE_CAMERA_CAPABILITIES:
-                    changeCameraCapabilities((CallCameraCapabilities) msg.obj);
+                    changeCameraCapabilities((CameraCapabilities) msg.obj);
                     break;
                 default:
                     break;
@@ -154,11 +152,11 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
      * Instantiates an instance of the ImsVideoCallProvider, taking in the binder for IMS's video
      * call provider implementation.
      *
-     * @param videoCallProvider
+     * @param VideoProvider
      */
-    public ImsVideoCallProviderWrapper(IImsVideoCallProvider videoCallProvider)
+    public ImsVideoCallProviderWrapper(IImsVideoCallProvider VideoProvider)
             throws RemoteException {
-        mVideoCallProvider = videoCallProvider;
+        mVideoCallProvider = VideoProvider;
         mVideoCallProvider.asBinder().linkToDeath(mDeathRecipient, 0);
 
         mBinder = new ImsVideoCallCallback();
@@ -206,7 +204,7 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
     }
 
     /** @inheritDoc */
-    public void onSendSessionModifyRequest(VideoCallProfile requestProfile) {
+    public void onSendSessionModifyRequest(VideoProfile requestProfile) {
         try {
             mVideoCallProvider.sendSessionModifyRequest(requestProfile);
         } catch (RemoteException e) {
@@ -214,7 +212,7 @@ public class ImsVideoCallProviderWrapper extends ConnectionService.VideoCallProv
     }
 
     /** @inheritDoc */
-    public void onSendSessionModifyResponse(VideoCallProfile responseProfile) {
+    public void onSendSessionModifyResponse(VideoProfile responseProfile) {
         try {
             mVideoCallProvider.sendSessionModifyResponse(responseProfile);
         } catch (RemoteException e) {