Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd7c5908 authored by Andrew Lee's avatar Andrew Lee Committed by Android (Google) Code Review
Browse files

Merge "Add ICallVideoProvider binder to the InCallCall object."

parents 4e8b9ed3 5dc3075c
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -27581,11 +27581,6 @@ package android.telecomm {
    method public abstract void setZoom(float);
    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 {
  public abstract class Connection {
    ctor protected Connection();
    ctor protected Connection();
    method public final android.telecomm.CallAudioState getCallAudioState();
    method public final android.telecomm.CallAudioState getCallAudioState();
@@ -27732,6 +27727,7 @@ package android.telecomm {
  public final class InCallCall implements android.os.Parcelable {
  public final class InCallCall implements android.os.Parcelable {
    method public int describeContents();
    method public int describeContents();
    method public android.telecomm.RemoteCallVideoProvider getCallVideoProvider() throws android.os.RemoteException;
    method public java.util.List<java.lang.String> getCannedSmsResponses();
    method public java.util.List<java.lang.String> getCannedSmsResponses();
    method public int getCapabilities();
    method public int getCapabilities();
    method public long getConnectTimeMillis();
    method public long getConnectTimeMillis();
@@ -27761,6 +27757,11 @@ package android.telecomm {
    method protected abstract void updateCall(android.telecomm.InCallCall);
    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 {
  public final class RemoteConnection {
    method public void addListener(android.telecomm.RemoteConnection.Listener);
    method public void addListener(android.telecomm.RemoteConnection.Listener);
    method public void answer();
    method public void answer();
+28 −21
Original line number Original line Diff line number Diff line
@@ -19,8 +19,11 @@ package android.telecomm;
import android.net.Uri;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;
import android.os.RemoteException;
import android.telephony.DisconnectCause;
import android.telephony.DisconnectCause;


import com.android.internal.telecomm.ICallVideoProvider;

import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Collections;
import java.util.List;
import java.util.List;
@@ -41,29 +44,11 @@ public final class InCallCall implements Parcelable {
    private final Subscription mSubscription;
    private final Subscription mSubscription;
    private final CallServiceDescriptor mCurrentCallServiceDescriptor;
    private final CallServiceDescriptor mCurrentCallServiceDescriptor;
    private final CallServiceDescriptor mHandoffCallServiceDescriptor;
    private final CallServiceDescriptor mHandoffCallServiceDescriptor;
    private final ICallVideoProvider mCallVideoProvider;
    private RemoteCallVideoProvider mRemoteCallVideoProvider;
    private final String mParentCallId;
    private final String mParentCallId;
    private final List<String> mChildCallIds;
    private final List<String> mChildCallIds;


    /** @hide */
    @SuppressWarnings("unchecked")
    public InCallCall(
            String id,
            CallState state,
            int disconnectCauseCode,
            String disconnectCauseMsg,
            List<String> 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 */
    /** @hide */
    public InCallCall(
    public InCallCall(
            String id,
            String id,
@@ -78,6 +63,7 @@ public final class InCallCall implements Parcelable {
            Subscription subscription,
            Subscription subscription,
            CallServiceDescriptor descriptor,
            CallServiceDescriptor descriptor,
            CallServiceDescriptor handoffDescriptor,
            CallServiceDescriptor handoffDescriptor,
            ICallVideoProvider callVideoProvider,
            String parentCallId,
            String parentCallId,
            List<String> childCallIds) {
            List<String> childCallIds) {
        mId = id;
        mId = id;
@@ -92,6 +78,7 @@ public final class InCallCall implements Parcelable {
        mSubscription = subscription;
        mSubscription = subscription;
        mCurrentCallServiceDescriptor = descriptor;
        mCurrentCallServiceDescriptor = descriptor;
        mHandoffCallServiceDescriptor = handoffDescriptor;
        mHandoffCallServiceDescriptor = handoffDescriptor;
        mCallVideoProvider = callVideoProvider;
        mParentCallId = parentCallId;
        mParentCallId = parentCallId;
        mChildCallIds = childCallIds;
        mChildCallIds = childCallIds;
    }
    }
@@ -167,6 +154,22 @@ public final class InCallCall implements Parcelable {
        return mHandoffCallServiceDescriptor;
        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.
     * The conference call to which this call is conferenced. Null if not conferenced.
     * @hide
     * @hide
@@ -203,12 +206,15 @@ public final class InCallCall implements Parcelable {
            Subscription subscription = source.readParcelable(classLoader);
            Subscription subscription = source.readParcelable(classLoader);
            CallServiceDescriptor descriptor = source.readParcelable(classLoader);
            CallServiceDescriptor descriptor = source.readParcelable(classLoader);
            CallServiceDescriptor handoffDescriptor = source.readParcelable(classLoader);
            CallServiceDescriptor handoffDescriptor = source.readParcelable(classLoader);
            ICallVideoProvider callVideoProvider =
                    ICallVideoProvider.Stub.asInterface(source.readStrongBinder());
            String parentCallId = source.readString();
            String parentCallId = source.readString();
            List<String> childCallIds = new ArrayList<>();
            List<String> childCallIds = new ArrayList<>();
            source.readList(childCallIds, classLoader);
            source.readList(childCallIds, classLoader);
            return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg,
            return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg,
                    cannedSmsResponses, capabilities, connectTimeMillis, handle, gatewayInfo,
                    cannedSmsResponses, capabilities, connectTimeMillis, handle, gatewayInfo,
                    subscription, descriptor, handoffDescriptor, parentCallId, childCallIds);
                    subscription, descriptor, handoffDescriptor, callVideoProvider, parentCallId,
                    childCallIds);
        }
        }


        @Override
        @Override
@@ -238,6 +244,7 @@ public final class InCallCall implements Parcelable {
        destination.writeParcelable(mSubscription, 0);
        destination.writeParcelable(mSubscription, 0);
        destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
        destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
        destination.writeParcelable(mHandoffCallServiceDescriptor, 0);
        destination.writeParcelable(mHandoffCallServiceDescriptor, 0);
        destination.writeStrongBinder(mCallVideoProvider.asBinder());
        destination.writeString(mParentCallId);
        destination.writeString(mParentCallId);
        destination.writeList(mChildCallIds);
        destination.writeList(mChildCallIds);
    }
    }
+2 −2
Original line number Original line Diff line number Diff line
@@ -22,10 +22,10 @@ import android.os.RemoteException;
import com.android.internal.telecomm.ICallVideoProvider;
import com.android.internal.telecomm.ICallVideoProvider;




public class CallVideoProviderWrapper implements IBinder.DeathRecipient {
public class RemoteCallVideoProvider implements IBinder.DeathRecipient {
    private final ICallVideoProvider mCallVideoProvider;
    private final ICallVideoProvider mCallVideoProvider;


    CallVideoProviderWrapper(ICallVideoProvider callVideoProvider) throws RemoteException {
    RemoteCallVideoProvider(ICallVideoProvider callVideoProvider) throws RemoteException {
        mCallVideoProvider = callVideoProvider;
        mCallVideoProvider = callVideoProvider;
        mCallVideoProvider.asBinder().linkToDeath(this, 0);
        mCallVideoProvider.asBinder().linkToDeath(this, 0);
    }
    }