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

Commit 5b326ce0 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Prevent merging conference calls hosted on peer device." into lmp-mr1-wfc-dev

parents 6cc5ac49 ce67e30b
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ public abstract class Connection {
                android.telecom.Connection.VideoProvider videoProvider);
        public void onAudioQualityChanged(int audioQuality);
        public void onConferenceParticipantsChanged(List<ConferenceParticipant> participants);
        public void onMultipartyStateChanged(boolean isMultiParty);
    }

    /**
@@ -71,6 +72,8 @@ public abstract class Connection {
        public void onAudioQualityChanged(int audioQuality) {}
        @Override
        public void onConferenceParticipantsChanged(List<ConferenceParticipant> participants) {}
        @Override
        public void onMultipartyStateChanged(boolean isMultiParty) {}
    }

    public static final int AUDIO_QUALITY_STANDARD = 1;
@@ -608,6 +611,17 @@ public abstract class Connection {
        }
    }

    /**
     * Notifies listeners of a change to the multiparty state of the connection..
     *
     * @param isMultiparty The participant(s).
     */
    public void updateMultipartyState(boolean isMultiparty) {
        for (Listener l : mListeners) {
            l.onMultipartyStateChanged(isMultiparty);
        }
    }

    /**
     * Notifies this Connection of a request to disconnect a participant of the conference managed
     * by the connection.
+18 −0
Original line number Diff line number Diff line
@@ -1221,6 +1221,24 @@ public final class ImsPhoneCallTracker extends CallTracker {
                    ", targetAccessTech=" + targetAccessTech + ", reasonInfo=" + reasonInfo);
            }
        }

        /**
         * Handles a change to the multiparty state for an {@code ImsCall}.  Notifies the associated
         * {@link ImsPhoneConnection} of the change.
         *
         * @param imsCall The IMS call.
         * @param isMultiParty {@code true} if the call became multiparty, {@code false}
         *      otherwise.
         */
        @Override
        public void onMultipartyStateChanged(ImsCall imsCall, boolean isMultiParty) {
            if (DBG) log("onMultipartyStateChanged to " + (isMultiParty ? "Y" : "N"));

            ImsPhoneConnection conn = findConnection(imsCall);
            if (conn != null) {
                conn.updateMultipartyState(isMultiParty);
            }
        }
    };

    /**
+16 −1
Original line number Diff line number Diff line
@@ -131,7 +131,6 @@ public class ImsPhoneConnection extends Connection {
                    imsCall.getCallProfile().getCallExtraInt(ImsCallProfile.EXTRA_OIR));
            mCnapNamePresentation = ImsCallProfile.OIRToPresentation(
                    imsCall.getCallProfile().getCallExtraInt(ImsCallProfile.EXTRA_CNAP));

            updateMediaCapabilities(imsCall);
        } else {
            mNumberPresentation = PhoneConstants.PRESENTATION_UNKNOWN;
@@ -537,6 +536,21 @@ public class ImsPhoneConnection extends Connection {
        return mImsCall != null && mImsCall.isMultiparty();
    }

    /**
     * Where {@link #isMultiparty()} is {@code true}, determines if this {@link ImsCall} is the
     * origin of the conference call (i.e. {@code #isConferenceHost()} is {@code true}), or if this
     * {@link ImsCall} is a member of a conference hosted on another device.
     *
     * @return {@code true} if this call is the origin of the conference call it is a member of,
     *      {@code false} otherwise.
     */
    public boolean isConferenceHost() {
        if (mImsCall == null) {
            return false;
        }
        return mImsCall.isConferenceHost();
    }

    /*package*/ ImsCall getImsCall() {
        return mImsCall;
    }
@@ -575,6 +589,7 @@ public class ImsPhoneConnection extends Connection {
        boolean updateParent = mParent.update(this, imsCall, state);
        boolean updateMediaCapabilities = updateMediaCapabilities(imsCall);
        boolean updateWifiState = updateWifiState();

        return updateParent || updateMediaCapabilities || updateWifiState;
    }