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

Commit d88abc7b authored by Sanket Padawe's avatar Sanket Padawe Committed by Gerrit Code Review
Browse files

Merge "API declarations for Call Handover."

parents 9b08e4cb a8eddd48
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -38687,6 +38687,7 @@ package android.telecom {
    method public android.telecom.Call.RttCall getRttCall();
    method public int getState();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public void handoverTo(android.telecom.PhoneAccountHandle, int, android.os.Bundle);
    method public void hold();
    method public boolean isRttActive();
    method public void mergeConference();
@@ -38731,6 +38732,8 @@ package android.telecom {
    method public void onConferenceableCallsChanged(android.telecom.Call, java.util.List<android.telecom.Call>);
    method public void onConnectionEvent(android.telecom.Call, java.lang.String, android.os.Bundle);
    method public void onDetailsChanged(android.telecom.Call, android.telecom.Call.Details);
    method public void onHandoverComplete(android.telecom.Call);
    method public void onHandoverFailed(android.telecom.Call, int);
    method public void onParentChanged(android.telecom.Call, android.telecom.Call);
    method public void onPostDialWait(android.telecom.Call, java.lang.String);
    method public void onRttInitiationFailure(android.telecom.Call, int);
@@ -38739,6 +38742,10 @@ package android.telecom {
    method public void onRttStatusChanged(android.telecom.Call, boolean, android.telecom.Call.RttCall);
    method public void onStateChanged(android.telecom.Call, int);
    method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall);
    field public static final int HANDOVER_FAILURE_DEST_APP_REJECTED = 1; // 0x1
    field public static final int HANDOVER_FAILURE_DEST_INVALID_PERM = 3; // 0x3
    field public static final int HANDOVER_FAILURE_DEST_NOT_SUPPORTED = 2; // 0x2
    field public static final int HANDOVER_FAILURE_DEST_USER_REJECTED = 4; // 0x4
  }
  public static class Call.Details {
@@ -39072,8 +39079,11 @@ package android.telecom {
    method public void onConference(android.telecom.Connection, android.telecom.Connection);
    method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateIncomingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateIncomingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateOutgoingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onHandoverFailed(android.telecom.ConnectionRequest, int);
    method public void onRemoteConferenceAdded(android.telecom.RemoteConference);
    method public void onRemoteExistingConnectionAdded(android.telecom.RemoteConnection);
    field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.ConnectionService";
@@ -39196,6 +39206,9 @@ package android.telecom {
    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccount> CREATOR;
    field public static final java.lang.String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING";
    field public static final java.lang.String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH";
    field public static final java.lang.String EXTRA_LOG_SELF_MANAGED_CALLS = "android.telecom.extra.LOG_SELF_MANAGED_CALLS";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_FROM = "android.telecom.extra.SUPPORTS_HANDOVER_FROM";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_TO = "android.telecom.extra.SUPPORTS_HANDOVER_TO";
    field public static final int NO_HIGHLIGHT_COLOR = 0; // 0x0
    field public static final int NO_RESOURCE_ID = -1; // 0xffffffff
    field public static final java.lang.String SCHEME_SIP = "sip";
@@ -39356,6 +39369,7 @@ package android.telecom {
  }
  public class TelecomManager {
    method public void acceptHandover(android.net.Uri, int, android.telecom.PhoneAccountHandle);
    method public void acceptRingingCall();
    method public void acceptRingingCall(int);
    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
+14 −0
Original line number Diff line number Diff line
@@ -41920,6 +41920,7 @@ package android.telecom {
    method public android.telecom.Call.RttCall getRttCall();
    method public int getState();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public void handoverTo(android.telecom.PhoneAccountHandle, int, android.os.Bundle);
    method public void hold();
    method public boolean isRttActive();
    method public void mergeConference();
@@ -41966,6 +41967,8 @@ package android.telecom {
    method public void onConferenceableCallsChanged(android.telecom.Call, java.util.List<android.telecom.Call>);
    method public void onConnectionEvent(android.telecom.Call, java.lang.String, android.os.Bundle);
    method public void onDetailsChanged(android.telecom.Call, android.telecom.Call.Details);
    method public void onHandoverComplete(android.telecom.Call);
    method public void onHandoverFailed(android.telecom.Call, int);
    method public void onParentChanged(android.telecom.Call, android.telecom.Call);
    method public void onPostDialWait(android.telecom.Call, java.lang.String);
    method public void onRttInitiationFailure(android.telecom.Call, int);
@@ -41974,6 +41977,10 @@ package android.telecom {
    method public void onRttStatusChanged(android.telecom.Call, boolean, android.telecom.Call.RttCall);
    method public void onStateChanged(android.telecom.Call, int);
    method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall);
    field public static final int HANDOVER_FAILURE_DEST_APP_REJECTED = 1; // 0x1
    field public static final int HANDOVER_FAILURE_DEST_INVALID_PERM = 3; // 0x3
    field public static final int HANDOVER_FAILURE_DEST_NOT_SUPPORTED = 2; // 0x2
    field public static final int HANDOVER_FAILURE_DEST_USER_REJECTED = 4; // 0x4
  }
  public static class Call.Details {
@@ -42318,8 +42325,11 @@ package android.telecom {
    method public void onConference(android.telecom.Connection, android.telecom.Connection);
    method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateIncomingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateIncomingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateOutgoingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onHandoverFailed(android.telecom.ConnectionRequest, int);
    method public void onRemoteConferenceAdded(android.telecom.RemoteConference);
    method public void onRemoteExistingConnectionAdded(android.telecom.RemoteConnection);
    field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.ConnectionService";
@@ -42567,6 +42577,9 @@ package android.telecom {
    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccount> CREATOR;
    field public static final java.lang.String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING";
    field public static final java.lang.String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH";
    field public static final java.lang.String EXTRA_LOG_SELF_MANAGED_CALLS = "android.telecom.extra.LOG_SELF_MANAGED_CALLS";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_FROM = "android.telecom.extra.SUPPORTS_HANDOVER_FROM";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_TO = "android.telecom.extra.SUPPORTS_HANDOVER_TO";
    field public static final int NO_HIGHLIGHT_COLOR = 0; // 0x0
    field public static final int NO_RESOURCE_ID = -1; // 0xffffffff
    field public static final java.lang.String SCHEME_SIP = "sip";
@@ -42768,6 +42781,7 @@ package android.telecom {
  }
  public class TelecomManager {
    method public void acceptHandover(android.net.Uri, int, android.telecom.PhoneAccountHandle);
    method public void acceptRingingCall();
    method public void acceptRingingCall(int);
    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
+14 −0
Original line number Diff line number Diff line
@@ -38894,6 +38894,7 @@ package android.telecom {
    method public android.telecom.Call.RttCall getRttCall();
    method public int getState();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public void handoverTo(android.telecom.PhoneAccountHandle, int, android.os.Bundle);
    method public void hold();
    method public boolean isRttActive();
    method public void mergeConference();
@@ -38938,6 +38939,8 @@ package android.telecom {
    method public void onConferenceableCallsChanged(android.telecom.Call, java.util.List<android.telecom.Call>);
    method public void onConnectionEvent(android.telecom.Call, java.lang.String, android.os.Bundle);
    method public void onDetailsChanged(android.telecom.Call, android.telecom.Call.Details);
    method public void onHandoverComplete(android.telecom.Call);
    method public void onHandoverFailed(android.telecom.Call, int);
    method public void onParentChanged(android.telecom.Call, android.telecom.Call);
    method public void onPostDialWait(android.telecom.Call, java.lang.String);
    method public void onRttInitiationFailure(android.telecom.Call, int);
@@ -38946,6 +38949,10 @@ package android.telecom {
    method public void onRttStatusChanged(android.telecom.Call, boolean, android.telecom.Call.RttCall);
    method public void onStateChanged(android.telecom.Call, int);
    method public void onVideoCallChanged(android.telecom.Call, android.telecom.InCallService.VideoCall);
    field public static final int HANDOVER_FAILURE_DEST_APP_REJECTED = 1; // 0x1
    field public static final int HANDOVER_FAILURE_DEST_INVALID_PERM = 3; // 0x3
    field public static final int HANDOVER_FAILURE_DEST_NOT_SUPPORTED = 2; // 0x2
    field public static final int HANDOVER_FAILURE_DEST_USER_REJECTED = 4; // 0x4
  }
  public static class Call.Details {
@@ -39296,8 +39303,11 @@ package android.telecom {
    method public void onConference(android.telecom.Connection, android.telecom.Connection);
    method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateIncomingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateIncomingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onCreateOutgoingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public android.telecom.Connection onCreateOutgoingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest);
    method public void onHandoverFailed(android.telecom.ConnectionRequest, int);
    method public void onRemoteConferenceAdded(android.telecom.RemoteConference);
    method public void onRemoteExistingConnectionAdded(android.telecom.RemoteConnection);
    field public static final java.lang.String SERVICE_INTERFACE = "android.telecom.ConnectionService";
@@ -39420,6 +39430,9 @@ package android.telecom {
    field public static final android.os.Parcelable.Creator<android.telecom.PhoneAccount> CREATOR;
    field public static final java.lang.String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING = "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING";
    field public static final java.lang.String EXTRA_CALL_SUBJECT_MAX_LENGTH = "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH";
    field public static final java.lang.String EXTRA_LOG_SELF_MANAGED_CALLS = "android.telecom.extra.LOG_SELF_MANAGED_CALLS";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_FROM = "android.telecom.extra.SUPPORTS_HANDOVER_FROM";
    field public static final java.lang.String EXTRA_SUPPORTS_HANDOVER_TO = "android.telecom.extra.SUPPORTS_HANDOVER_TO";
    field public static final int NO_HIGHLIGHT_COLOR = 0; // 0x0
    field public static final int NO_RESOURCE_ID = -1; // 0xffffffff
    field public static final java.lang.String SCHEME_SIP = "sip";
@@ -39580,6 +39593,7 @@ package android.telecom {
  }
  public class TelecomManager {
    method public void acceptHandover(android.net.Uri, int, android.telecom.PhoneAccountHandle);
    method public void acceptRingingCall();
    method public void acceptRingingCall(int);
    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
+66 −0
Original line number Diff line number Diff line
@@ -855,6 +855,39 @@ public final class Call {
     * {@link InCallService#onCallAdded(Call)}.
     */
    public static abstract class Callback {
        /**
         * @hide
         */
        @IntDef({HANDOVER_FAILURE_DEST_APP_REJECTED, HANDOVER_FAILURE_DEST_NOT_SUPPORTED,
                HANDOVER_FAILURE_DEST_INVALID_PERM, HANDOVER_FAILURE_DEST_USER_REJECTED})
        @Retention(RetentionPolicy.SOURCE)
        public @interface HandoverFailureErrors {}

        /**
         * Handover failure reason returned via {@link #onHandoverFailed(Call, int)} when the app
         * to handover the call rejects handover.
         */
        public static final int HANDOVER_FAILURE_DEST_APP_REJECTED = 1;

        /**
         * Handover failure reason returned via {@link #onHandoverFailed(Call, int)} when there is
         * an error associated with unsupported handover.
         */
        public static final int HANDOVER_FAILURE_DEST_NOT_SUPPORTED = 2;

        /**
         * Handover failure reason returned via {@link #onHandoverFailed(Call, int)} when there
         * are some permission errors associated with APIs doing handover.
         */
        public static final int HANDOVER_FAILURE_DEST_INVALID_PERM = 3;

        /**
         * Handover failure reason returned via {@link #onHandoverFailed(Call, int)} when user
         * rejects handover.
         */
        public static final int HANDOVER_FAILURE_DEST_USER_REJECTED = 4;


        /**
         * Invoked when the state of this {@code Call} has changed. See {@link #getState()}.
         *
@@ -990,6 +1023,21 @@ public final class Call {
         *               {@link android.telecom.Connection.RttModifyStatus#SESSION_MODIFY_REQUEST_SUCCESS}.
         */
        public void onRttInitiationFailure(Call call, int reason) {}

        /**
         * Invoked when Call handover from one {@link PhoneAccount} to other {@link PhoneAccount}
         * has completed successfully.
         * @param call The call which had initiated handover.
         */
        public void onHandoverComplete(Call call) {}

        /**
         * Invoked when Call handover from one {@link PhoneAccount} to other {@link PhoneAccount}
         * has failed.
         * @param call The call which had initiated handover.
         * @param failureReason Error reason for failure
         */
        public void onHandoverFailed(Call call, @HandoverFailureErrors int failureReason) {}
    }

    /**
@@ -1365,6 +1413,24 @@ public final class Call {
        mInCallAdapter.respondToRttRequest(mTelecomCallId, id, accept);
    }

    /**
     * Initiates a handover of this {@link Call} to the {@link ConnectionService} identified
     * by {@code toHandle}.  The videoState specified indicates the desired video state after the
     * handover.
     * <p>
     * A handover request is initiated by the user from one app to indicate a desire
     * to handover a call to another.
     *
     * @param toHandle {@link PhoneAccountHandle} of the {@link ConnectionService} to handover
     *                 this call to.
     * @param videoState Indicates the video state desired after the handover.
     * @param extras Bundle containing extra information to be passed to the
     *               {@link ConnectionService}
     */
    public void handoverTo(PhoneAccountHandle toHandle, int videoState, Bundle extras) {
        mInCallAdapter.handoverTo(mTelecomCallId, toHandle, videoState, extras);
    }

    /**
     * Terminate the RTT session on this call. The resulting state change will be notified via
     * the {@link Callback#onRttStatusChanged(Call, boolean, RttCall)} callback.
+37 −0
Original line number Diff line number Diff line
@@ -2032,6 +2032,43 @@ public abstract class ConnectionService extends Service {
        return null;
    }

    /**
     * Called by Telecom on the initiating side of the handover to create an instance of a
     * handover connection.
     * @param fromPhoneAccountHandle {@link PhoneAccountHandle} associated with the
     *                               ConnectionService which needs to handover the call.
     * @param request Details about the call which needs to be handover.
     * @return Connection object corresponding to the handover call.
     */
    public Connection onCreateOutgoingHandoverConnection(PhoneAccountHandle fromPhoneAccountHandle,
                                                         ConnectionRequest request) {
        return null;
    }

    /**
     * Called by Telecom on the receiving side of the handover to request the
     * {@link ConnectionService} to create an instance of a handover connection.
     * @param fromPhoneAccountHandle {@link PhoneAccountHandle} associated with the
     *                               ConnectionService which needs to handover the call.
     * @param request Details about the call which needs to be handover.
     * @return {@link Connection} object corresponding to the handover call.
     */
    public Connection onCreateIncomingHandoverConnection(PhoneAccountHandle fromPhoneAccountHandle,
                                                         ConnectionRequest request) {
        return null;
    }

    /**
     * Called by Telecom in response to a {@code TelecomManager#acceptHandover()}
     * invocation which failed.
     * @param request Details about the call which needs to be handover.
     * @param error Reason for handover failure as defined in
     *              {@link android.telecom.Call.Callback#HANDOVER_FAILURE_DEST_INVALID_PERM}
     */
    public void onHandoverFailed(ConnectionRequest request, int error) {
        return;
    }

    /**
     * Create a {@code Connection} for a new unknown call. An unknown call is a call originating
     * from the ConnectionService that was neither a user-initiated outgoing call, nor an incoming
Loading