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

Commit 0ab00030 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Ims: Add support for Adhoc Conference calls"

parents 23deb336 80aa2140
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -43608,6 +43608,7 @@ package android.telecom {
    field public static final int PROPERTY_GENERIC_CONFERENCE = 2; // 0x2
    field public static final int PROPERTY_HAS_CDMA_VOICE_PRIVACY = 128; // 0x80
    field public static final int PROPERTY_HIGH_DEF_AUDIO = 16; // 0x10
    field public static final int PROPERTY_IS_ADHOC_CONFERENCE = 8192; // 0x2000
    field public static final int PROPERTY_IS_EXTERNAL_CALL = 64; // 0x40
    field public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 2048; // 0x800
    field public static final int PROPERTY_RTT = 1024; // 0x400
@@ -43685,6 +43686,7 @@ package android.telecom {
  public abstract class Conference extends android.telecom.Conferenceable {
    ctor public Conference(android.telecom.PhoneAccountHandle);
    method public final boolean addConnection(android.telecom.Connection);
    method @NonNull public static android.telecom.Conference createFailedConference(@NonNull android.telecom.DisconnectCause, @NonNull android.telecom.PhoneAccountHandle);
    method public final void destroy();
    method public final android.telecom.CallAudioState getCallAudioState();
    method public final java.util.List<android.telecom.Connection> getConferenceableConnections();
@@ -43699,6 +43701,8 @@ package android.telecom {
    method public final android.telecom.StatusHints getStatusHints();
    method public android.telecom.Connection.VideoProvider getVideoProvider();
    method public int getVideoState();
    method public final boolean isRingbackRequested();
    method public void onAnswer(int);
    method public void onCallAudioStateChanged(android.telecom.CallAudioState);
    method public void onConnectionAdded(android.telecom.Connection);
    method public void onDisconnect();
@@ -43707,6 +43711,7 @@ package android.telecom {
    method public void onMerge(android.telecom.Connection);
    method public void onMerge();
    method public void onPlayDtmfTone(char);
    method public void onReject();
    method public void onSeparate(android.telecom.Connection);
    method public void onStopDtmfTone();
    method public void onSwap();
@@ -43726,6 +43731,8 @@ package android.telecom {
    method public final void setDisconnected(android.telecom.DisconnectCause);
    method public final void setExtras(@Nullable android.os.Bundle);
    method public final void setOnHold();
    method public final void setRingbackRequested(boolean);
    method public final void setRinging();
    method public final void setStatusHints(android.telecom.StatusHints);
    method public final void setVideoProvider(android.telecom.Connection, android.telecom.Connection.VideoProvider);
    method public final void setVideoState(android.telecom.Connection, int);
@@ -43883,6 +43890,7 @@ package android.telecom {
    field public static final int PROPERTY_ASSISTED_DIALING_USED = 512; // 0x200
    field public static final int PROPERTY_HAS_CDMA_VOICE_PRIVACY = 32; // 0x20
    field public static final int PROPERTY_HIGH_DEF_AUDIO = 4; // 0x4
    field public static final int PROPERTY_IS_ADHOC_CONFERENCE = 4096; // 0x1000
    field public static final int PROPERTY_IS_EXTERNAL_CALL = 16; // 0x10
    field public static final int PROPERTY_IS_RTT = 256; // 0x100
    field public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 1024; // 0x400
@@ -43955,8 +43963,10 @@ package android.telecom {
    method public android.telecom.PhoneAccountHandle getAccountHandle();
    method public android.net.Uri getAddress();
    method public android.os.Bundle getExtras();
    method @Nullable public java.util.List<android.net.Uri> getParticipants();
    method public android.telecom.Connection.RttTextStream getRttTextStream();
    method public int getVideoState();
    method public boolean isAdhocConferenceCall();
    method public boolean isRequestingRtt();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telecom.ConnectionRequest> CREATOR;
@@ -43976,9 +43986,13 @@ package android.telecom {
    method public void onConference(android.telecom.Connection, android.telecom.Connection);
    method public void onConnectionServiceFocusGained();
    method public void onConnectionServiceFocusLost();
    method @Nullable public android.telecom.Conference onCreateIncomingConference(@Nullable android.telecom.PhoneAccountHandle, @Nullable android.telecom.ConnectionRequest);
    method public void onCreateIncomingConferenceFailed(@Nullable android.telecom.PhoneAccountHandle, @Nullable android.telecom.ConnectionRequest);
    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 @Nullable public android.telecom.Conference onCreateOutgoingConference(@Nullable android.telecom.PhoneAccountHandle, @Nullable android.telecom.ConnectionRequest);
    method public void onCreateOutgoingConferenceFailed(@Nullable android.telecom.PhoneAccountHandle, @Nullable 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);
@@ -44093,6 +44107,7 @@ package android.telecom {
    method public boolean supportsUriScheme(String);
    method public android.telecom.PhoneAccount.Builder toBuilder();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CAPABILITY_ADHOC_CONFERENCE_CALLING = 16384; // 0x4000
    field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2
    field public static final int CAPABILITY_CALL_SUBJECT = 64; // 0x40
    field public static final int CAPABILITY_CONNECTION_MANAGER = 1; // 0x1
@@ -44288,6 +44303,7 @@ package android.telecom {
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ANSWER_PHONE_CALLS, android.Manifest.permission.MODIFY_PHONE_STATE}) public void acceptRingingCall();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ANSWER_PHONE_CALLS, android.Manifest.permission.MODIFY_PHONE_STATE}) public void acceptRingingCall(int);
    method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
    method public void addNewIncomingConference(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void cancelMissedCallsNotification();
    method public android.content.Intent createManageBlockedNumbersIntent();
    method @Deprecated @RequiresPermission(android.Manifest.permission.ANSWER_PHONE_CALLS) public boolean endCall();
@@ -44315,6 +44331,7 @@ package android.telecom {
    method public void registerPhoneAccount(android.telecom.PhoneAccount);
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public void showInCallScreen(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void silenceRinger();
    method @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void startConference(@NonNull java.util.List<android.net.Uri>, @NonNull android.os.Bundle);
    method public void unregisterPhoneAccount(android.telecom.PhoneAccountHandle);
    field public static final String ACTION_CHANGE_DEFAULT_DIALER = "android.telecom.action.CHANGE_DEFAULT_DIALER";
    field public static final String ACTION_CHANGE_PHONE_ACCOUNTS = "android.telecom.action.CHANGE_PHONE_ACCOUNTS";
@@ -44793,6 +44810,7 @@ package android.telephony {
    field public static final String KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL = "sim_network_unlock_allow_dismiss_bool";
    field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool";
    field public static final String KEY_SUPPORT_3GPP_CALL_FORWARDING_WHILE_ROAMING_BOOL = "support_3gpp_call_forwarding_while_roaming_bool";
    field public static final String KEY_SUPPORT_ADHOC_CONFERENCE_CALLS_BOOL = "support_adhoc_conference_calls_bool";
    field public static final String KEY_SUPPORT_CLIR_NETWORK_DEFAULT_BOOL = "support_clir_network_default_bool";
    field public static final String KEY_SUPPORT_CONFERENCE_CALL_BOOL = "support_conference_call_bool";
    field public static final String KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL = "support_emergency_sms_over_ims_bool";
+2 −0
Original line number Diff line number Diff line
@@ -2884,6 +2884,8 @@ package android.telecom {
    method @NonNull public android.telecom.ConnectionRequest.Builder setAccountHandle(@NonNull android.telecom.PhoneAccountHandle);
    method @NonNull public android.telecom.ConnectionRequest.Builder setAddress(@NonNull android.net.Uri);
    method @NonNull public android.telecom.ConnectionRequest.Builder setExtras(@NonNull android.os.Bundle);
    method @NonNull public android.telecom.ConnectionRequest.Builder setIsAdhocConferenceCall(boolean);
    method @NonNull public android.telecom.ConnectionRequest.Builder setParticipants(@Nullable java.util.List<android.net.Uri>);
    method @NonNull public android.telecom.ConnectionRequest.Builder setRttPipeFromInCall(@NonNull android.os.ParcelFileDescriptor);
    method @NonNull public android.telecom.ConnectionRequest.Builder setRttPipeToInCall(@NonNull android.os.ParcelFileDescriptor);
    method @NonNull public android.telecom.ConnectionRequest.Builder setShouldShowIncomingCallUi(boolean);
+10 −1
Original line number Diff line number Diff line
@@ -547,8 +547,14 @@ public final class Call {
         */
        public static final int PROPERTY_VOIP_AUDIO_MODE = 0x00001000;

        /**
         * Indicates that the call is an adhoc conference call. This property can be set for both
         * incoming and outgoing calls.
         */
        public static final int PROPERTY_IS_ADHOC_CONFERENCE = 0x00002000;

        //******************************************************************************************
        // Next PROPERTY value: 0x00002000
        // Next PROPERTY value: 0x00004000
        //******************************************************************************************

        private final String mTelecomCallId;
@@ -726,6 +732,9 @@ public final class Call {
            if (hasProperty(properties, PROPERTY_VOIP_AUDIO_MODE)) {
                builder.append(" PROPERTY_VOIP_AUDIO_MODE");
            }
            if (hasProperty(properties, PROPERTY_IS_ADHOC_CONFERENCE)) {
                builder.append(" PROPERTY_IS_ADHOC_CONFERENCE");
            }
            builder.append("]");
            return builder.toString();
        }
+96 −9
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ public abstract class Conference extends Conferenceable {
        public void onConnectionEvent(Conference c, String event, Bundle extras) {}
        public void onCallerDisplayNameChanged(
                Conference c, String callerDisplayName, int presentation) {}
        public void onRingbackRequested(Conference c, boolean ringback) {}
    }

    private final Set<Listener> mListeners = new CopyOnWriteArraySet<>();
@@ -97,6 +98,7 @@ public abstract class Conference extends Conferenceable {
    private int mAddressPresentation;
    private String mCallerDisplayName;
    private int mCallerDisplayNamePresentation;
    private boolean mRingbackRequested = false;

    private final Connection.Listener mConnectionDeathListener = new Connection.Listener() {
        @Override
@@ -169,6 +171,14 @@ public abstract class Conference extends Conferenceable {
        return mState;
    }

    /**
     * Returns whether this conference is requesting that the system play a ringback tone
     * on its behalf.
     */
    public final boolean isRingbackRequested() {
        return mRingbackRequested;
    }

    /**
     * Returns the capabilities of the conference. See {@code CAPABILITY_*} constants in class
     * {@link Connection} for valid values.
@@ -307,6 +317,35 @@ public abstract class Conference extends Conferenceable {
     */
    public void onConnectionAdded(Connection connection) {}

    /**
     * Notifies this Conference, which is in {@code STATE_RINGING}, of
     * a request to accept.
     * For managed {@link ConnectionService}s, this will be called when the user answers a call via
     * the default dialer's {@link InCallService}.
     *
     * @param videoState The video state in which to answer the connection.
     */
    public void onAnswer(int videoState) {}

    /**
     * Notifies this Conference, which is in {@code STATE_RINGING}, of
     * a request to accept.
     * For managed {@link ConnectionService}s, this will be called when the user answers a call via
     * the default dialer's {@link InCallService}.
     * @hide
     */
    public final void onAnswer() {
         onAnswer(VideoProfile.STATE_AUDIO_ONLY);
    }

    /**
     * Notifies this Conference, which is in {@code STATE_RINGING}, of
     * a request to reject.
     * For managed {@link ConnectionService}s, this will be called when the user rejects a call via
     * the default dialer's {@link InCallService}.
     */
    public void onReject() {}

    /**
     * Sets state to be on hold.
     */
@@ -321,10 +360,18 @@ public abstract class Conference extends Conferenceable {
        setState(Connection.STATE_DIALING);
    }

    /**
     * Sets state to be ringing.
     */
    public final void setRinging() {
        setState(Connection.STATE_RINGING);
    }

    /**
     * Sets state to be active.
     */
    public final void setActive() {
        setRingbackRequested(false);
        setState(Connection.STATE_ACTIVE);
    }

@@ -435,6 +482,21 @@ public abstract class Conference extends Conferenceable {
        fireOnConferenceableConnectionsChanged();
    }

    /**
     * Requests that the framework play a ringback tone. This is to be invoked by implementations
     * that do not play a ringback tone themselves in the conference's audio stream.
     *
     * @param ringback Whether the ringback tone is to be played.
     */
    public final void setRingbackRequested(boolean ringback) {
        if (mRingbackRequested != ringback) {
            mRingbackRequested = ringback;
            for (Listener l : mListeners) {
                l.onRingbackRequested(this, ringback);
            }
        }
    }

    /**
     * Set the video state for the conference.
     * Valid values: {@link VideoProfile#STATE_AUDIO_ONLY},
@@ -640,14 +702,6 @@ public abstract class Conference extends Conferenceable {
    }

    private void setState(int newState) {
        if (newState != Connection.STATE_ACTIVE &&
                newState != Connection.STATE_HOLDING &&
                newState != Connection.STATE_DISCONNECTED) {
            Log.w(this, "Unsupported state transition for Conference call.",
                    Connection.stateToString(newState));
            return;
        }

        if (mState != newState) {
            int oldState = mState;
            mState = newState;
@@ -657,6 +711,37 @@ public abstract class Conference extends Conferenceable {
        }
    }

    private static class FailureSignalingConference extends Conference {
        private boolean mImmutable = false;
        public FailureSignalingConference(DisconnectCause disconnectCause,
                PhoneAccountHandle phoneAccount) {
            super(phoneAccount);
            setDisconnected(disconnectCause);
            mImmutable = true;
        }
        public void checkImmutable() {
            if (mImmutable) {
                throw new UnsupportedOperationException("Conference is immutable");
            }
        }
    }

    /**
     * Return a {@code Conference} which represents a failed conference attempt. The returned
     * {@code Conference} will have a {@link android.telecom.DisconnectCause} and as specified,
     * and a {@link #getState()} of {@code STATE_DISCONNECTED}.
     * <p>
     * The returned {@code Conference} can be assumed to {@link #destroy()} itself when appropriate,
     * so users of this method need not maintain a reference to its return value to destroy it.
     *
     * @param disconnectCause The disconnect cause, ({@see android.telecomm.DisconnectCause}).
     * @return A {@code Conference} which indicates failure.
     */
    public @NonNull static Conference createFailedConference(
            @NonNull DisconnectCause disconnectCause, @NonNull PhoneAccountHandle phoneAccount) {
        return new FailureSignalingConference(disconnectCause, phoneAccount);
    }

    private final void clearConferenceableList() {
        for (Connection c : mConferenceableConnections) {
            c.removeConnectionListener(mConnectionDeathListener);
@@ -667,11 +752,13 @@ public abstract class Conference extends Conferenceable {
    @Override
    public String toString() {
        return String.format(Locale.US,
                "[State: %s,Capabilites: %s, VideoState: %s, VideoProvider: %s, ThisObject %s]",
                "[State: %s,Capabilites: %s, VideoState: %s, VideoProvider: %s,"
                + "isRingbackRequested: %s, ThisObject %s]",
                Connection.stateToString(mState),
                Call.Details.capabilitiesToString(mConnectionCapabilities),
                getVideoState(),
                getVideoProvider(),
                isRingbackRequested() ? "Y" : "N",
                super.toString());
    }

+14 −1
Original line number Diff line number Diff line
@@ -497,8 +497,17 @@ public abstract class Connection extends Conferenceable {
    @TestApi
    public static final int PROPERTY_REMOTELY_HOSTED = 1 << 11;

    /**
     * Set by the framework to indicate that it is an adhoc conference call.
     * <p>
     * This is used for Outgoing and incoming conference calls.
     *
     */
    public static final int PROPERTY_IS_ADHOC_CONFERENCE = 1 << 12;


    //**********************************************************************************************
    // Next PROPERTY value: 1<<12
    // Next PROPERTY value: 1<<13
    //**********************************************************************************************

    /**
@@ -1018,6 +1027,10 @@ public abstract class Connection extends Conferenceable {
            builder.append(isLong ? " PROPERTY_REMOTELY_HOSTED" : " remote_hst");
        }

        if ((properties & PROPERTY_IS_ADHOC_CONFERENCE) == PROPERTY_IS_ADHOC_CONFERENCE) {
            builder.append(isLong ? " PROPERTY_IS_ADHOC_CONFERENCE" : " adhoc_conf");
        }

        builder.append("]");
        return builder.toString();
    }
Loading