Support for multiple VideoCall.Listeners for a VideoCall.
The current code assumes that only a single instance of VideoCall will be provided to the default system InCall UI. Ideally multiple InCallService implementations should be able to use the VideoCall APIs. Note: it only really makes sense for a single InCallService to get/set the video surfaces. - Fixed bug in ParcelableCall which would cause a new instance of VideoCallImpl to be created every time a call is updated from Telecom. Added a flag to ParcelableCall to indicate whether the parcel includes a change to the video provider information, which is used when unparceling to determine whether to set/create the video call impl. - Renamed "setVideoCallback" to "addVideocallback". - Modified Connection.VideoProvider code to keep a list of Video callbacks and fire off all of them when Video Provider changes occur. Bug: 20092420 Change-Id: Ic16b6afe1b7532cc64d006c133adbae57946d97d
This commit is contained in:
@@ -903,7 +903,8 @@ public final class Call {
|
|||||||
Collections.unmodifiableList(parcelableCall.getCannedSmsResponses());
|
Collections.unmodifiableList(parcelableCall.getCannedSmsResponses());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean videoCallChanged = !Objects.equals(mVideoCall, parcelableCall.getVideoCall());
|
boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() &&
|
||||||
|
!Objects.equals(mVideoCall, parcelableCall.getVideoCall());
|
||||||
if (videoCallChanged) {
|
if (videoCallChanged) {
|
||||||
mVideoCall = parcelableCall.getVideoCall();
|
mVideoCall = parcelableCall.getVideoCall();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import android.view.Surface;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@@ -445,7 +446,7 @@ public abstract class Connection implements IConferenceable {
|
|||||||
*/
|
*/
|
||||||
public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5;
|
public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE = 5;
|
||||||
|
|
||||||
private static final int MSG_SET_VIDEO_CALLBACK = 1;
|
private static final int MSG_ADD_VIDEO_CALLBACK = 1;
|
||||||
private static final int MSG_SET_CAMERA = 2;
|
private static final int MSG_SET_CAMERA = 2;
|
||||||
private static final int MSG_SET_PREVIEW_SURFACE = 3;
|
private static final int MSG_SET_PREVIEW_SURFACE = 3;
|
||||||
private static final int MSG_SET_DISPLAY_SURFACE = 4;
|
private static final int MSG_SET_DISPLAY_SURFACE = 4;
|
||||||
@@ -456,11 +457,16 @@ public abstract class Connection implements IConferenceable {
|
|||||||
private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9;
|
private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9;
|
||||||
private static final int MSG_REQUEST_CONNECTION_DATA_USAGE = 10;
|
private static final int MSG_REQUEST_CONNECTION_DATA_USAGE = 10;
|
||||||
private static final int MSG_SET_PAUSE_IMAGE = 11;
|
private static final int MSG_SET_PAUSE_IMAGE = 11;
|
||||||
|
private static final int MSG_REMOVE_VIDEO_CALLBACK = 12;
|
||||||
|
|
||||||
private final VideoProvider.VideoProviderHandler
|
private final VideoProvider.VideoProviderHandler
|
||||||
mMessageHandler = new VideoProvider.VideoProviderHandler();
|
mMessageHandler = new VideoProvider.VideoProviderHandler();
|
||||||
private final VideoProvider.VideoProviderBinder mBinder;
|
private final VideoProvider.VideoProviderBinder mBinder;
|
||||||
private IVideoCallback mVideoCallback;
|
|
||||||
|
/**
|
||||||
|
* Stores a list of the video callbacks, keyed by IBinder.
|
||||||
|
*/
|
||||||
|
private HashMap<IBinder, IVideoCallback> mVideoCallbacks = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default handler used to consolidate binder method calls onto a single thread.
|
* Default handler used to consolidate binder method calls onto a single thread.
|
||||||
@@ -469,9 +475,29 @@ public abstract class Connection implements IConferenceable {
|
|||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case MSG_SET_VIDEO_CALLBACK:
|
case MSG_ADD_VIDEO_CALLBACK: {
|
||||||
mVideoCallback = IVideoCallback.Stub.asInterface((IBinder) msg.obj);
|
IBinder binder = (IBinder) msg.obj;
|
||||||
|
IVideoCallback callback = IVideoCallback.Stub
|
||||||
|
.asInterface((IBinder) msg.obj);
|
||||||
|
if (mVideoCallbacks.containsKey(binder)) {
|
||||||
|
Log.i(this, "addVideoProvider - skipped; already present.");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
mVideoCallbacks.put(binder, callback);
|
||||||
|
Log.i(this, "addVideoProvider "+ mVideoCallbacks.size());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MSG_REMOVE_VIDEO_CALLBACK: {
|
||||||
|
IBinder binder = (IBinder) msg.obj;
|
||||||
|
IVideoCallback callback = IVideoCallback.Stub
|
||||||
|
.asInterface((IBinder) msg.obj);
|
||||||
|
if (!mVideoCallbacks.containsKey(binder)) {
|
||||||
|
Log.i(this, "removeVideoProvider - skipped; not present.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
mVideoCallbacks.remove(binder);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MSG_SET_CAMERA:
|
case MSG_SET_CAMERA:
|
||||||
onSetCamera((String) msg.obj);
|
onSetCamera((String) msg.obj);
|
||||||
break;
|
break;
|
||||||
@@ -512,9 +538,14 @@ public abstract class Connection implements IConferenceable {
|
|||||||
* IVideoProvider stub implementation.
|
* IVideoProvider stub implementation.
|
||||||
*/
|
*/
|
||||||
private final class VideoProviderBinder extends IVideoProvider.Stub {
|
private final class VideoProviderBinder extends IVideoProvider.Stub {
|
||||||
public void setVideoCallback(IBinder videoCallbackBinder) {
|
public void addVideoCallback(IBinder videoCallbackBinder) {
|
||||||
mMessageHandler.obtainMessage(
|
mMessageHandler.obtainMessage(
|
||||||
MSG_SET_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget();
|
MSG_ADD_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeVideoCallback(IBinder videoCallbackBinder) {
|
||||||
|
mMessageHandler.obtainMessage(
|
||||||
|
MSG_REMOVE_VIDEO_CALLBACK, videoCallbackBinder).sendToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCamera(String cameraId) {
|
public void setCamera(String cameraId) {
|
||||||
@@ -652,21 +683,23 @@ public abstract class Connection implements IConferenceable {
|
|||||||
public abstract void onSetPauseImage(String uri);
|
public abstract void onSetPauseImage(String uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* @param videoProfile The requested video connection profile.
|
* @param videoProfile The requested video connection profile.
|
||||||
*/
|
*/
|
||||||
public void receiveSessionModifyRequest(VideoProfile videoProfile) {
|
public void receiveSessionModifyRequest(VideoProfile videoProfile) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.receiveSessionModifyRequest(videoProfile);
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
|
callback.receiveSessionModifyRequest(videoProfile);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* @param status Status of the session modify request. Valid values are
|
* @param status Status of the session modify request. Valid values are
|
||||||
* {@link VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS},
|
* {@link VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS},
|
||||||
@@ -677,17 +710,19 @@ public abstract class Connection implements IConferenceable {
|
|||||||
*/
|
*/
|
||||||
public void receiveSessionModifyResponse(int status,
|
public void receiveSessionModifyResponse(int status,
|
||||||
VideoProfile requestedProfile, VideoProfile responseProfile) {
|
VideoProfile requestedProfile, VideoProfile responseProfile) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.receiveSessionModifyResponse(
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
status, requestedProfile, responseProfile);
|
callback.receiveSessionModifyResponse(status, requestedProfile,
|
||||||
|
responseProfile);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* Valid values are: {@link VideoProvider#SESSION_EVENT_RX_PAUSE},
|
* Valid values are: {@link VideoProvider#SESSION_EVENT_RX_PAUSE},
|
||||||
* {@link VideoProvider#SESSION_EVENT_RX_RESUME},
|
* {@link VideoProvider#SESSION_EVENT_RX_RESUME},
|
||||||
@@ -697,66 +732,76 @@ public abstract class Connection implements IConferenceable {
|
|||||||
* @param event The event.
|
* @param event The event.
|
||||||
*/
|
*/
|
||||||
public void handleCallSessionEvent(int event) {
|
public void handleCallSessionEvent(int event) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.handleCallSessionEvent(event);
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
|
callback.handleCallSessionEvent(event);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* @param width The updated peer video width.
|
* @param width The updated peer video width.
|
||||||
* @param height The updated peer video height.
|
* @param height The updated peer video height.
|
||||||
*/
|
*/
|
||||||
public void changePeerDimensions(int width, int height) {
|
public void changePeerDimensions(int width, int height) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.changePeerDimensions(width, height);
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
|
callback.changePeerDimensions(width, height);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* @param dataUsage The updated data usage.
|
* @param dataUsage The updated data usage.
|
||||||
*/
|
*/
|
||||||
public void changeCallDataUsage(long dataUsage) {
|
public void changeCallDataUsage(long dataUsage) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.changeCallDataUsage(dataUsage);
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
|
callback.changeCallDataUsage(dataUsage);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* @param cameraCapabilities The changed camera capabilities.
|
* @param cameraCapabilities The changed camera capabilities.
|
||||||
*/
|
*/
|
||||||
public void changeCameraCapabilities(CameraCapabilities cameraCapabilities) {
|
public void changeCameraCapabilities(CameraCapabilities cameraCapabilities) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.changeCameraCapabilities(cameraCapabilities);
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
|
callback.changeCameraCapabilities(cameraCapabilities);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes callback method defined in In-Call UI.
|
* Invokes callback method defined in listening {@link InCallService} implementations.
|
||||||
*
|
*
|
||||||
* @param videoQuality The updated video quality.
|
* @param videoQuality The updated video quality.
|
||||||
*/
|
*/
|
||||||
public void changeVideoQuality(int videoQuality) {
|
public void changeVideoQuality(int videoQuality) {
|
||||||
if (mVideoCallback != null) {
|
if (mVideoCallbacks != null) {
|
||||||
try {
|
try {
|
||||||
mVideoCallback.changeVideoQuality(videoQuality);
|
for (IVideoCallback callback : mVideoCallbacks.values()) {
|
||||||
|
callback.changeVideoQuality(videoQuality);
|
||||||
|
}
|
||||||
} catch (RemoteException ignored) {
|
} catch (RemoteException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,6 +212,11 @@ public abstract class InCallService extends Service {
|
|||||||
*/
|
*/
|
||||||
public abstract void setVideoCallListener(VideoCall.Listener videoCallListener);
|
public abstract void setVideoCallListener(VideoCall.Listener videoCallListener);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the video call listener set via {@link #setVideoCallListener(Listener)}.
|
||||||
|
*/
|
||||||
|
public abstract void removeVideoCallListener();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the camera to be used for video recording in a video call.
|
* Sets the camera to be used for video recording in a video call.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
private final int mCallerDisplayNamePresentation;
|
private final int mCallerDisplayNamePresentation;
|
||||||
private final GatewayInfo mGatewayInfo;
|
private final GatewayInfo mGatewayInfo;
|
||||||
private final PhoneAccountHandle mAccountHandle;
|
private final PhoneAccountHandle mAccountHandle;
|
||||||
|
private final boolean mIsVideoCallProviderChanged;
|
||||||
private final IVideoProvider mVideoCallProvider;
|
private final IVideoProvider mVideoCallProvider;
|
||||||
private InCallService.VideoCall mVideoCall;
|
private InCallService.VideoCall mVideoCall;
|
||||||
private final String mParentCallId;
|
private final String mParentCallId;
|
||||||
@@ -70,6 +71,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
int callerDisplayNamePresentation,
|
int callerDisplayNamePresentation,
|
||||||
GatewayInfo gatewayInfo,
|
GatewayInfo gatewayInfo,
|
||||||
PhoneAccountHandle accountHandle,
|
PhoneAccountHandle accountHandle,
|
||||||
|
boolean isVideoCallProviderChanged,
|
||||||
IVideoProvider videoCallProvider,
|
IVideoProvider videoCallProvider,
|
||||||
String parentCallId,
|
String parentCallId,
|
||||||
List<String> childCallIds,
|
List<String> childCallIds,
|
||||||
@@ -91,6 +93,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
mCallerDisplayNamePresentation = callerDisplayNamePresentation;
|
mCallerDisplayNamePresentation = callerDisplayNamePresentation;
|
||||||
mGatewayInfo = gatewayInfo;
|
mGatewayInfo = gatewayInfo;
|
||||||
mAccountHandle = accountHandle;
|
mAccountHandle = accountHandle;
|
||||||
|
mIsVideoCallProviderChanged = isVideoCallProviderChanged;
|
||||||
mVideoCallProvider = videoCallProvider;
|
mVideoCallProvider = videoCallProvider;
|
||||||
mParentCallId = parentCallId;
|
mParentCallId = parentCallId;
|
||||||
mChildCallIds = childCallIds;
|
mChildCallIds = childCallIds;
|
||||||
@@ -243,6 +246,18 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
return mCallSubstate;
|
return mCallSubstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the
|
||||||
|
* {@link android.telecom.InCallService.VideoCall} associated with this call. Since
|
||||||
|
* {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether
|
||||||
|
* the provider has changed (which can influence whether it is accessed).
|
||||||
|
*
|
||||||
|
* @return {@code true} if the video call changed, {@code false} otherwise.
|
||||||
|
*/
|
||||||
|
public boolean isVideoCallProviderChanged() {
|
||||||
|
return mIsVideoCallProviderChanged;
|
||||||
|
}
|
||||||
|
|
||||||
/** Responsible for creating ParcelableCall objects for deserialized Parcels. */
|
/** Responsible for creating ParcelableCall objects for deserialized Parcels. */
|
||||||
public static final Parcelable.Creator<ParcelableCall> CREATOR =
|
public static final Parcelable.Creator<ParcelableCall> CREATOR =
|
||||||
new Parcelable.Creator<ParcelableCall> () {
|
new Parcelable.Creator<ParcelableCall> () {
|
||||||
@@ -263,6 +278,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
int callerDisplayNamePresentation = source.readInt();
|
int callerDisplayNamePresentation = source.readInt();
|
||||||
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
|
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
|
||||||
PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
|
PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
|
||||||
|
boolean isVideoCallProviderChanged = source.readByte() == 1;
|
||||||
IVideoProvider videoCallProvider =
|
IVideoProvider videoCallProvider =
|
||||||
IVideoProvider.Stub.asInterface(source.readStrongBinder());
|
IVideoProvider.Stub.asInterface(source.readStrongBinder());
|
||||||
String parentCallId = source.readString();
|
String parentCallId = source.readString();
|
||||||
@@ -288,6 +304,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
callerDisplayNamePresentation,
|
callerDisplayNamePresentation,
|
||||||
gatewayInfo,
|
gatewayInfo,
|
||||||
accountHandle,
|
accountHandle,
|
||||||
|
isVideoCallProviderChanged,
|
||||||
videoCallProvider,
|
videoCallProvider,
|
||||||
parentCallId,
|
parentCallId,
|
||||||
childCallIds,
|
childCallIds,
|
||||||
@@ -326,6 +343,7 @@ public final class ParcelableCall implements Parcelable {
|
|||||||
destination.writeInt(mCallerDisplayNamePresentation);
|
destination.writeInt(mCallerDisplayNamePresentation);
|
||||||
destination.writeParcelable(mGatewayInfo, 0);
|
destination.writeParcelable(mGatewayInfo, 0);
|
||||||
destination.writeParcelable(mAccountHandle, 0);
|
destination.writeParcelable(mAccountHandle, 0);
|
||||||
|
destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0));
|
||||||
destination.writeStrongBinder(
|
destination.writeStrongBinder(
|
||||||
mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
|
mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
|
||||||
destination.writeString(mParentCallId);
|
destination.writeString(mParentCallId);
|
||||||
|
|||||||
@@ -119,6 +119,11 @@ public final class Phone {
|
|||||||
final void internalRemoveCall(Call call) {
|
final void internalRemoveCall(Call call) {
|
||||||
mCallByTelecomCallId.remove(call.internalGetCallId());
|
mCallByTelecomCallId.remove(call.internalGetCallId());
|
||||||
mCalls.remove(call);
|
mCalls.remove(call);
|
||||||
|
|
||||||
|
InCallService.VideoCall videoCall = call.getVideoCall();
|
||||||
|
if (videoCall != null) {
|
||||||
|
videoCall.removeVideoCallListener();
|
||||||
|
}
|
||||||
fireCallRemoved(call);
|
fireCallRemoved(call);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,6 +176,10 @@ public final class Phone {
|
|||||||
*/
|
*/
|
||||||
final void destroy() {
|
final void destroy() {
|
||||||
for (Call call : mCalls) {
|
for (Call call : mCalls) {
|
||||||
|
InCallService.VideoCall videoCall = call.getVideoCall();
|
||||||
|
if (videoCall != null) {
|
||||||
|
videoCall.removeVideoCallListener();
|
||||||
|
}
|
||||||
if (call.getState() != Call.STATE_DISCONNECTED) {
|
if (call.getState() != Call.STATE_DISCONNECTED) {
|
||||||
call.internalSetDisconnected();
|
call.internalSetDisconnected();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ public final class RemoteConnection {
|
|||||||
public VideoProvider(IVideoProvider videoProviderBinder) {
|
public VideoProvider(IVideoProvider videoProviderBinder) {
|
||||||
mVideoProviderBinder = videoProviderBinder;
|
mVideoProviderBinder = videoProviderBinder;
|
||||||
try {
|
try {
|
||||||
mVideoProviderBinder.setVideoCallback(mVideoCallbackServant.getStub().asBinder());
|
mVideoProviderBinder.addVideoCallback(mVideoCallbackServant.getStub().asBinder());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class VideoCallImpl extends VideoCall {
|
|||||||
mVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0);
|
mVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0);
|
||||||
|
|
||||||
mBinder = new VideoCallListenerBinder();
|
mBinder = new VideoCallListenerBinder();
|
||||||
mVideoProvider.setVideoCallback(mBinder);
|
mVideoProvider.addVideoCallback(mBinder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@@ -174,6 +174,15 @@ public class VideoCallImpl extends VideoCall {
|
|||||||
mVideoCallListener = videoCallListener;
|
mVideoCallListener = videoCallListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
public void removeVideoCallListener() {
|
||||||
|
mVideoCallListener = null;
|
||||||
|
try {
|
||||||
|
mVideoProvider.removeVideoCallback(mBinder);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public void setCamera(String cameraId) {
|
public void setCamera(String cameraId) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ import android.telecom.VideoProfile;
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
oneway interface IVideoProvider {
|
oneway interface IVideoProvider {
|
||||||
void setVideoCallback(IBinder videoCallbackBinder);
|
void addVideoCallback(IBinder videoCallbackBinder);
|
||||||
|
|
||||||
|
void removeVideoCallback(IBinder videoCallbackBinder);
|
||||||
|
|
||||||
void setCamera(String cameraId);
|
void setCamera(String cameraId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user