summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-06-12 14:31:25 -0700
committerTyler Gunn <tgunn@google.com>2015-06-12 14:31:25 -0700
commit86014fcf9ec86e198a1ebac7c46e0e5c630735d7 (patch)
tree5d2b14f39d536a1e596f8c2f60e0912b20c7436d /src/com/android
parentfb598636c5e8802f565e305b068b5e991aaeaeb1 (diff)
downloadandroid_packages_services_Telecomm-86014fcf9ec86e198a1ebac7c46e0e5c630735d7.tar.gz
android_packages_services_Telecomm-86014fcf9ec86e198a1ebac7c46e0e5c630735d7.tar.bz2
android_packages_services_Telecomm-86014fcf9ec86e198a1ebac7c46e0e5c630735d7.zip
Play tone when video upgrade request is received.
Added a VideoProviderProxy which intermediates between the VideoProvider in the ConnectionService and the InCallService. Changed CallsManager to listen for session modification requests via the VideoProviderProxy and report these to its listeners via the CallsManagerListeberBase. Changed InCallToneMonitor to listen for session modification requests and to play a tone when a request to upgrade is received. Also, added an intent in the TestInCallService which I neglected to commit in a previous CL. Bug: 20232310 Change-Id: I1b105968f519ff6b166bbd02cb57b1cf68d2cea9
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/server/telecom/Call.java31
-rw-r--r--src/com/android/server/telecom/CallsManager.java42
-rw-r--r--src/com/android/server/telecom/CallsManagerListenerBase.java6
-rw-r--r--src/com/android/server/telecom/InCallToneMonitor.java34
-rw-r--r--src/com/android/server/telecom/InCallTonePlayer.java7
-rw-r--r--src/com/android/server/telecom/VideoProviderProxy.java440
6 files changed, 557 insertions, 3 deletions
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index da9da22b..c9b9ef1e 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -23,11 +23,13 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
+import android.os.RemoteException;
import android.os.Trace;
import android.provider.ContactsContract.Contacts;
import android.telecom.DisconnectCause;
import android.telecom.Connection;
import android.telecom.GatewayInfo;
+import android.telecom.InCallService.VideoCall;
import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
@@ -306,6 +308,7 @@ public class Call implements CreateConnectionResponse {
private boolean mCannedSmsResponsesLoadingStarted = false;
private IVideoProvider mVideoProvider;
+ private VideoProviderProxy mVideoProviderProxy;
private boolean mIsVoipAudioMode;
private StatusHints mStatusHints;
@@ -1466,17 +1469,41 @@ public class Call implements CreateConnectionResponse {
* Sets a video call provider for the call.
*/
public void setVideoProvider(IVideoProvider videoProvider) {
+ Log.v(this, "setVideoProvider");
+
+ if (videoProvider != null ) {
+ try {
+ mVideoProviderProxy = new VideoProviderProxy(mLock, videoProvider, this);
+ } catch (RemoteException ignored) {
+ // Ignore RemoteException.
+ }
+ } else {
+ mVideoProviderProxy = null;
+ }
+
mVideoProvider = videoProvider;
+
for (Listener l : mListeners) {
l.onVideoCallProviderChanged(Call.this);
}
}
/**
- * @return Return the {@link Connection.VideoProvider} binder.
+ * @return The {@link Connection.VideoProvider} binder.
*/
public IVideoProvider getVideoProvider() {
- return mVideoProvider;
+ if (mVideoProviderProxy == null) {
+ return null;
+ }
+
+ return mVideoProviderProxy.getInterface();
+ }
+
+ /**
+ * @return The {@link VideoProviderProxy} for this call.
+ */
+ public VideoProviderProxy getVideoProviderProxy() {
+ return mVideoProviderProxy;
}
/**
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 72836486..6a473a20 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -59,7 +59,7 @@ import java.util.concurrent.ConcurrentHashMap;
* beyond the com.android.server.telecom package boundary.
*/
@VisibleForTesting
-public class CallsManager extends Call.ListenerBase {
+public class CallsManager extends Call.ListenerBase implements VideoProviderProxy.Listener {
// TODO: Consider renaming this CallsManagerPlugin.
interface CallsManagerListener {
@@ -79,6 +79,7 @@ public class CallsManager extends Call.ListenerBase {
void onIsVoipAudioModeChanged(Call call);
void onVideoStateChanged(Call call);
void onCanAddCallChanged(boolean canAddCall);
+ void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile);
}
private static final String TAG = "CallsManager";
@@ -372,6 +373,45 @@ public class CallsManager extends Call.ListenerBase {
return true;
}
+ /**
+ * Handles changes to the {@link Connection.VideoProvider} for a call. Adds the
+ * {@link CallsManager} as a listener for the {@link VideoProviderProxy} which is created
+ * in {@link Call#setVideoProvider(IVideoProvider)}. This allows the {@link CallsManager} to
+ * respond to callbacks from the {@link VideoProviderProxy}.
+ *
+ * @param call The call.
+ */
+ @Override
+ public void onVideoCallProviderChanged(Call call) {
+ VideoProviderProxy videoProviderProxy = call.getVideoProviderProxy();
+
+ if (videoProviderProxy == null) {
+ return;
+ }
+
+ videoProviderProxy.addListener(this);
+ }
+
+ /**
+ * Handles session modification requests received via the {@link TelecomVideoCallCallback} for
+ * a call. Notifies listeners of the {@link CallsManager.CallsManagerListener} of the session
+ * modification request.
+ *
+ * @param call The call.
+ * @param videoProfile The {@link VideoProfile}.
+ */
+ @Override
+ public void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile) {
+ int videoState = videoProfile != null ? videoProfile.getVideoState() :
+ VideoProfile.STATE_AUDIO_ONLY;
+ Log.v(TAG, "onSessionModifyRequestReceived : videoProfile = " + VideoProfile
+ .videoStateToString(videoState));
+
+ for (CallsManagerListener listener : mListeners) {
+ listener.onSessionModifyRequestReceived(call, videoProfile);
+ }
+ }
+
Collection<Call> getCalls() {
return Collections.unmodifiableCollection(mCalls);
}
diff --git a/src/com/android/server/telecom/CallsManagerListenerBase.java b/src/com/android/server/telecom/CallsManagerListenerBase.java
index 129f9ae8..58085a0c 100644
--- a/src/com/android/server/telecom/CallsManagerListenerBase.java
+++ b/src/com/android/server/telecom/CallsManagerListenerBase.java
@@ -18,6 +18,7 @@ package com.android.server.telecom;
import android.telecom.AudioState;
import android.telecom.CallAudioState;
+import android.telecom.VideoProfile;
/**
* Provides a default implementation for listeners of CallsManager.
@@ -78,4 +79,9 @@ public class CallsManagerListenerBase implements CallsManager.CallsManagerListen
@Override
public void onCanAddCallChanged(boolean canAddCall) {
}
+
+ @Override
+ public void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile) {
+
+ }
}
diff --git a/src/com/android/server/telecom/InCallToneMonitor.java b/src/com/android/server/telecom/InCallToneMonitor.java
index e25d2073..afe0f069 100644
--- a/src/com/android/server/telecom/InCallToneMonitor.java
+++ b/src/com/android/server/telecom/InCallToneMonitor.java
@@ -17,6 +17,8 @@
package com.android.server.telecom;
import android.media.ToneGenerator;
+import android.telecom.Connection;
+import android.telecom.VideoProfile;
import java.util.Collection;
@@ -77,4 +79,36 @@ public final class InCallToneMonitor extends CallsManagerListenerBase {
}
}
}
+
+ /**
+ * Handles requests received via the {@link VideoProviderProxy} requesting a change in the video
+ * state of the call by the peer. If the request involves the peer turning their camera on,
+ * the call waiting tone is played to inform the user of the incoming request.
+ *
+ * @param call The call.
+ * @param videoProfile The requested video profile.
+ */
+ @Override
+ public void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile) {
+ if (videoProfile == null) {
+ return;
+ }
+
+ if (mCallsManager.getForegroundCall() != call) {
+ // We only play tones for foreground calls.
+ return;
+ }
+
+ int previousVideoState = call.getVideoState();
+ int newVideoState = videoProfile.getVideoState();
+ Log.v(this, "onSessionModifyRequestReceived : videoProfile = " + VideoProfile
+ .videoStateToString(newVideoState));
+
+ boolean isUpgradeRequest = !VideoProfile.isReceptionEnabled(previousVideoState) &&
+ VideoProfile.isReceptionEnabled(newVideoState);
+
+ if (isUpgradeRequest) {
+ mPlayerFactory.createPlayer(InCallTonePlayer.TONE_VIDEO_UPGRADE).startTone();
+ }
+ }
}
diff --git a/src/com/android/server/telecom/InCallTonePlayer.java b/src/com/android/server/telecom/InCallTonePlayer.java
index f51a6396..0d2e3c4f 100644
--- a/src/com/android/server/telecom/InCallTonePlayer.java
+++ b/src/com/android/server/telecom/InCallTonePlayer.java
@@ -60,6 +60,7 @@ public final class InCallTonePlayer extends Thread {
public static final int TONE_RING_BACK = 11;
public static final int TONE_UNOBTAINABLE_NUMBER = 12;
public static final int TONE_VOICE_PRIVACY = 13;
+ public static final int TONE_VIDEO_UPGRADE = 14;
private static final int RELATIVE_VOLUME_EMERGENCY = 100;
private static final int RELATIVE_VOLUME_HIPRI = 80;
@@ -183,6 +184,12 @@ public final class InCallTonePlayer extends Thread {
case TONE_VOICE_PRIVACY:
// TODO: fill in.
throw new IllegalStateException("Voice privacy tone NYI.");
+ case TONE_VIDEO_UPGRADE:
+ // Similar to the call waiting tone, but does not repeat.
+ toneType = ToneGenerator.TONE_SUP_CALL_WAITING;
+ toneVolume = RELATIVE_VOLUME_HIPRI;
+ toneLengthMillis = 4000;
+ break;
default:
throw new IllegalStateException("Bad toneId: " + mToneId);
}
diff --git a/src/com/android/server/telecom/VideoProviderProxy.java b/src/com/android/server/telecom/VideoProviderProxy.java
new file mode 100644
index 00000000..7dcfdfbd
--- /dev/null
+++ b/src/com/android/server/telecom/VideoProviderProxy.java
@@ -0,0 +1,440 @@
+/*
+ * Copyright (C) 2015 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.server.telecom;
+
+import android.net.Uri;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.RemoteException;
+import android.telecom.Connection;
+import android.telecom.InCallService;
+import android.telecom.VideoProfile;
+import android.view.Surface;
+
+import com.android.internal.telecom.IVideoCallback;
+import com.android.internal.telecom.IVideoProvider;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Proxies video provider messages from {@link InCallService.VideoCall}
+ * implementations to the underlying {@link Connection.VideoProvider} implementation. Also proxies
+ * callbacks from the {@link Connection.VideoProvider} to {@link InCallService.VideoCall}
+ * implementations.
+ *
+ * Also provides a means for Telecom to send and receive these messages.
+ */
+public class VideoProviderProxy extends Connection.VideoProvider {
+
+ /**
+ * Listener for Telecom components interested in callbacks from the video provider.
+ */
+ interface Listener {
+ void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile);
+ }
+
+ /**
+ * Set of listeners on this VideoProviderProxy.
+ *
+ * ConcurrentHashMap constructor params: 8 is initial table size, 0.9f is
+ * load factor before resizing, 1 means we only expect a single thread to
+ * access the map so make only a single shard
+ */
+ private final Set<Listener> mListeners = Collections.newSetFromMap(
+ new ConcurrentHashMap<Listener, Boolean>(8, 0.9f, 1));
+
+ /** The TelecomSystem SyncRoot used for synchronized operations. */
+ private final TelecomSystem.SyncRoot mLock;
+
+ /**
+ * The {@link android.telecom.Connection.VideoProvider} implementation residing with the
+ * {@link android.telecom.ConnectionService} which is being wrapped by this
+ * {@link VideoProviderProxy}.
+ */
+ private final IVideoProvider mConectionServiceVideoProvider;
+
+ /**
+ * Binder used to bind to the {@link android.telecom.ConnectionService}'s
+ * {@link com.android.internal.telecom.IVideoCallback}.
+ */
+ private final VideoCallListenerBinder mVideoCallListenerBinder;
+
+ /**
+ * The Telecom {@link Call} this {@link VideoProviderProxy} is associated with.
+ */
+ private Call mCall;
+
+ private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
+ @Override
+ public void binderDied() {
+ mConectionServiceVideoProvider.asBinder().unlinkToDeath(this, 0);
+ }
+ };
+
+ /**
+ * Creates a new instance of the {@link VideoProviderProxy}, binding it to the passed in
+ * {@code videoProvider} residing with the {@link android.telecom.ConnectionService}.
+ *
+ *
+ * @param lock
+ * @param videoProvider The {@link android.telecom.ConnectionService}'s video provider.
+ * @param call The current call.
+ * @throws RemoteException Remote exception.
+ */
+ VideoProviderProxy(TelecomSystem.SyncRoot lock,
+ IVideoProvider videoProvider, Call call) throws RemoteException {
+
+ super(Looper.getMainLooper());
+
+ mLock = lock;
+
+ mConectionServiceVideoProvider = videoProvider;
+ mConectionServiceVideoProvider.asBinder().linkToDeath(mDeathRecipient, 0);
+
+ mVideoCallListenerBinder = new VideoCallListenerBinder();
+ mConectionServiceVideoProvider.addVideoCallback(mVideoCallListenerBinder);
+ mCall = call;
+ }
+
+ /**
+ * IVideoCallback stub implementation. An instance of this class receives callbacks from the
+ * {@code ConnectionService}'s video provider.
+ */
+ private final class VideoCallListenerBinder extends IVideoCallback.Stub {
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when a session modification request is received.
+ *
+ * @param videoProfile The requested video profile.
+ */
+ @Override
+ public void receiveSessionModifyRequest(VideoProfile videoProfile) {
+ synchronized (mLock) {
+ logFromVideoProvider("receiveSessionModifyRequest: " + videoProfile);
+
+ // Inform other Telecom components of the session modification request.
+ for (Listener listener : mListeners) {
+ listener.onSessionModifyRequestReceived(mCall, videoProfile);
+ }
+
+ VideoProviderProxy.this.receiveSessionModifyRequest(videoProfile);
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when a session modification response is received.
+ *
+ * @param status The status of the response.
+ * @param requestProfile The requested video profile.
+ * @param responseProfile The response video profile.
+ */
+ @Override
+ public void receiveSessionModifyResponse(int status, VideoProfile requestProfile,
+ VideoProfile responseProfile) {
+ synchronized (mLock) {
+ logFromVideoProvider("receiveSessionModifyResponse: status=" + status +
+ " requestProfile=" + requestProfile + " responseProfile=" +
+ responseProfile);
+ VideoProviderProxy.this.receiveSessionModifyResponse(status, requestProfile,
+ responseProfile);
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when a call session event occurs.
+ *
+ * @param event The call session event.
+ */
+ @Override
+ public void handleCallSessionEvent(int event) {
+ synchronized (mLock) {
+ logFromVideoProvider("handleCallSessionEvent: " + event);
+ VideoProviderProxy.this.handleCallSessionEvent(event);
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when the peer dimensions change.
+ *
+ * @param width The width of the peer's video.
+ * @param height The height of the peer's video.
+ */
+ @Override
+ public void changePeerDimensions(int width, int height) {
+ synchronized (mLock) {
+ logFromVideoProvider("changePeerDimensions: width=" + width + " height=" +
+ height);
+ VideoProviderProxy.this.changePeerDimensions(width, height);
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when the video quality changes.
+ *
+ * @param videoQuality The video quality.
+ */
+ @Override
+ public void changeVideoQuality(int videoQuality) {
+ synchronized (mLock) {
+ logFromVideoProvider("changeVideoQuality: " + videoQuality);
+ VideoProviderProxy.this.changeVideoQuality(videoQuality);
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when the call data usage changes.
+ *
+ * @param dataUsage The data usage.
+ */
+ @Override
+ public void changeCallDataUsage(long dataUsage) {
+ synchronized (mLock) {
+ logFromVideoProvider("changeCallDataUsage: " + dataUsage);
+ VideoProviderProxy.this.setCallDataUsage(dataUsage);
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link #mConectionServiceVideoProvider} to the
+ * {@link InCallService} when the camera capabilities change.
+ *
+ * @param cameraCapabilities The camera capabilities.
+ */
+ @Override
+ public void changeCameraCapabilities(VideoProfile.CameraCapabilities cameraCapabilities) {
+ synchronized (mLock) {
+ logFromVideoProvider("changeCameraCapabilities: " + cameraCapabilities);
+ VideoProviderProxy.this.changeCameraCapabilities(cameraCapabilities);
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to change the camera.
+ *
+ * @param cameraId The id of the camera.
+ */
+ @Override
+ public void onSetCamera(String cameraId) {
+ synchronized (mLock) {
+ logFromInCall("setCamera: " + cameraId);
+ try {
+ mConectionServiceVideoProvider.setCamera(cameraId);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to set the preview surface.
+ *
+ * @param surface The surface.
+ */
+ @Override
+ public void onSetPreviewSurface(Surface surface) {
+ synchronized (mLock) {
+ logFromInCall("setPreviewSurface");
+ try {
+ mConectionServiceVideoProvider.setPreviewSurface(surface);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to change the display surface.
+ *
+ * @param surface The surface.
+ */
+ @Override
+ public void onSetDisplaySurface(Surface surface) {
+ synchronized (mLock) {
+ logFromInCall("setDisplaySurface");
+ try {
+ mConectionServiceVideoProvider.setDisplaySurface(surface);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to change the device orientation.
+ *
+ * @param rotation The device orientation, in degrees.
+ */
+ @Override
+ public void onSetDeviceOrientation(int rotation) {
+ synchronized (mLock) {
+ logFromInCall("setDeviceOrientation: " + rotation);
+ try {
+ mConectionServiceVideoProvider.setDeviceOrientation(rotation);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to change the camera zoom ratio.
+ *
+ * @param value The camera zoom ratio.
+ */
+ @Override
+ public void onSetZoom(float value) {
+ synchronized (mLock) {
+ logFromInCall("setZoom: " + value);
+ try {
+ mConectionServiceVideoProvider.setZoom(value);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to provide a response to a session modification
+ * request.
+ *
+ * @param fromProfile The video properties prior to the request.
+ * @param toProfile The video properties with the requested changes made.
+ */
+ @Override
+ public void onSendSessionModifyRequest(VideoProfile fromProfile, VideoProfile toProfile) {
+ synchronized (mLock) {
+ logFromInCall("sendSessionModifyRequest: from=" + fromProfile + " to=" + toProfile);
+ try {
+ mConectionServiceVideoProvider.sendSessionModifyRequest(fromProfile, toProfile);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to send a session modification request.
+ *
+ * @param responseProfile The response connection video properties.
+ */
+ @Override
+ public void onSendSessionModifyResponse(VideoProfile responseProfile) {
+ synchronized (mLock) {
+ logFromInCall("sendSessionModifyResponse: " + responseProfile);
+ try {
+ mConectionServiceVideoProvider.sendSessionModifyResponse(responseProfile);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to request the camera capabilities.
+ */
+ @Override
+ public void onRequestCameraCapabilities() {
+ synchronized (mLock) {
+ logFromInCall("requestCameraCapabilities");
+ try {
+ mConectionServiceVideoProvider.requestCameraCapabilities();
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to request the connection data usage.
+ */
+ @Override
+ public void onRequestConnectionDataUsage() {
+ synchronized (mLock) {
+ logFromInCall("requestCallDataUsage");
+ try {
+ mConectionServiceVideoProvider.requestCallDataUsage();
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Proxies a request from the {@link InCallService} to the
+ * {@link #mConectionServiceVideoProvider} to set the pause image.
+ *
+ * @param uri URI of image to display.
+ */
+ @Override
+ public void onSetPauseImage(Uri uri) {
+ synchronized (mLock) {
+ logFromInCall("setPauseImage: " + uri);
+ try {
+ mConectionServiceVideoProvider.setPauseImage(uri);
+ } catch (RemoteException e) {
+ }
+ }
+ }
+
+ /**
+ * Add a listener to this {@link VideoProviderProxy}.
+ *
+ * @param listener The listener.
+ */
+ public void addListener(Listener listener) {
+ mListeners.add(listener);
+ }
+
+ /**
+ * Remove a listener from this {@link VideoProviderProxy}.
+ *
+ * @param listener The listener.
+ */
+ public void removeListener(Listener listener) {
+ if (listener != null) {
+ mListeners.remove(listener);
+ }
+ }
+
+ /**
+ * Logs a message originating from the {@link InCallService}.
+ *
+ * @param toLog The message to log.
+ */
+ private void logFromInCall(String toLog) {
+ Log.v(this, "IC->VP: " + toLog);
+ }
+
+ /**
+ * Logs a message originating from the {@link android.telecom.ConnectionService}'s
+ * {@link Connection.VideoProvider}.
+ *
+ * @param toLog The message to log.
+ */
+ private void logFromVideoProvider(String toLog) {
+ Log.v(this, "VP->IC: " + toLog);
+ }
+}