diff options
author | Andrew Lee <anwlee@google.com> | 2014-06-27 22:04:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-26 18:07:29 +0000 |
commit | 4ea10b0cbaed76bbaf0e1de04b8e53cd307e78f2 (patch) | |
tree | 965577ba1316f2c34a74070bd97d1f2c642160e6 /telecomm | |
parent | 7c668b921b62e07833c2b8384b33e6ab9c5a0929 (diff) | |
parent | 5ffbe8b850c2703b64617f0140d051a5412dd861 (diff) | |
download | frameworks_base-4ea10b0cbaed76bbaf0e1de04b8e53cd307e78f2.zip frameworks_base-4ea10b0cbaed76bbaf0e1de04b8e53cd307e78f2.tar.gz frameworks_base-4ea10b0cbaed76bbaf0e1de04b8e53cd307e78f2.tar.bz2 |
Merge "Add methods to set a CallVideoProvider on a Call."
Diffstat (limited to 'telecomm')
6 files changed, 56 insertions, 1 deletions
diff --git a/telecomm/java/android/telecomm/CallServiceAdapter.java b/telecomm/java/android/telecomm/CallServiceAdapter.java index 31e37c4..8412e80 100644 --- a/telecomm/java/android/telecomm/CallServiceAdapter.java +++ b/telecomm/java/android/telecomm/CallServiceAdapter.java @@ -23,6 +23,7 @@ import android.os.RemoteException; import com.android.internal.telecomm.ICallService; import com.android.internal.telecomm.ICallServiceAdapter; +import com.android.internal.telecomm.ICallVideoProvider; import com.android.internal.telecomm.RemoteServiceCallback; import java.util.ArrayList; @@ -338,4 +339,19 @@ public final class CallServiceAdapter implements DeathRecipient { } } } + + /** + * 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. + */ + public void setCallVideoProvider(String callId, CallVideoProvider callVideoProvider) { + for (ICallServiceAdapter adapter : mAdapters) { + try { + adapter.setCallVideoProvider(callId, callVideoProvider.getInterface()); + } catch (RemoteException e) { + } + } + } } diff --git a/telecomm/java/android/telecomm/CallVideoProvider.java b/telecomm/java/android/telecomm/CallVideoProvider.java index 6126fca..4f593b9 100644 --- a/telecomm/java/android/telecomm/CallVideoProvider.java +++ b/telecomm/java/android/telecomm/CallVideoProvider.java @@ -25,7 +25,6 @@ import android.os.Message; import com.android.internal.telecomm.ICallVideoProvider; -/** @hide */ public abstract class CallVideoProvider { private static final int MSG_SET_CAMERA = 1; @@ -61,6 +60,14 @@ public abstract class CallVideoProvider { } /** + * Returns binder object which can be used across IPC methods. + * @hide + */ + public final ICallVideoProvider getInterface() { + return mBinder; + } + + /** * Sets the camera to be used for video recording in a video call. * * @param cameraId The id of the camera. diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java index e4992d0..cf4e29a 100644 --- a/telecomm/java/android/telecomm/Connection.java +++ b/telecomm/java/android/telecomm/Connection.java @@ -18,6 +18,7 @@ package android.telecomm; import android.net.Uri; import android.os.Bundle; +import android.telecomm.CallVideoProvider; import java.util.ArrayList; import java.util.Collections; @@ -40,6 +41,7 @@ public abstract class Connection { void onDestroyed(Connection c); void onConferenceCapableChanged(Connection c, boolean isConferenceCapable); void onParentConnectionChanged(Connection c, Connection parent); + void onSetCallVideoProvider(Connection c, CallVideoProvider callVideoProvider); } public static class ListenerBase implements Listener { @@ -78,6 +80,10 @@ public abstract class Connection { /** ${inheritDoc} */ @Override public void onParentConnectionChanged(Connection c, Connection parent) {} + + /** {@inheritDoc} */ + @Override + public void onSetCallVideoProvider(Connection c, CallVideoProvider callVideoProvider) {} } public final class State { @@ -415,6 +421,16 @@ public abstract class Connection { } /** + * Sets the call video provider. + * @param callVideoProvider The call video provider. + */ + public final void setCallVideoProvider(CallVideoProvider callVideoProvider) { + for (Listener l : mListeners) { + l.onSetCallVideoProvider(this, callVideoProvider); + } + } + + /** * Sets state to disconnected. This will first notify listeners with an * {@link Listener#onStateChanged(Connection, int)} event, then will fire an * {@link Listener#onDisconnected(Connection, int, String)} event with additional diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 23b99fa..4d525f2 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -155,6 +155,12 @@ public abstract class ConnectionService extends CallService { String parentId = parent == null ? null : mIdByConnection.get(parent); getAdapter().setIsConferenced(id, parentId); } + + @Override + public void onSetCallVideoProvider(Connection c, CallVideoProvider callVideoProvider) { + String id = mIdByConnection.get(c); + getAdapter().setCallVideoProvider(id, callVideoProvider); + } }; @Override diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java index 7658a76..64e5871 100644 --- a/telecomm/java/android/telecomm/RemoteConnectionService.java +++ b/telecomm/java/android/telecomm/RemoteConnectionService.java @@ -26,6 +26,7 @@ import android.text.TextUtils; import com.android.internal.telecomm.ICallService; import com.android.internal.telecomm.ICallServiceAdapter; +import com.android.internal.telecomm.ICallVideoProvider; import com.android.internal.telecomm.RemoteServiceCallback; import java.util.ArrayList; @@ -105,6 +106,12 @@ public class RemoteConnectionService implements DeathRecipient { } /** ${inheritDoc} */ + public void setCallVideoProvider( + String connectionId, ICallVideoProvider callVideoProvider) { + // not supported for remote connections. + } + + /** ${inheritDoc} */ @Override public void setDialing(String connectionId) { if (isCurrentConnection(connectionId)) { diff --git a/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl index 373fb16..b81ef37 100644 --- a/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl @@ -19,6 +19,7 @@ package com.android.internal.telecomm; import android.telecomm.CallInfo; import android.telecomm.ConnectionRequest; +import com.android.internal.telecomm.ICallVideoProvider; import com.android.internal.telecomm.RemoteServiceCallback; /** @@ -62,4 +63,6 @@ oneway interface ICallServiceAdapter { void handoffCall(String callId); void queryRemoteConnectionServices(RemoteServiceCallback callback); + + void setCallVideoProvider(String callId, ICallVideoProvider callVideoProvider); } |