diff --git a/api/current.txt b/api/current.txt index da2f711803b90..4de0c987b9cf5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -27581,11 +27581,6 @@ package android.telecomm { method public abstract void setZoom(float); } - public class CallVideoProviderWrapper implements android.os.IBinder.DeathRecipient { - method public void binderDied(); - method public void setCamera(java.lang.String) throws android.os.RemoteException; - } - public abstract class Connection { ctor protected Connection(); method public final android.telecomm.CallAudioState getCallAudioState(); @@ -27732,6 +27727,7 @@ package android.telecomm { public final class InCallCall implements android.os.Parcelable { method public int describeContents(); + method public android.telecomm.RemoteCallVideoProvider getCallVideoProvider() throws android.os.RemoteException; method public java.util.List getCannedSmsResponses(); method public int getCapabilities(); method public long getConnectTimeMillis(); @@ -27761,6 +27757,11 @@ package android.telecomm { method protected abstract void updateCall(android.telecomm.InCallCall); } + public class RemoteCallVideoProvider implements android.os.IBinder.DeathRecipient { + method public void binderDied(); + method public void setCamera(java.lang.String) throws android.os.RemoteException; + } + public final class RemoteConnection { method public void addListener(android.telecomm.RemoteConnection.Listener); method public void answer(); diff --git a/telecomm/java/android/telecomm/InCallCall.java b/telecomm/java/android/telecomm/InCallCall.java index 8cbe2e6bad5ed..2a77547588212 100644 --- a/telecomm/java/android/telecomm/InCallCall.java +++ b/telecomm/java/android/telecomm/InCallCall.java @@ -19,8 +19,11 @@ package android.telecomm; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; +import android.os.RemoteException; import android.telephony.DisconnectCause; +import com.android.internal.telecomm.ICallVideoProvider; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -41,29 +44,11 @@ public final class InCallCall implements Parcelable { private final Subscription mSubscription; private final CallServiceDescriptor mCurrentCallServiceDescriptor; private final CallServiceDescriptor mHandoffCallServiceDescriptor; + private final ICallVideoProvider mCallVideoProvider; + private RemoteCallVideoProvider mRemoteCallVideoProvider; private final String mParentCallId; private final List mChildCallIds; - /** @hide */ - @SuppressWarnings("unchecked") - public InCallCall( - String id, - CallState state, - int disconnectCauseCode, - String disconnectCauseMsg, - List cannedSmsResponses, - int capabilities, - long connectTimeMillis, - Uri handle, - GatewayInfo gatewayInfo, - Subscription subscription, - CallServiceDescriptor descriptor, - CallServiceDescriptor handoffDescriptor) { - this(id, state, disconnectCauseCode, disconnectCauseMsg, cannedSmsResponses, - capabilities, connectTimeMillis, handle, gatewayInfo, subscription, descriptor, - handoffDescriptor, null, Collections.EMPTY_LIST); - } - /** @hide */ public InCallCall( String id, @@ -78,6 +63,7 @@ public final class InCallCall implements Parcelable { Subscription subscription, CallServiceDescriptor descriptor, CallServiceDescriptor handoffDescriptor, + ICallVideoProvider callVideoProvider, String parentCallId, List childCallIds) { mId = id; @@ -92,6 +78,7 @@ public final class InCallCall implements Parcelable { mSubscription = subscription; mCurrentCallServiceDescriptor = descriptor; mHandoffCallServiceDescriptor = handoffDescriptor; + mCallVideoProvider = callVideoProvider; mParentCallId = parentCallId; mChildCallIds = childCallIds; } @@ -167,6 +154,22 @@ public final class InCallCall implements Parcelable { return mHandoffCallServiceDescriptor; } + /** + * Returns an object for remotely communicating through the call video provider's binder. + * @return The call video provider. + */ + public RemoteCallVideoProvider getCallVideoProvider() throws RemoteException { + if (mRemoteCallVideoProvider == null) { + try { + mRemoteCallVideoProvider = new RemoteCallVideoProvider(mCallVideoProvider); + } catch (RemoteException ignored) { + // Ignore RemoteException. + } + } + + return mRemoteCallVideoProvider; + } + /** * The conference call to which this call is conferenced. Null if not conferenced. * @hide @@ -203,12 +206,15 @@ public final class InCallCall implements Parcelable { Subscription subscription = source.readParcelable(classLoader); CallServiceDescriptor descriptor = source.readParcelable(classLoader); CallServiceDescriptor handoffDescriptor = source.readParcelable(classLoader); + ICallVideoProvider callVideoProvider = + ICallVideoProvider.Stub.asInterface(source.readStrongBinder()); String parentCallId = source.readString(); List childCallIds = new ArrayList<>(); source.readList(childCallIds, classLoader); return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg, cannedSmsResponses, capabilities, connectTimeMillis, handle, gatewayInfo, - subscription, descriptor, handoffDescriptor, parentCallId, childCallIds); + subscription, descriptor, handoffDescriptor, callVideoProvider, parentCallId, + childCallIds); } @Override @@ -238,6 +244,7 @@ public final class InCallCall implements Parcelable { destination.writeParcelable(mSubscription, 0); destination.writeParcelable(mCurrentCallServiceDescriptor, 0); destination.writeParcelable(mHandoffCallServiceDescriptor, 0); + destination.writeStrongBinder(mCallVideoProvider.asBinder()); destination.writeString(mParentCallId); destination.writeList(mChildCallIds); } diff --git a/telecomm/java/android/telecomm/CallVideoProviderWrapper.java b/telecomm/java/android/telecomm/RemoteCallVideoProvider.java similarity index 88% rename from telecomm/java/android/telecomm/CallVideoProviderWrapper.java rename to telecomm/java/android/telecomm/RemoteCallVideoProvider.java index 862adff8bb098..7b86db001ad7c 100644 --- a/telecomm/java/android/telecomm/CallVideoProviderWrapper.java +++ b/telecomm/java/android/telecomm/RemoteCallVideoProvider.java @@ -22,10 +22,10 @@ import android.os.RemoteException; import com.android.internal.telecomm.ICallVideoProvider; -public class CallVideoProviderWrapper implements IBinder.DeathRecipient { +public class RemoteCallVideoProvider implements IBinder.DeathRecipient { private final ICallVideoProvider mCallVideoProvider; - CallVideoProviderWrapper(ICallVideoProvider callVideoProvider) throws RemoteException { + RemoteCallVideoProvider(ICallVideoProvider callVideoProvider) throws RemoteException { mCallVideoProvider = callVideoProvider; mCallVideoProvider.asBinder().linkToDeath(this, 0); }