From 1f6bbd292050973aa6e2ac5a1669cd04822e06d1 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 6 Aug 2014 12:14:21 -0700 Subject: [PATCH] "Implement" formerly abstract methods VideoCallProvider. Provide null-op methods so there is greater flexibility for classes which extend this base class, but might not support all its methods. In the future, if we add more methods to the *.aidl interface, this class can work with binaries which extend this class but don't implement all the methods since the superclass now implements those methods. Left onSetPreviewSurface and onSetDisplaySurface as abstract. Bug: 16842159 Change-Id: Ie7fea6ef5d473e3924ef370392f380603a568800 --- api/current.txt | 20 +++---- .../android/telecomm/ConnectionService.java | 53 ++++++++++++++----- 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/api/current.txt b/api/current.txt index ea842d567cb6f..89881fdac0ff9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28801,16 +28801,16 @@ package android.telecomm { method public void changeCameraCapabilities(android.telecomm.CallCameraCapabilities); method public void changePeerDimensions(int, int); method public void handleCallSessionEvent(int); - method public abstract void onRequestCallDataUsage(); - method public abstract void onRequestCameraCapabilities(); - method public abstract void onSendSessionModifyRequest(android.telecomm.VideoCallProfile); - method public abstract void onSendSessionModifyResponse(android.telecomm.VideoCallProfile); - method public abstract void onSetCamera(java.lang.String); - method public abstract void onSetDeviceOrientation(int); - method public abstract void onSetDisplaySurface(android.view.Surface); - method public abstract void onSetPauseImage(java.lang.String); - method public abstract void onSetPreviewSurface(android.view.Surface); - method public abstract void onSetZoom(float); + method public void onRequestCallDataUsage(); + method public void onRequestCameraCapabilities(); + method public void onSendSessionModifyRequest(android.telecomm.VideoCallProfile); + method public void onSendSessionModifyResponse(android.telecomm.VideoCallProfile); + method public void onSetCamera(java.lang.String); + method public void onSetDeviceOrientation(int); + method public void onSetDisplaySurface(android.view.Surface); + method public void onSetPauseImage(java.lang.String); + method public void onSetPreviewSurface(android.view.Surface); + method public void onSetZoom(float); method public void receiveSessionModifyRequest(android.telecomm.VideoCallProfile); method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile); } diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 53b304a31654f..fddc9b0898bbf 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -880,6 +880,11 @@ public abstract class ConnectionService extends Service { return sNullConnection; } + /** + * Abstraction for a class which provides video call functionality. This class contains no base + * implementation for its methods. It is expected that subclasses will override these + * functions to provide the desired behavior if it is supported. + */ public static abstract class VideoCallProvider { private static final int MSG_SET_VIDEO_CALL_LISTENER = 1; private static final int MSG_SET_CAMERA = 2; @@ -1012,38 +1017,48 @@ public abstract class ConnectionService extends Service { * * @param cameraId The id of the camera. */ - public abstract void onSetCamera(String cameraId); + public void onSetCamera(String cameraId) { + // To be implemented by subclass. + } /** * Sets the surface to be used for displaying a preview of what the user's camera is - * currently capturing. When video transmission is enabled, this is the video signal which is - * sent to the remote device. + * currently capturing. When video transmission is enabled, this is the video signal which + * is sent to the remote device. * * @param surface The surface. */ - public abstract void onSetPreviewSurface(Surface surface); + public void onSetPreviewSurface(Surface surface) { + // To be implemented by subclass. + } /** * Sets the surface to be used for displaying the video received from the remote device. * * @param surface The surface. */ - public abstract void onSetDisplaySurface(Surface surface); + public void onSetDisplaySurface(Surface surface) { + // To be implemented by subclass. + } /** - * Sets the device orientation, in degrees. Assumes that a standard portrait orientation of the - * device is 0 degrees. + * Sets the device orientation, in degrees. Assumes that a standard portrait orientation of + * the device is 0 degrees. * * @param rotation The device orientation, in degrees. */ - public abstract void onSetDeviceOrientation(int rotation); + public void onSetDeviceOrientation(int rotation) { + // To be implemented by subclass. + } /** * Sets camera zoom ratio. * * @param value The camera zoom ratio. */ - public abstract void onSetZoom(float value); + public void onSetZoom(float value) { + // To be implemented by subclass. + } /** * Issues a request to modify the properties of the current session. The request is sent to @@ -1054,7 +1069,9 @@ public abstract class ConnectionService extends Service { * * @param requestProfile The requested call video properties. */ - public abstract void onSendSessionModifyRequest(VideoCallProfile requestProfile); + public void onSendSessionModifyRequest(VideoCallProfile requestProfile) { + // To be implemented by subclass. + } /**te * Provides a response to a request to change the current call session video @@ -1066,21 +1083,27 @@ public abstract class ConnectionService extends Service { * * @param responseProfile The response call video properties. */ - public abstract void onSendSessionModifyResponse(VideoCallProfile responseProfile); + public void onSendSessionModifyResponse(VideoCallProfile responseProfile) { + // To be implemented by subclass. + } /** * Issues a request to the video provider to retrieve the camera capabilities. * Camera capabilities are reported back to the caller via * {@link InCallService.VideoCall.Listener#onCameraCapabilitiesChanged(CallCameraCapabilities)}. */ - public abstract void onRequestCameraCapabilities(); + public void onRequestCameraCapabilities() { + // To be implemented by subclass. + } /** * Issues a request to the video telephony framework to retrieve the cumulative data usage for * the current call. Data usage is reported back to the caller via * {@link InCallService.VideoCall.Listener#onCallDataUsageChanged}. */ - public abstract void onRequestCallDataUsage(); + public void onRequestCallDataUsage() { + // To be implemented by subclass. + } /** * Provides the video telephony framework with the URI of an image to be displayed to remote @@ -1088,7 +1111,9 @@ public abstract class ConnectionService extends Service { * * @param uri URI of image to display. */ - public abstract void onSetPauseImage(String uri); + public void onSetPauseImage(String uri) { + // To be implemented by subclass. + } /** * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.