Add VideoCall and VideoCall.Listener as an inner classes of Call.
Bug: 16494880
Bug: 16495203
Change-Id: Ife3b6723374ea5fbbff4927c4f9168d075be21e1
diff --git a/Android.mk b/Android.mk
index 0d71150..e3d3433 100644
--- a/Android.mk
+++ b/Android.mk
@@ -349,8 +349,8 @@
media/java/android/media/tv/ITvInputServiceCallback.aidl \
media/java/android/media/tv/ITvInputSession.aidl \
media/java/android/media/tv/ITvInputSessionCallback.aidl \
- telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl \
- telecomm/java/com/android/internal/telecomm/ICallVideoClient.aidl \
+ telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl \
+ telecomm/java/com/android/internal/telecomm/IVideoCallProvider.aidl \
telecomm/java/com/android/internal/telecomm/IConnectionService.aidl \
telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl \
telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl \
diff --git a/api/current.txt b/api/current.txt
index 23c7d03..68490d9 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28460,13 +28460,13 @@
method public void answer(int);
method public void conference();
method public void disconnect();
- method public android.telecomm.RemoteCallVideoProvider getCallVideoProvider();
method public java.util.List<java.lang.String> getCannedTextResponses();
method public java.util.List<android.telecomm.Call> getChildren();
method public android.telecomm.Call.Details getDetails();
method public android.telecomm.Call getParent();
method public java.lang.String getRemainingPostDialSequence();
method public int getState();
+ method public android.telecomm.InCallService.VideoCall getVideoCall();
method public void hold();
method public void phoneAccountClicked();
method public void phoneAccountSelected(android.telecomm.PhoneAccountHandle);
@@ -28505,7 +28505,6 @@
public static abstract class Call.Listener {
ctor public Call.Listener();
method public void onCallDestroyed(android.telecomm.Call);
- method public void onCallVideoProviderChanged(android.telecomm.Call, android.telecomm.RemoteCallVideoProvider);
method public void onCannedTextResponsesLoaded(android.telecomm.Call, java.util.List<java.lang.String>);
method public void onChildrenChanged(android.telecomm.Call, java.util.List<android.telecomm.Call>);
method public void onDetailsChanged(android.telecomm.Call, android.telecomm.Call.Details);
@@ -28514,6 +28513,7 @@
method public void onPostDialWait(android.telecomm.Call, java.lang.String);
method public void onStartActivity(android.telecomm.Call, android.app.PendingIntent);
method public void onStateChanged(android.telecomm.Call, int);
+ method public void onVideoCallChanged(android.telecomm.Call, android.telecomm.InCallService.VideoCall);
}
public final class CallAudioState implements android.os.Parcelable {
@@ -28577,45 +28577,12 @@
enum_constant public static final android.telecomm.CallState RINGING;
}
- public abstract class CallVideoClient {
- ctor public CallVideoClient();
- method public abstract void onHandleCallSessionEvent(int);
- method public abstract void onHandleCameraCapabilitiesChange(android.telecomm.CallCameraCapabilities);
- method public abstract void onReceiveSessionModifyRequest(android.telecomm.VideoCallProfile);
- method public abstract void onReceiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile);
- method public abstract void onUpdateCallDataUsage(int);
- method public abstract void onUpdatePeerDimensions(int, int);
- field public static final int SESSION_EVENT_RX_PAUSE = 1; // 0x1
- field public static final int SESSION_EVENT_RX_RESUME = 2; // 0x2
- field public static final int SESSION_EVENT_TX_START = 3; // 0x3
- field public static final int SESSION_EVENT_TX_STOP = 4; // 0x4
- field public static final int SESSION_MODIFY_REQUEST_FAIL = 2; // 0x2
- field public static final int SESSION_MODIFY_REQUEST_INVALID = 3; // 0x3
- field public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1; // 0x1
- }
-
- public abstract class CallVideoProvider {
- ctor public CallVideoProvider();
- 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 onSetCallVideoClient(android.telecomm.RemoteCallVideoClient);
- 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);
- }
-
public abstract class Connection {
ctor public Connection();
method public final void destroy();
method public final boolean getAudioModeIsVoip();
method public final android.telecomm.CallAudioState getCallAudioState();
method public final int getCallCapabilities();
- method public final android.telecomm.CallVideoProvider getCallVideoProvider();
method public final java.lang.String getCallerDisplayName();
method public final int getCallerDisplayNamePresentation();
method public final java.util.List<android.telecomm.Connection> getChildConnections();
@@ -28624,6 +28591,7 @@
method public final android.telecomm.Connection getParentConnection();
method public final int getState();
method public final android.telecomm.StatusHints getStatusHints();
+ method public final android.telecomm.VideoCallProvider getVideoCallProvider();
method public final int getVideoState();
method public final boolean isConferenceConnection();
method public final boolean isRequestingRingback();
@@ -28645,7 +28613,6 @@
method public final void setActive();
method public final void setAudioModeIsVoip(boolean);
method public final void setCallCapabilities(int);
- method public final void setCallVideoProvider(android.telecomm.CallVideoProvider);
method public final void setCallerDisplayName(java.lang.String, int);
method public final void setDialing();
method public final void setDisconnected(int, java.lang.String);
@@ -28657,6 +28624,7 @@
method public final void setRinging();
method public final void setSignal(android.os.Bundle);
method public final void setStatusHints(android.telecomm.StatusHints);
+ method public final void setVideoCallProvider(android.telecomm.VideoCallProvider);
method public final void setVideoState(int);
method public final void startActivityFromInCall(android.app.PendingIntent);
method public static java.lang.String stateToString(int);
@@ -28740,6 +28708,38 @@
method public void onPhoneDestroyed(android.telecomm.Phone);
}
+ public static abstract class InCallService.VideoCall {
+ ctor public InCallService.VideoCall();
+ method public abstract void requestCallDataUsage();
+ method public abstract void requestCameraCapabilities();
+ method public abstract void sendSessionModifyRequest(android.telecomm.VideoCallProfile);
+ method public abstract void sendSessionModifyResponse(android.telecomm.VideoCallProfile);
+ method public abstract void setCamera(java.lang.String);
+ method public abstract void setDeviceOrientation(int);
+ method public abstract void setDisplaySurface(android.view.Surface);
+ method public abstract void setPauseImage(java.lang.String);
+ method public abstract void setPreviewSurface(android.view.Surface);
+ method public abstract void setVideoCallListener(android.telecomm.InCallService.VideoCall.Listener);
+ method public abstract void setZoom(float);
+ field public static final int SESSION_EVENT_RX_PAUSE = 1; // 0x1
+ field public static final int SESSION_EVENT_RX_RESUME = 2; // 0x2
+ field public static final int SESSION_EVENT_TX_START = 3; // 0x3
+ field public static final int SESSION_EVENT_TX_STOP = 4; // 0x4
+ field public static final int SESSION_MODIFY_REQUEST_FAIL = 2; // 0x2
+ field public static final int SESSION_MODIFY_REQUEST_INVALID = 3; // 0x3
+ field public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1; // 0x1
+ }
+
+ public static abstract class InCallService.VideoCall.Listener {
+ ctor public InCallService.VideoCall.Listener();
+ method public abstract void onCallDataUsageChanged(int);
+ method public abstract void onCallSessionEvent(int);
+ method public abstract void onCameraCapabilitiesChanged(android.telecomm.CallCameraCapabilities);
+ method public abstract void onPeerDimensionsChanged(int, int);
+ method public abstract void onSessionModifyRequestReceived(android.telecomm.VideoCallProfile);
+ method public abstract void onSessionModifyResponseReceived(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile);
+ }
+
public final class Phone {
method public final void addListener(android.telecomm.Phone.Listener);
method public final android.telecomm.CallAudioState getAudioState();
@@ -28784,29 +28784,6 @@
field public static final android.os.Parcelable.Creator CREATOR;
}
- public class RemoteCallVideoClient {
- method public void handleCallSessionEvent(int);
- method public void handleCameraCapabilitiesChange(android.telecomm.CallCameraCapabilities);
- method public void receiveSessionModifyRequest(android.telecomm.VideoCallProfile);
- method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile);
- method public void updateCallDataUsage(int);
- method public void updatePeerDimensions(int, int);
- }
-
- public class RemoteCallVideoProvider {
- method public void requestCallDataUsage();
- method public void requestCameraCapabilities();
- method public void sendSessionModifyRequest(android.telecomm.VideoCallProfile);
- method public void sendSessionModifyResponse(android.telecomm.VideoCallProfile);
- method public void setCallVideoClient(android.telecomm.CallVideoClient);
- method public void setCamera(java.lang.String);
- method public void setDeviceOrientation(int);
- method public void setDisplaySurface(android.view.Surface);
- method public void setPauseImage(java.lang.String);
- method public void setPreviewSurface(android.view.Surface);
- method public void setZoom(float);
- }
-
public final class RemoteConnection {
method public void abort();
method public void addListener(android.telecomm.RemoteConnection.Listener);
@@ -28893,6 +28870,20 @@
field public static final java.lang.String EXTRA_START_CALL_WITH_VIDEO_STATE = "android.intent.extra.START_CALL_WITH_VIDEO_STATE";
}
+ public class VideoCallImpl extends android.telecomm.InCallService.VideoCall {
+ method public void requestCallDataUsage();
+ method public void requestCameraCapabilities();
+ method public void sendSessionModifyRequest(android.telecomm.VideoCallProfile);
+ method public void sendSessionModifyResponse(android.telecomm.VideoCallProfile);
+ method public void setCamera(java.lang.String);
+ method public void setDeviceOrientation(int);
+ method public void setDisplaySurface(android.view.Surface);
+ method public void setPauseImage(java.lang.String);
+ method public void setPreviewSurface(android.view.Surface);
+ method public void setVideoCallListener(android.telecomm.InCallService.VideoCall.Listener);
+ method public void setZoom(float);
+ }
+
public class VideoCallProfile implements android.os.Parcelable {
ctor public VideoCallProfile(int);
ctor public VideoCallProfile(int, int);
@@ -28912,6 +28903,26 @@
field public static final int VIDEO_STATE_TX_ENABLED = 1; // 0x1
}
+ public abstract class VideoCallProvider {
+ ctor public VideoCallProvider();
+ method public void changeCallDataUsage(int);
+ 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 receiveSessionModifyRequest(android.telecomm.VideoCallProfile);
+ method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile);
+ }
+
}
package android.telephony {
diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java
index ad5c614..838f221 100644
--- a/telecomm/java/android/telecomm/Call.java
+++ b/telecomm/java/android/telecomm/Call.java
@@ -18,9 +18,9 @@
import android.app.PendingIntent;
import android.net.Uri;
-import android.os.RemoteException;
import android.telephony.DisconnectCause;
+import java.lang.String;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -309,15 +309,13 @@
public void onPostDialWait(Call call, String remainingPostDialSequence) {}
/**
- * Invoked when the {@code RemoteCallVideoProvider} of the {@code Call} has changed.
+ * Invoked when the {@code Call.VideoCall} of the {@code Call} has changed.
*
* @param call The {@code Call} invoking this method.
- * @param callVideoProvider The {@code RemoteCallVideoProvider} associated with the
- * {@code Call}.
+ * @param videoCall The {@code Call.VideoCall} associated with the {@code Call}.
*/
- public void onCallVideoProviderChanged(Call call,
- RemoteCallVideoProvider callVideoProvider) {}
+ public void onVideoCallChanged(Call call, InCallService.VideoCall videoCall) {}
/**
* Launches an activity for this connection on top of the in-call UI.
@@ -348,7 +346,7 @@
private final List<Call> mUnmodifiableChildren = Collections.unmodifiableList(mChildren);
private List<String> mCannedTextResponses = null;
private String mRemainingPostDialSequence;
- private RemoteCallVideoProvider mCallVideoProvider;
+ private InCallService.VideoCall mVideoCall;
private Details mDetails;
private final List<Listener> mListeners = new ArrayList<>();
@@ -533,10 +531,10 @@
/**
* Obtains an object that can be used to display video from this {@code Call}.
*
- * @return An {@code ICallVideoProvider}.
+ * @return An {@code Call.VideoCall}.
*/
- public RemoteCallVideoProvider getCallVideoProvider() {
- return mCallVideoProvider;
+ public InCallService.VideoCall getVideoCall() {
+ return mVideoCall;
}
/**
@@ -609,14 +607,9 @@
Collections.unmodifiableList(parcelableCall.getCannedSmsResponses());
}
- boolean callVideoProviderChanged = false;
- try {
- callVideoProviderChanged =
- !Objects.equals(mCallVideoProvider, parcelableCall.getCallVideoProvider());
- if (callVideoProviderChanged) {
- mCallVideoProvider = parcelableCall.getCallVideoProvider();
- }
- } catch (RemoteException e) {
+ boolean videoCallChanged = !Objects.equals(mVideoCall, parcelableCall.getVideoCall());
+ if (videoCallChanged) {
+ mVideoCall = parcelableCall.getVideoCall();
}
int state = stateFromParcelableCallState(parcelableCall.getState());
@@ -649,8 +642,8 @@
if (cannedTextResponsesChanged) {
fireCannedTextResponsesLoaded(mCannedTextResponses);
}
- if (callVideoProviderChanged) {
- fireCallVideoProviderChanged(mCallVideoProvider);
+ if (videoCallChanged) {
+ fireVideoCallChanged(mVideoCall);
}
// If we have transitioned to DISCONNECTED, that means we need to notify clients and
@@ -715,10 +708,10 @@
}
}
- private void fireCallVideoProviderChanged(RemoteCallVideoProvider callVideoProvider) {
+ private void fireVideoCallChanged(InCallService.VideoCall videoCall) {
Listener[] listeners = mListeners.toArray(new Listener[mListeners.size()]);
for (int i = 0; i < listeners.length; i++) {
- listeners[i].onCallVideoProviderChanged(this, callVideoProvider);
+ listeners[i].onVideoCallChanged(this, videoCall);
}
}
@@ -773,4 +766,4 @@
return STATE_NEW;
}
}
-}
+}
\ No newline at end of file
diff --git a/telecomm/java/android/telecomm/CallVideoClient.java b/telecomm/java/android/telecomm/CallVideoClient.java
deleted file mode 100644
index 00473ff..0000000
--- a/telecomm/java/android/telecomm/CallVideoClient.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * 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 android.telecomm;
-
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Looper;
-import android.os.Message;
-
-import com.android.internal.os.SomeArgs;
-import com.android.internal.telecomm.ICallVideoClient;
-
-/**
- * Base implementation of a CallVideoClient which communicates changes to video properties of a call
- * from the framework to the current InCall-UI.
- */
-public abstract class CallVideoClient {
-
- /**
- * Video is not being received (no protocol pause was issued).
- */
- public static final int SESSION_EVENT_RX_PAUSE = 1;
-
- /**
- * Video reception has resumed after a SESSION_EVENT_RX_PAUSE.
- */
- public static final int SESSION_EVENT_RX_RESUME = 2;
-
- /**
- * Video transmission has begun. This occurs after a negotiated start of video transmission
- * when the underlying protocol has actually begun transmitting video to the remote party.
- */
- public static final int SESSION_EVENT_TX_START = 3;
-
- /**
- * Video transmission has stopped. This occur after a negotiated stop of video transmission when
- * the underlying protocol has actually stopped transmitting video to the remote party.
- */
- public static final int SESSION_EVENT_TX_STOP = 4;
-
- /**
- * Session modify request was successful.
- */
- public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1;
-
- /**
- * Session modify request failed.
- */
- public static final int SESSION_MODIFY_REQUEST_FAIL = 2;
-
- /**
- * Session modify request ignored due to invalid parameters.
- */
- public static final int SESSION_MODIFY_REQUEST_INVALID = 3;
-
- 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;
- private static final int MSG_UPDATE_PEER_DIMENSIONS = 4;
- private static final int MSG_UPDATE_CALL_DATA_USAGE = 5;
- private static final int MSG_HANDLE_CAMERA_CAPABILITIES_CHANGE = 6;
-
- /** Default Handler used to consolidate binder method calls onto a single thread. */
- private final Handler mHandler = new Handler(Looper.getMainLooper()) {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_RECEIVE_SESSION_MODIFY_REQUEST:
- onReceiveSessionModifyRequest((VideoCallProfile) msg.obj);
- break;
- case MSG_RECEIVE_SESSION_MODIFY_RESPONSE: {
- SomeArgs args = (SomeArgs) msg.obj;
- try {
- int status = (int) args.arg1;
- VideoCallProfile requestProfile = (VideoCallProfile) args.arg2;
- VideoCallProfile responseProfile = (VideoCallProfile) args.arg3;
-
- onReceiveSessionModifyResponse(status, requestProfile,
- responseProfile);
- } finally {
- args.recycle();
- }
- break;
- }
- case MSG_HANDLE_CALL_SESSION_EVENT:
- onHandleCallSessionEvent((int) msg.obj);
- break;
- case MSG_UPDATE_PEER_DIMENSIONS: {
- SomeArgs args = (SomeArgs) msg.obj;
- try {
- int width = (int) args.arg1;
- int height = (int) args.arg2;
- onUpdatePeerDimensions(width, height);
- } finally {
- args.recycle();
- }
- break;
- }
- case MSG_UPDATE_CALL_DATA_USAGE:
- onUpdateCallDataUsage(msg.arg1);
- break;
- case MSG_HANDLE_CAMERA_CAPABILITIES_CHANGE:
- onHandleCameraCapabilitiesChange((CallCameraCapabilities) msg.obj);
- break;
- default:
- break;
- }
- }
- };
-
- /**
- * Default ICallVideoClient implementation.
- */
- private final class CallVideoClientBinder extends ICallVideoClient.Stub {
- @Override
- public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
- mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_REQUEST,
- videoCallProfile).sendToTarget();
- }
-
- @Override
- public void receiveSessionModifyResponse(int status,
- VideoCallProfile requestProfile, VideoCallProfile responseProfile) {
- SomeArgs args = SomeArgs.obtain();
- args.arg1 = status;
- args.arg2 = requestProfile;
- args.arg3 = responseProfile;
- mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_RESPONSE, args).sendToTarget();
- }
-
- @Override
- public void handleCallSessionEvent(int event) {
- mHandler.obtainMessage(MSG_HANDLE_CALL_SESSION_EVENT, event).sendToTarget();
- }
-
- @Override
- public void updatePeerDimensions(int width, int height) {
- SomeArgs args = SomeArgs.obtain();
- args.arg1 = width;
- args.arg2 = height;
- mHandler.obtainMessage(MSG_UPDATE_PEER_DIMENSIONS, args).sendToTarget();
- }
-
- @Override
- public void updateCallDataUsage(int dataUsage) {
- mHandler.obtainMessage(MSG_UPDATE_CALL_DATA_USAGE, dataUsage).sendToTarget();
- }
-
- @Override
- public void handleCameraCapabilitiesChange(CallCameraCapabilities cameraCapabilities) {
- mHandler.obtainMessage(MSG_HANDLE_CAMERA_CAPABILITIES_CHANGE,
- cameraCapabilities).sendToTarget();
- }
- }
-
- private final CallVideoClientBinder mBinder;
-
- public CallVideoClient() {
- mBinder = new CallVideoClientBinder();
- }
-
- /**
- * Returns binder object which can be used across IPC methods.
- * @hide
- */
- public final IBinder getBinder() {
- return mBinder;
- }
-
- /**
- * Called when a session modification request is received from the remote device.
- * The remote request is sent via {@link CallVideoProvider#onSendSessionModifyRequest}.
- * The InCall UI is responsible for potentially prompting the user whether they wish to accept
- * the new call profile (e.g. prompt user if they wish to accept an upgrade from an audio to a
- * video call) and should call {@link CallVideoProvider#onSendSessionModifyResponse} to indicate
- * the video settings the user has agreed to.
- *
- * @param videoCallProfile The requested video call profile.
- */
- public abstract void onReceiveSessionModifyRequest(VideoCallProfile videoCallProfile);
-
- /**
- * Called when a response to a session modification request is received from the remote device.
- * The remote InCall UI sends the response using
- * {@link CallVideoProvider#onSendSessionModifyResponse}.
- *
- * @param status Status of the session modify request. Valid values are
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_SUCCESS},
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_FAIL},
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_INVALID}
- * @param requestProfile The original request which was sent to the remote device.
- * @param responseProfile The actual profile changes made by the remote device.
- */
- public abstract void onReceiveSessionModifyResponse(int status,
- VideoCallProfile requestProfile, VideoCallProfile responseProfile);
-
- /**
- * Handles events related to the current session which the client may wish to handle. These
- * are separate from requested changes to the session due to the underlying protocol or
- * connection.
- * Valid values are: {@link CallVideoClient#SESSION_EVENT_RX_PAUSE},
- * {@link CallVideoClient#SESSION_EVENT_RX_RESUME},
- * {@link CallVideoClient#SESSION_EVENT_TX_START}, {@link CallVideoClient#SESSION_EVENT_TX_STOP}
- *
- * @param event The event.
- */
- public abstract void onHandleCallSessionEvent(int event);
-
- /**
- * Handles a change to the video dimensions from the remote caller (peer). This could happen
- * if, for example, the peer changes orientation of their device.
- *
- * @param width The updated peer video width.
- * @param height The updated peer video height.
- */
- public abstract void onUpdatePeerDimensions(int width, int height);
-
- /**
- * Handles an update to the total data used for the current session.
- *
- * @param dataUsage The updated data usage.
- */
- public abstract void onUpdateCallDataUsage(int dataUsage);
-
- /**
- * Handles a change in camera capabilities.
- *
- * @param callCameraCapabilities The changed camera capabilities.
- */
- public abstract void onHandleCameraCapabilitiesChange(
- CallCameraCapabilities callCameraCapabilities);
-}
-
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index 02af68e..98b8249 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -19,10 +19,8 @@
import android.app.PendingIntent;
import android.net.Uri;
import android.os.Bundle;
-import android.telecomm.CallVideoProvider;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -46,7 +44,7 @@
public void onDestroyed(Connection c) {}
public void onCallCapabilitiesChanged(Connection c, int callCapabilities) {}
public void onParentConnectionChanged(Connection c, Connection parent) {}
- public void onCallVideoProviderChanged(Connection c, CallVideoProvider callVideoProvider) {}
+ public void onVideoCallProviderChanged(Connection c, VideoCallProvider videoCallProvider) {}
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
public void onStatusHintsChanged(Connection c, StatusHints statusHints) {}
public void onStartActivityFromInCall(Connection c, PendingIntent intent) {}
@@ -75,7 +73,7 @@
private boolean mRequestingRingback = false;
private int mCallCapabilities;
private Connection mParentConnection;
- private CallVideoProvider mCallVideoProvider;
+ private VideoCallProvider mVideoCallProvider;
private boolean mAudioModeIsVoip;
private StatusHints mStatusHints;
private int mVideoState;
@@ -349,18 +347,18 @@
}
/**
- * Sets the call video provider.
- * @param callVideoProvider The call video provider.
+ * Sets the video call provider.
+ * @param videoCallProvider The video call provider.
*/
- public final void setCallVideoProvider(CallVideoProvider callVideoProvider) {
- mCallVideoProvider = callVideoProvider;
+ public final void setVideoCallProvider(VideoCallProvider videoCallProvider) {
+ mVideoCallProvider = videoCallProvider;
for (Listener l : mListeners) {
- l.onCallVideoProviderChanged(this, callVideoProvider);
+ l.onVideoCallProviderChanged(this, videoCallProvider);
}
}
- public final CallVideoProvider getCallVideoProvider() {
- return mCallVideoProvider;
+ public final VideoCallProvider getVideoCallProvider() {
+ return mVideoCallProvider;
}
/**
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index d5b39cf..19e4489 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -390,9 +390,9 @@
}
@Override
- public void onCallVideoProviderChanged(Connection c, CallVideoProvider callVideoProvider) {
+ public void onVideoCallProviderChanged(Connection c, VideoCallProvider videoCallProvider) {
String id = mIdByConnection.get(c);
- mAdapter.setCallVideoProvider(id, callVideoProvider);
+ mAdapter.setVideoCallProvider(id, videoCallProvider);
}
@Override
@@ -443,8 +443,8 @@
connection.getHandlePresentation(),
connection.getCallerDisplayName(),
connection.getCallerDisplayNamePresentation(),
- connection.getCallVideoProvider() == null ?
- null : connection.getCallVideoProvider().getInterface(),
+ connection.getVideoCallProvider() == null ?
+ null : connection.getVideoCallProvider().getInterface(),
connection.getVideoState()));
}
diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
index 66e9925..8f91e72 100644
--- a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
@@ -25,7 +25,7 @@
import com.android.internal.telecomm.IConnectionService;
import com.android.internal.telecomm.IConnectionServiceAdapter;
-import com.android.internal.telecomm.ICallVideoProvider;
+import com.android.internal.telecomm.IVideoCallProvider;
import com.android.internal.telecomm.RemoteServiceCallback;
import java.util.ArrayList;
@@ -273,14 +273,14 @@
* Sets the call video provider for a call.
*
* @param callId The unique ID of the call to set with the given call video provider.
- * @param callVideoProvider The call video provider instance to set on the call.
+ * @param videoCallProvider The call video provider instance to set on the call.
*/
- void setCallVideoProvider(String callId, CallVideoProvider callVideoProvider) {
+ void setVideoCallProvider(String callId, VideoCallProvider videoCallProvider) {
for (IConnectionServiceAdapter adapter : mAdapters) {
try {
- adapter.setCallVideoProvider(
+ adapter.setVideoCallProvider(
callId,
- callVideoProvider == null ? null : callVideoProvider.getInterface());
+ videoCallProvider == null ? null : videoCallProvider.getInterface());
} catch (RemoteException e) {
}
}
diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java
index 9699e2a..38de08e 100644
--- a/telecomm/java/android/telecomm/InCallService.java
+++ b/telecomm/java/android/telecomm/InCallService.java
@@ -23,11 +23,14 @@
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
+import android.view.Surface;
import com.android.internal.os.SomeArgs;
import com.android.internal.telecomm.IInCallAdapter;
import com.android.internal.telecomm.IInCallService;
+import java.lang.String;
+
/**
* This service is implemented by any app that wishes to provide the user-interface for managing
* phone calls. Telecomm binds to this service while there exists a live (active or incoming) call,
@@ -196,4 +199,209 @@
*/
public void onPhoneDestroyed(Phone phone) {
}
+
+ /**
+ * Class to invoke functionality related to video calls.
+ */
+ public static abstract class VideoCall {
+
+ /**
+ * Video is not being received (no protocol pause was issued).
+ */
+ public static final int SESSION_EVENT_RX_PAUSE = 1;
+
+ /**
+ * Video reception has resumed after a SESSION_EVENT_RX_PAUSE.
+ */
+ public static final int SESSION_EVENT_RX_RESUME = 2;
+
+ /**
+ * Video transmission has begun. This occurs after a negotiated start of video transmission
+ * when the underlying protocol has actually begun transmitting video to the remote party.
+ */
+ public static final int SESSION_EVENT_TX_START = 3;
+
+ /**
+ * Video transmission has stopped. This occur after a negotiated stop of video transmission when
+ * the underlying protocol has actually stopped transmitting video to the remote party.
+ */
+ public static final int SESSION_EVENT_TX_STOP = 4;
+
+ /**
+ * Session modify request was successful.
+ */
+ public static final int SESSION_MODIFY_REQUEST_SUCCESS = 1;
+
+ /**
+ * Session modify request failed.
+ */
+ public static final int SESSION_MODIFY_REQUEST_FAIL = 2;
+
+ /**
+ * Session modify request ignored due to invalid parameters.
+ */
+ public static final int SESSION_MODIFY_REQUEST_INVALID = 3;
+
+ /**
+ * Sets a listener to invoke callback methods in the InCallUI after performing video
+ * telephony actions.
+ *
+ * @param videoCallListener The call video client.
+ */
+ public abstract void setVideoCallListener(VideoCall.Listener videoCallListener);
+
+ /**
+ * Sets the camera to be used for video recording in a video call.
+ *
+ * @param cameraId The id of the camera.
+ */
+ public abstract void setCamera(String cameraId);
+
+ /**
+ * 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.
+ *
+ * @param surface The surface.
+ */
+ public abstract void setPreviewSurface(Surface surface);
+
+ /**
+ * Sets the surface to be used for displaying the video received from the remote device.
+ *
+ * @param surface The surface.
+ */
+ public abstract void setDisplaySurface(Surface surface);
+
+ /**
+ * 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 setDeviceOrientation(int rotation);
+
+ /**
+ * Sets camera zoom ratio.
+ *
+ * @param value The camera zoom ratio.
+ */
+ public abstract void setZoom(float value);
+
+ /**
+ * Issues a request to modify the properties of the current session. The request is sent to
+ * the remote device where it it handled by
+ * {@link VideoCall.Listener#onSessionModifyRequestReceived}.
+ * Some examples of session modification requests: upgrade call from audio to video,
+ * downgrade call from video to audio, pause video.
+ *
+ * @param requestProfile The requested call video properties.
+ */
+ public abstract void sendSessionModifyRequest(VideoCallProfile requestProfile);
+
+ /**
+ * 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
+ * {@link VideoCall.Listener#onSessionModifyRequestReceived}.
+ * The response is handled on the remove device by
+ * {@link VideoCall.Listener#onSessionModifyResponseReceived}.
+ *
+ * @param responseProfile The response call video properties.
+ */
+ public abstract void sendSessionModifyResponse(VideoCallProfile responseProfile);
+
+ /**
+ * Issues a request to the video provider to retrieve the camera capabilities.
+ * Camera capabilities are reported back to the caller via
+ * {@link VideoCall.Listener#onCameraCapabilitiesChanged(CallCameraCapabilities)}.
+ */
+ public abstract void requestCameraCapabilities();
+
+ /**
+ * 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 VideoCall.Listener#onCallDataUsageChanged}.
+ */
+ public abstract void requestCallDataUsage();
+
+ /**
+ * Provides the video telephony framework with the URI of an image to be displayed to remote
+ * devices when the video signal is paused.
+ *
+ * @param uri URI of image to display.
+ */
+ public abstract void setPauseImage(String uri);
+
+ /**
+ * Listener class which invokes callbacks after video call actions occur.
+ */
+ public static abstract class Listener {
+ /**
+ * Called when a session modification request is received from the remote device.
+ * The remote request is sent via {@link VideoCallProvider#onSendSessionModifyRequest}.
+ * The InCall UI is responsible for potentially prompting the user whether they wish to
+ * accept the new call profile (e.g. prompt user if they wish to accept an upgrade from
+ * an audio to a video call) and should call
+ * {@link VideoCallProvider#onSendSessionModifyResponse} to indicate the video settings
+ * the user has agreed to.
+ *
+ * @param videoCallProfile The requested video call profile.
+ */
+ public abstract void onSessionModifyRequestReceived(VideoCallProfile videoCallProfile);
+
+ /**
+ * Called when a response to a session modification request is received from the remote
+ * device. The remote InCall UI sends the response using
+ * {@link VideoCallProvider#onSendSessionModifyResponse}.
+ *
+ * @param status Status of the session modify request. Valid values are
+ * {@link VideoCall#SESSION_MODIFY_REQUEST_SUCCESS},
+ * {@link VideoCall#SESSION_MODIFY_REQUEST_FAIL},
+ * {@link VideoCall#SESSION_MODIFY_REQUEST_INVALID}
+ * @param requestedProfile The original request which was sent to the remote device.
+ * @param responseProfile The actual profile changes made by the remote device.
+ */
+ public abstract void onSessionModifyResponseReceived(int status,
+ VideoCallProfile requestedProfile, VideoCallProfile responseProfile);
+
+ /**
+ * Handles events related to the current session which the client may wish to handle.
+ * These are separate from requested changes to the session due to the underlying
+ * protocol or connection.
+ *
+ * Valid values are: {@link VideoCall#SESSION_EVENT_RX_PAUSE},
+ * {@link VideoCall#SESSION_EVENT_RX_RESUME},
+ * {@link VideoCall#SESSION_EVENT_TX_START},
+ * {@link VideoCall#SESSION_EVENT_TX_STOP}
+ *
+ * @param event The event.
+ */
+ public abstract void onCallSessionEvent(int event);
+
+ /**
+ * Handles a change to the video dimensions from the remote caller (peer). This could
+ * happen if, for example, the peer changes orientation of their device.
+ *
+ * @param width The updated peer video width.
+ * @param height The updated peer video height.
+ */
+ public abstract void onPeerDimensionsChanged(int width, int height);
+
+ /**
+ * Handles an update to the total data used for the current session.
+ *
+ * @param dataUsage The updated data usage.
+ */
+ public abstract void onCallDataUsageChanged(int dataUsage);
+
+ /**
+ * Handles a change in camera capabilities.
+ *
+ * @param callCameraCapabilities The changed camera capabilities.
+ */
+ public abstract void onCameraCapabilitiesChanged(
+ CallCameraCapabilities callCameraCapabilities);
+ }
+ }
}
diff --git a/telecomm/java/android/telecomm/ParcelableCall.java b/telecomm/java/android/telecomm/ParcelableCall.java
index 27a5c1d..e60761a 100644
--- a/telecomm/java/android/telecomm/ParcelableCall.java
+++ b/telecomm/java/android/telecomm/ParcelableCall.java
@@ -22,7 +22,7 @@
import android.os.RemoteException;
import android.telephony.DisconnectCause;
-import com.android.internal.telecomm.ICallVideoProvider;
+import com.android.internal.telecomm.IVideoCallProvider;
import java.util.ArrayList;
import java.util.List;
@@ -45,8 +45,8 @@
private final int mCallerDisplayNamePresentation;
private final GatewayInfo mGatewayInfo;
private final PhoneAccountHandle mAccountHandle;
- private final ICallVideoProvider mCallVideoProvider;
- private RemoteCallVideoProvider mRemoteCallVideoProvider;
+ private final IVideoCallProvider mVideoCallProvider;
+ private InCallService.VideoCall mVideoCall;
private final String mParentCallId;
private final List<String> mChildCallIds;
private final StatusHints mStatusHints;
@@ -67,7 +67,7 @@
int callerDisplayNamePresentation,
GatewayInfo gatewayInfo,
PhoneAccountHandle accountHandle,
- ICallVideoProvider callVideoProvider,
+ IVideoCallProvider videoCallProvider,
String parentCallId,
List<String> childCallIds,
StatusHints statusHints,
@@ -85,7 +85,7 @@
mCallerDisplayNamePresentation = callerDisplayNamePresentation;
mGatewayInfo = gatewayInfo;
mAccountHandle = accountHandle;
- mCallVideoProvider = callVideoProvider;
+ mVideoCallProvider = videoCallProvider;
mParentCallId = parentCallId;
mChildCallIds = childCallIds;
mStatusHints = statusHints;
@@ -166,19 +166,19 @@
}
/**
- * Returns an object for remotely communicating through the call video provider's binder.
- * @return The call video provider.
+ * Returns an object for remotely communicating through the video call provider's binder.
+ * @return The video call.
*/
- public RemoteCallVideoProvider getCallVideoProvider() throws RemoteException {
- if (mRemoteCallVideoProvider == null && mCallVideoProvider != null) {
+ public InCallService.VideoCall getVideoCall() {
+ if (mVideoCall == null && mVideoCallProvider != null) {
try {
- mRemoteCallVideoProvider = new RemoteCallVideoProvider(mCallVideoProvider);
+ mVideoCall = new VideoCallImpl(mVideoCallProvider);
} catch (RemoteException ignored) {
// Ignore RemoteException.
}
}
- return mRemoteCallVideoProvider;
+ return mVideoCall;
}
/**
@@ -235,8 +235,8 @@
int callerDisplayNamePresentation = source.readInt();
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
- ICallVideoProvider callVideoProvider =
- ICallVideoProvider.Stub.asInterface(source.readStrongBinder());
+ IVideoCallProvider videoCallProvider =
+ IVideoCallProvider.Stub.asInterface(source.readStrongBinder());
String parentCallId = source.readString();
List<String> childCallIds = new ArrayList<>();
source.readList(childCallIds, classLoader);
@@ -245,7 +245,7 @@
return new ParcelableCall(id, state, disconnectCauseCode, disconnectCauseMsg,
cannedSmsResponses, capabilities, connectTimeMillis, handle, handlePresentation,
callerDisplayName, callerDisplayNamePresentation, gatewayInfo,
- accountHandle, callVideoProvider, parentCallId, childCallIds, statusHints,
+ accountHandle, videoCallProvider, parentCallId, childCallIds, statusHints,
videoState);
}
@@ -278,7 +278,7 @@
destination.writeParcelable(mGatewayInfo, 0);
destination.writeParcelable(mAccountHandle, 0);
destination.writeStrongBinder(
- mCallVideoProvider != null ? mCallVideoProvider.asBinder() : null);
+ mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
destination.writeString(mParentCallId);
destination.writeList(mChildCallIds);
destination.writeParcelable(mStatusHints, 0);
diff --git a/telecomm/java/android/telecomm/ParcelableConnection.java b/telecomm/java/android/telecomm/ParcelableConnection.java
index f730fef..e0bfab6 100644
--- a/telecomm/java/android/telecomm/ParcelableConnection.java
+++ b/telecomm/java/android/telecomm/ParcelableConnection.java
@@ -20,7 +20,7 @@
import android.os.Parcel;
import android.os.Parcelable;
-import com.android.internal.telecomm.ICallVideoProvider;
+import com.android.internal.telecomm.IVideoCallProvider;
/**
* Information about a connection that is used between Telecomm and the ConnectionService.
@@ -36,7 +36,7 @@
private int mHandlePresentation;
private String mCallerDisplayName;
private int mCallerDisplayNamePresentation;
- private ICallVideoProvider mCallVideoProvider;
+ private IVideoCallProvider mVideoCallProvider;
private int mVideoState;
/** @hide */
@@ -48,7 +48,7 @@
int handlePresentation,
String callerDisplayName,
int callerDisplayNamePresentation,
- ICallVideoProvider callVideoProvider,
+ IVideoCallProvider videoCallProvider,
int videoState) {
mPhoneAccount = phoneAccount;
mState = state;
@@ -57,7 +57,7 @@
mHandlePresentation = handlePresentation;
mCallerDisplayName = callerDisplayName;
mCallerDisplayNamePresentation = callerDisplayNamePresentation;
- mCallVideoProvider = callVideoProvider;
+ mVideoCallProvider = videoCallProvider;
mVideoState = videoState;
}
@@ -90,8 +90,8 @@
return mCallerDisplayNamePresentation;
}
- public ICallVideoProvider getCallVideoProvider() {
- return mCallVideoProvider;
+ public IVideoCallProvider getVideoCallProvider() {
+ return mVideoCallProvider;
}
public int getVideoState() {
@@ -111,8 +111,8 @@
int handlePresentation = source.readInt();
String callerDisplayName = source.readString();
int callerDisplayNamePresentation = source.readInt();
- ICallVideoProvider callVideoProvider =
- ICallVideoProvider.Stub.asInterface(source.readStrongBinder());
+ IVideoCallProvider videoCallProvider =
+ IVideoCallProvider.Stub.asInterface(source.readStrongBinder());
int videoState = source.readInt();
return new ParcelableConnection(
@@ -123,7 +123,7 @@
handlePresentation,
callerDisplayName,
callerDisplayNamePresentation,
- callVideoProvider,
+ videoCallProvider,
videoState);
}
@@ -150,7 +150,7 @@
destination.writeString(mCallerDisplayName);
destination.writeInt(mCallerDisplayNamePresentation);
destination.writeStrongBinder(
- mCallVideoProvider != null ? mCallVideoProvider.asBinder() : null);
+ mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
destination.writeInt(mVideoState);
}
}
diff --git a/telecomm/java/android/telecomm/RemoteCallVideoClient.java b/telecomm/java/android/telecomm/RemoteCallVideoClient.java
deleted file mode 100644
index 08d1391..0000000
--- a/telecomm/java/android/telecomm/RemoteCallVideoClient.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * 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 android.telecomm;
-
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.telecomm.CallCameraCapabilities;
-import android.telecomm.VideoCallProfile;
-
-import com.android.internal.telecomm.ICallVideoClient;
-
-/**
- * Remote class to invoke callbacks in InCallUI related to supporting video in calls.
- */
-public class RemoteCallVideoClient {
- private final ICallVideoClient mCallVideoClient;
-
- private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
- @Override
- public void binderDied() {
- mCallVideoClient.asBinder().unlinkToDeath(this, 0);
- }
- };
-
- /** {@hide} */
- RemoteCallVideoClient(ICallVideoClient callVideoProvider) throws RemoteException {
- mCallVideoClient = callVideoProvider;
- mCallVideoClient.asBinder().linkToDeath(mDeathRecipient, 0);
- }
-
- /**
- * Called when a session modification request is received from the remote device.
- * The remote request is sent via {@link CallVideoProvider#onSendSessionModifyRequest}.
- * The InCall UI is responsible for potentially prompting the user whether they wish to accept
- * the new call profile (e.g. prompt user if they wish to accept an upgrade from an audio to a
- * video call) and should call {@link CallVideoProvider#onSendSessionModifyResponse} to indicate
- * the video settings the user has agreed to.
- *
- * @param videoCallProfile The requested video call profile.
- */
- public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
- try {
- mCallVideoClient.receiveSessionModifyRequest(videoCallProfile);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Called when a response to a session modification request is received from the remote device.
- * The remote InCall UI sends the response using
- * {@link CallVideoProvider#onSendSessionModifyResponse}.
- *
- * @param status Status of the session modify request. Valid values are
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_SUCCESS},
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_FAIL},
- * {@link CallVideoClient#SESSION_MODIFY_REQUEST_INVALID}
- * @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) {
- try {
- mCallVideoClient.receiveSessionModifyResponse(
- status, requestedProfile, responseProfile);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Handles events related to the current session which the client may wish to handle. These
- * are separate from requested changes to the session due to the underlying protocol or
- * connection.
- * Valid values are: {@link CallVideoClient#SESSION_EVENT_RX_PAUSE},
- * {@link CallVideoClient#SESSION_EVENT_RX_RESUME},
- * {@link CallVideoClient#SESSION_EVENT_TX_START}, {@link CallVideoClient#SESSION_EVENT_TX_STOP}
- *
- * @param event The event.
- */
- public void handleCallSessionEvent(int event) {
- try {
- mCallVideoClient.handleCallSessionEvent(event);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Handles a change to the video dimensions from the remote caller (peer). This could happen
- * if, for example, the peer changes orientation of their device.
- *
- * @param width The updated peer video width.
- * @param height The updated peer video height.
- */
- public void updatePeerDimensions(int width, int height) {
- try {
- mCallVideoClient.updatePeerDimensions(width, height);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Handles an update to the total data used for the current session.
- *
- * @param dataUsage The updated data usage.
- */
- public void updateCallDataUsage(int dataUsage) {
- try {
- mCallVideoClient.updateCallDataUsage(dataUsage);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Handles a change in camera capabilities.
- *
- * @param callCameraCapabilities The changed camera capabilities.
- */
- public void handleCameraCapabilitiesChange(CallCameraCapabilities callCameraCapabilities) {
- try {
- mCallVideoClient.handleCameraCapabilitiesChange(callCameraCapabilities);
- } catch (RemoteException e) {
- }
- }
-}
\ No newline at end of file
diff --git a/telecomm/java/android/telecomm/RemoteCallVideoProvider.java b/telecomm/java/android/telecomm/RemoteCallVideoProvider.java
deleted file mode 100644
index b8b8b9d..0000000
--- a/telecomm/java/android/telecomm/RemoteCallVideoProvider.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * 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 android.telecomm;
-
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.view.Surface;
-
-import com.android.internal.telecomm.ICallVideoProvider;
-
-/**
- * Remote class for InCallUI to invoke functionality provided for video in calls.
- */
-public class RemoteCallVideoProvider {
- private final ICallVideoProvider mCallVideoProvider;
-
- private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
- @Override
- public void binderDied() {
- mCallVideoProvider.asBinder().unlinkToDeath(this, 0);
- }
- };
-
- /** {@hide} */
- RemoteCallVideoProvider(ICallVideoProvider callVideoProvider) throws RemoteException {
- mCallVideoProvider = callVideoProvider;
- mCallVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0);
- }
-
- /**
- * Sets a remote interface for invoking callback methods in the InCallUI after performing
- * telephony actions.
- *
- * @param callVideoClient The call video client.
- */
- public void setCallVideoClient(CallVideoClient callVideoClient) {
- try {
- mCallVideoProvider.setCallVideoClient(callVideoClient.getBinder());
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Sets the camera to be used for video recording in a video call.
- *
- * @param cameraId The id of the camera.
- */
- public void setCamera(String cameraId) {
- try {
- mCallVideoProvider.setCamera(cameraId);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * 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.
- *
- * @param surface The surface.
- */
- public void setPreviewSurface(Surface surface) {
- try {
- mCallVideoProvider.setPreviewSurface(surface);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Sets the surface to be used for displaying the video received from the remote device.
- *
- * @param surface The surface.
- */
- public void setDisplaySurface(Surface surface) {
- try {
- mCallVideoProvider.setDisplaySurface(surface);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * 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 void setDeviceOrientation(int rotation) {
- try {
- mCallVideoProvider.setDeviceOrientation(rotation);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Sets camera zoom ratio.
- *
- * @param value The camera zoom ratio.
- */
- public void setZoom(float value) {
- try {
- mCallVideoProvider.setZoom(value);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Issues a request to modify the properties of the current session. The request is sent to
- * the remote device where it it handled by
- * {@link CallVideoClient#onReceiveSessionModifyRequest}.
- * Some examples of session modification requests: upgrade call from audio to video, downgrade
- * call from video to audio, pause video.
- *
- * @param requestProfile The requested call video properties.
- */
- public void sendSessionModifyRequest(VideoCallProfile requestProfile) {
- try {
- mCallVideoProvider.sendSessionModifyRequest(requestProfile);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * 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
- * {@link CallVideoClient#onReceiveSessionModifyRequest}.
- * The response is handled on the remove device by
- * {@link CallVideoClient#onReceiveSessionModifyResponse}.
- *
- * @param responseProfile The response call video properties.
- */
- public void sendSessionModifyResponse(VideoCallProfile responseProfile) {
- try {
- mCallVideoProvider.sendSessionModifyResponse(responseProfile);
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Issues a request to the video provider to retrieve the camera capabilities.
- * Camera capabilities are reported back to the caller via
- * {@link CallVideoClient#onHandleCameraCapabilitiesChange(CallCameraCapabilities)}.
- */
- public void requestCameraCapabilities() {
- try {
- mCallVideoProvider.requestCameraCapabilities();
- } catch (RemoteException e) {
- }
- }
-
- /**
- * 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 CallVideoClient#onUpdateCallDataUsage}.
- */
- public void requestCallDataUsage() {
- try {
- mCallVideoProvider.requestCallDataUsage();
- } catch (RemoteException e) {
- }
- }
-
- /**
- * Provides the video telephony framework with the URI of an image to be displayed to remote
- * devices when the video signal is paused.
- *
- * @param uri URI of image to display.
- */
- public void setPauseImage(String uri) {
- try {
- mCallVideoProvider.setPauseImage(uri);
- } catch (RemoteException e) {
- }
- }
-}
\ No newline at end of file
diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java
index 10569ab..c07ff43 100644
--- a/telecomm/java/android/telecomm/RemoteConnectionService.java
+++ b/telecomm/java/android/telecomm/RemoteConnectionService.java
@@ -27,9 +27,9 @@
import android.text.TextUtils;
import com.android.internal.os.SomeArgs;
-import com.android.internal.telecomm.ICallVideoProvider;
import com.android.internal.telecomm.IConnectionService;
import com.android.internal.telecomm.IConnectionServiceAdapter;
+import com.android.internal.telecomm.IVideoCallProvider;
import com.android.internal.telecomm.RemoteServiceCallback;
import java.util.LinkedList;
@@ -360,8 +360,8 @@
}
@Override
- public void setCallVideoProvider(
- String connectionId, ICallVideoProvider callVideoProvider) {
+ public void setVideoCallProvider(
+ String connectionId, IVideoCallProvider videoCallProvider) {
// not supported for remote connections.
}
diff --git a/telecomm/java/android/telecomm/VideoCallImpl.java b/telecomm/java/android/telecomm/VideoCallImpl.java
new file mode 100644
index 0000000..3e538cb
--- /dev/null
+++ b/telecomm/java/android/telecomm/VideoCallImpl.java
@@ -0,0 +1,245 @@
+/*
+ * 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 android.telecomm;
+
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.RemoteException;
+import android.telecomm.InCallService.VideoCall;
+import android.view.Surface;
+
+import com.android.internal.os.SomeArgs;
+import com.android.internal.telecomm.IVideoCallCallback;
+import com.android.internal.telecomm.IVideoCallProvider;
+
+/**
+ * Implementation of a Video Call, which allows InCallUi to communicate commands to the underlying
+ * {@link VideoCallProvider}, and direct callbacks from the {@link VideoCallProvider} to the
+ * appropriate {@link VideoCall.Listener}.
+ */
+public class VideoCallImpl extends VideoCall {
+ 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;
+ private static final int MSG_CHANGE_PEER_DIMENSIONS = 4;
+ private static final int MSG_CHANGE_CALL_DATA_USAGE = 5;
+ private static final int MSG_CHANGE_CAMERA_CAPABILITIES = 6;
+
+ private final IVideoCallProvider mVideoCallProvider;
+ private final VideoCallListenerBinder mBinder;
+ private VideoCall.Listener mVideoCallListener;
+
+ private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
+ @Override
+ public void binderDied() {
+ mVideoCallProvider.asBinder().unlinkToDeath(this, 0);
+ }
+ };
+
+ /**
+ * IVideoCallCallback stub implementation.
+ */
+ private final class VideoCallListenerBinder extends IVideoCallCallback.Stub {
+ @Override
+ public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
+ mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_REQUEST,
+ videoCallProfile).sendToTarget();
+ }
+
+ @Override
+ public void receiveSessionModifyResponse(int status, VideoCallProfile requestProfile,
+ VideoCallProfile responseProfile) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = status;
+ args.arg2 = requestProfile;
+ args.arg3 = responseProfile;
+ mHandler.obtainMessage(MSG_RECEIVE_SESSION_MODIFY_RESPONSE, args).sendToTarget();
+ }
+
+ @Override
+ public void handleCallSessionEvent(int event) {
+ mHandler.obtainMessage(MSG_HANDLE_CALL_SESSION_EVENT, event).sendToTarget();
+ }
+
+ @Override
+ public void changePeerDimensions(int width, int height) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = width;
+ args.arg2 = height;
+ mHandler.obtainMessage(MSG_CHANGE_PEER_DIMENSIONS, args).sendToTarget();
+ }
+
+ @Override
+ public void changeCallDataUsage(int dataUsage) {
+ mHandler.obtainMessage(MSG_CHANGE_CALL_DATA_USAGE, dataUsage).sendToTarget();
+ }
+
+ @Override
+ public void changeCameraCapabilities(CallCameraCapabilities cameraCapabilities) {
+ mHandler.obtainMessage(MSG_CHANGE_CAMERA_CAPABILITIES,
+ cameraCapabilities).sendToTarget();
+ }
+ }
+
+ /** Default handler used to consolidate binder method calls onto a single thread. */
+ private final Handler mHandler = new Handler(Looper.getMainLooper()) {
+ @Override
+ public void handleMessage(Message msg) {
+ if (mVideoCallListener == null) {
+ return;
+ }
+
+ SomeArgs args;
+ switch (msg.what) {
+ case MSG_RECEIVE_SESSION_MODIFY_REQUEST:
+ mVideoCallListener.onSessionModifyRequestReceived((VideoCallProfile) 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;
+
+ mVideoCallListener.onSessionModifyResponseReceived(
+ status, requestProfile, responseProfile);
+ } finally {
+ args.recycle();
+ }
+ break;
+ case MSG_HANDLE_CALL_SESSION_EVENT:
+ mVideoCallListener.onCallSessionEvent((int) msg.obj);
+ break;
+ case MSG_CHANGE_PEER_DIMENSIONS:
+ args = (SomeArgs) msg.obj;
+ try {
+ int width = (int) args.arg1;
+ int height = (int) args.arg2;
+ mVideoCallListener.onPeerDimensionsChanged(width, height);
+ } finally {
+ args.recycle();
+ }
+ break;
+ case MSG_CHANGE_CALL_DATA_USAGE:
+ mVideoCallListener.onCallDataUsageChanged(msg.arg1);
+ break;
+ case MSG_CHANGE_CAMERA_CAPABILITIES:
+ mVideoCallListener.onCameraCapabilitiesChanged(
+ (CallCameraCapabilities) msg.obj);
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
+ /** {@hide} */
+ VideoCallImpl(IVideoCallProvider videoCallProvider) throws RemoteException {
+ mVideoCallProvider = videoCallProvider;
+ mVideoCallProvider.asBinder().linkToDeath(mDeathRecipient, 0);
+
+ mBinder = new VideoCallListenerBinder();
+ mVideoCallProvider.setVideoCallListener(mBinder);
+ }
+
+ /** {@inheritDoc} */
+ public void setVideoCallListener(VideoCall.Listener videoCallListener) {
+ mVideoCallListener = videoCallListener;
+ }
+
+ /** {@inheritDoc} */
+ public void setCamera(String cameraId) {
+ try {
+ mVideoCallProvider.setCamera(cameraId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void setPreviewSurface(Surface surface) {
+ try {
+ mVideoCallProvider.setPreviewSurface(surface);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void setDisplaySurface(Surface surface) {
+ try {
+ mVideoCallProvider.setDisplaySurface(surface);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void setDeviceOrientation(int rotation) {
+ try {
+ mVideoCallProvider.setDeviceOrientation(rotation);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void setZoom(float value) {
+ try {
+ mVideoCallProvider.setZoom(value);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void sendSessionModifyRequest(VideoCallProfile requestProfile) {
+ try {
+ mVideoCallProvider.sendSessionModifyRequest(requestProfile);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void sendSessionModifyResponse(VideoCallProfile responseProfile) {
+ try {
+ mVideoCallProvider.sendSessionModifyResponse(responseProfile);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void requestCameraCapabilities() {
+ try {
+ mVideoCallProvider.requestCameraCapabilities();
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void requestCallDataUsage() {
+ try {
+ mVideoCallProvider.requestCallDataUsage();
+ } catch (RemoteException e) {
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void setPauseImage(String uri) {
+ try {
+ mVideoCallProvider.setPauseImage(uri);
+ } catch (RemoteException e) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/telecomm/java/android/telecomm/CallVideoProvider.java b/telecomm/java/android/telecomm/VideoCallProvider.java
similarity index 60%
rename from telecomm/java/android/telecomm/CallVideoProvider.java
rename to telecomm/java/android/telecomm/VideoCallProvider.java
index 443a5b6..f3fec11 100644
--- a/telecomm/java/android/telecomm/CallVideoProvider.java
+++ b/telecomm/java/android/telecomm/VideoCallProvider.java
@@ -22,11 +22,11 @@
import android.os.RemoteException;
import android.view.Surface;
-import com.android.internal.telecomm.ICallVideoClient;
-import com.android.internal.telecomm.ICallVideoProvider;
+import com.android.internal.telecomm.IVideoCallCallback;
+import com.android.internal.telecomm.IVideoCallProvider;
-public abstract class CallVideoProvider {
- private static final int MSG_SET_CALL_VIDEO_CLIENT = 1;
+public abstract class VideoCallProvider {
+ private static final int MSG_SET_VIDEO_CALL_LISTENER = 1;
private static final int MSG_SET_CAMERA = 2;
private static final int MSG_SET_PREVIEW_SURFACE = 3;
private static final int MSG_SET_DISPLAY_SURFACE = 4;
@@ -38,23 +38,19 @@
private static final int MSG_REQUEST_CALL_DATA_USAGE = 10;
private static final int MSG_SET_PAUSE_IMAGE = 11;
+ private final VideoCallProviderHandler mMessageHandler = new VideoCallProviderHandler();
+ private final VideoCallProviderBinder mBinder;
+ private IVideoCallCallback mVideoCallListener;
+
/**
* Default handler used to consolidate binder method calls onto a single thread.
*/
- private final class CallVideoProviderHandler extends Handler {
+ private final class VideoCallProviderHandler extends Handler {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
- case MSG_SET_CALL_VIDEO_CLIENT:
- try {
- ICallVideoClient callVideoClient =
- ICallVideoClient.Stub.asInterface((IBinder) msg.obj);
- RemoteCallVideoClient remoteCallVideoClient =
- new RemoteCallVideoClient(callVideoClient);
- onSetCallVideoClient(remoteCallVideoClient);
- } catch (RemoteException ignored) {
- }
- break;
+ case MSG_SET_VIDEO_CALL_LISTENER:
+ mVideoCallListener = IVideoCallCallback.Stub.asInterface((IBinder) msg.obj);
case MSG_SET_CAMERA:
onSetCamera((String) msg.obj);
break;
@@ -92,12 +88,12 @@
}
/**
- * Default ICallVideoProvider implementation.
+ * IVideoCallProvider stub implementation.
*/
- private final class CallVideoProviderBinder extends ICallVideoProvider.Stub {
- public void setCallVideoClient(IBinder callVideoClientBinder) {
+ private final class VideoCallProviderBinder extends IVideoCallProvider.Stub {
+ public void setVideoCallListener(IBinder videoCallListenerBinder) {
mMessageHandler.obtainMessage(
- MSG_SET_CALL_VIDEO_CLIENT, callVideoClientBinder).sendToTarget();
+ MSG_SET_VIDEO_CALL_LISTENER, videoCallListenerBinder).sendToTarget();
}
public void setCamera(String cameraId) {
@@ -143,30 +139,19 @@
}
}
- private final CallVideoProviderHandler mMessageHandler = new CallVideoProviderHandler();
- private final CallVideoProviderBinder mBinder;
-
- public CallVideoProvider() {
- mBinder = new CallVideoProviderBinder();
+ public VideoCallProvider() {
+ mBinder = new VideoCallProviderBinder();
}
/**
* Returns binder object which can be used across IPC methods.
* @hide
*/
- public final ICallVideoProvider getInterface() {
+ public final IVideoCallProvider getInterface() {
return mBinder;
}
/**
- * Sets a remote interface for invoking callback methods in the InCallUI after performing
- * telephony actions.
- *
- * @param callVideoClient The call video client.
- */
- public abstract void onSetCallVideoClient(RemoteCallVideoClient callVideoClient);
-
- /**
* Sets the camera to be used for video recording in a video call.
*
* @param cameraId The id of the camera.
@@ -207,7 +192,7 @@
/**
* Issues a request to modify the properties of the current session. The request is sent to
* the remote device where it it handled by
- * {@link CallVideoClient#onReceiveSessionModifyRequest}.
+ * {@link InCallService.VideoCall.Listener#onSessionModifyRequestReceived}.
* Some examples of session modification requests: upgrade call from audio to video, downgrade
* call from video to audio, pause video.
*
@@ -215,13 +200,13 @@
*/
public abstract void onSendSessionModifyRequest(VideoCallProfile requestProfile);
- /**
+ /**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
- * {@link CallVideoClient#onReceiveSessionModifyRequest}.
+ * {@link InCallService.VideoCall.Listener#onSessionModifyRequestReceived}.
* The response is handled on the remove device by
- * {@link CallVideoClient#onReceiveSessionModifyResponse}.
+ * {@link InCallService.VideoCall.Listener#onSessionModifyResponseReceived}.
*
* @param responseProfile The response call video properties.
*/
@@ -230,14 +215,14 @@
/**
* Issues a request to the video provider to retrieve the camera capabilities.
* Camera capabilities are reported back to the caller via
- * {@link CallVideoClient#onHandleCameraCapabilitiesChange(CallCameraCapabilities)}.
+ * {@link InCallService.VideoCall.Listener#onCameraCapabilitiesChanged(CallCameraCapabilities)}.
*/
public abstract void onRequestCameraCapabilities();
/**
* 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 CallVideoClient#onUpdateCallDataUsage}.
+ * {@link InCallService.VideoCall.Listener#onCallDataUsageChanged}.
*/
public abstract void onRequestCallDataUsage();
@@ -248,4 +233,101 @@
* @param uri URI of image to display.
*/
public abstract void onSetPauseImage(String uri);
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param videoCallProfile The requested video call profile.
+ */
+ public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.receiveSessionModifyRequest(videoCallProfile);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param status Status of the session modify request. Valid values are
+ * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_SUCCESS},
+ * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_FAIL},
+ * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_INVALID}
+ * @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) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.receiveSessionModifyResponse(
+ status, requestedProfile, responseProfile);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * Valid values are: {@link InCallService.VideoCall#SESSION_EVENT_RX_PAUSE},
+ * {@link InCallService.VideoCall#SESSION_EVENT_RX_RESUME},
+ * {@link InCallService.VideoCall#SESSION_EVENT_TX_START},
+ * {@link InCallService.VideoCall#SESSION_EVENT_TX_STOP}
+ *
+ * @param event The event.
+ */
+ public void handleCallSessionEvent(int event) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.handleCallSessionEvent(event);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param width The updated peer video width.
+ * @param height The updated peer video height.
+ */
+ public void changePeerDimensions(int width, int height) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.changePeerDimensions(width, height);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param dataUsage The updated data usage.
+ */
+ public void changeCallDataUsage(int dataUsage) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.changeCallDataUsage(dataUsage);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param callCameraCapabilities The changed camera capabilities.
+ */
+ public void changeCameraCapabilities(CallCameraCapabilities callCameraCapabilities) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.changeCameraCapabilities(callCameraCapabilities);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
}
diff --git a/telecomm/java/com/android/internal/telecomm/ICallVideoClient.aidl b/telecomm/java/com/android/internal/telecomm/ICallVideoClient.aidl
deleted file mode 100644
index 2689561..0000000
--- a/telecomm/java/com/android/internal/telecomm/ICallVideoClient.aidl
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.internal.telecomm;
-
-import android.telecomm.CallCameraCapabilities;
-import android.telecomm.VideoCallProfile;
-
- /**
- * Internal definition of the CallVideoClient, used for an InCall-UI to respond to video telephony
- * related changes.
- *
- * @see android.telecomm.CallVideoClient
- *
- * {@hide}
- */
- oneway interface ICallVideoClient {
-
- void receiveSessionModifyRequest(in VideoCallProfile videoCallProfile);
-
- void receiveSessionModifyResponse(int status, in VideoCallProfile requestedProfile,
- in VideoCallProfile responseProfile);
-
- void handleCallSessionEvent(int event);
-
- void updatePeerDimensions(int width, int height);
-
- void updateCallDataUsage(int dataUsage);
-
- void handleCameraCapabilitiesChange(in CallCameraCapabilities callCameraCapabilities);
- }
diff --git a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
index 552993f..60b5e1e 100644
--- a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl
@@ -22,7 +22,7 @@
import android.telecomm.ParcelableConnection;
import android.telecomm.StatusHints;
-import com.android.internal.telecomm.ICallVideoProvider;
+import com.android.internal.telecomm.IVideoCallProvider;
import com.android.internal.telecomm.RemoteServiceCallback;
/**
@@ -65,7 +65,7 @@
void queryRemoteConnectionServices(RemoteServiceCallback callback);
- void setCallVideoProvider(String callId, ICallVideoProvider callVideoProvider);
+ void setVideoCallProvider(String callId, IVideoCallProvider videoCallProvider);
void setVideoState(String callId, int videoState);
diff --git a/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl b/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl
new file mode 100644
index 0000000..a71ab0a
--- /dev/null
+++ b/telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.internal.telecomm;
+
+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}
+ */
+oneway interface IVideoCallCallback {
+ 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/telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl b/telecomm/java/com/android/internal/telecomm/IVideoCallProvider.aidl
similarity index 83%
rename from telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl
rename to telecomm/java/com/android/internal/telecomm/IVideoCallProvider.aidl
index 860a431..c1ba749 100644
--- a/telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IVideoCallProvider.aidl
@@ -19,15 +19,13 @@
import android.view.Surface;
import android.telecomm.VideoCallProfile;
-import com.android.internal.telecomm.ICallVideoClient;
-
/**
- * Internal remote interface for a call video provider.
- * @see android.telecomm.CallVideoProvider
+ * Internal remote interface for a video call provider.
+ * @see android.telecomm.VideoCallProvider
* @hide
*/
-oneway interface ICallVideoProvider {
- void setCallVideoClient(IBinder callVideoClient);
+oneway interface IVideoCallProvider {
+ void setVideoCallListener(IBinder videoCallListenerBinder);
void setCamera(String cameraId);