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

Commit d5914723 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Support treating a conference as a single party call. am: 9da18008 am: 276fd621

am: 021f06b6

Change-Id: Ia4b364b20a8694da88efff66d7d1cd20c66e0eeb
parents 1e1ddc75 021f06b6
Loading
Loading
Loading
Loading
+17 −1
Original line number Original line Diff line number Diff line
@@ -132,6 +132,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        void onConnectionManagerPhoneAccountChanged(Call call);
        void onConnectionManagerPhoneAccountChanged(Call call);
        void onPhoneAccountChanged(Call call);
        void onPhoneAccountChanged(Call call);
        void onConferenceableCallsChanged(Call call);
        void onConferenceableCallsChanged(Call call);
        void onConferenceStateChanged(Call call, boolean isConference);
        boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout);
        boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout);
        void onHoldToneRequested(Call call);
        void onHoldToneRequested(Call call);
        void onConnectionEvent(Call call, String event, Bundle extras);
        void onConnectionEvent(Call call, String event, Bundle extras);
@@ -201,6 +202,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        @Override
        @Override
        public void onConferenceableCallsChanged(Call call) {}
        public void onConferenceableCallsChanged(Call call) {}
        @Override
        @Override
        public void onConferenceStateChanged(Call call, boolean isConference) {}
        @Override
        public boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout) {
        public boolean onCanceledViaNewOutgoingCallBroadcast(Call call, long disconnectionTimeout) {
            return false;
            return false;
        }
        }
@@ -1472,7 +1475,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
                        "capable when not supported by the phone account.");
                        "capable when not supported by the phone account.");
                connectionCapabilities = removeVideoCapabilities(connectionCapabilities);
                connectionCapabilities = removeVideoCapabilities(connectionCapabilities);
            }
            }

            int previousCapabilities = mConnectionCapabilities;
            int previousCapabilities = mConnectionCapabilities;
            mConnectionCapabilities = connectionCapabilities;
            mConnectionCapabilities = connectionCapabilities;
            for (Listener l : mListeners) {
            for (Listener l : mListeners) {
@@ -3107,6 +3109,20 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        }
        }
    }
    }


    /**
     * Sets whether this {@link Call} is a conference or not.
     * @param isConference
     */
    public void setConferenceState(boolean isConference) {
        mIsConference = isConference;
        Log.addEvent(this, LogUtils.Events.CONF_STATE_CHANGED, "isConference=" + isConference);
        // Ultimately CallsManager needs to know so it can update the "add call" state and inform
        // the UI to update itself.
        for (Listener l : mListeners) {
            l.onConferenceStateChanged(this, isConference);
        }
    }

    /**
    /**
     * Sets the video history based on the state and state transitions of the call. Always add the
     * Sets the video history based on the state and state transitions of the call. Always add the
     * current video state to the video state history during a call transition except for the
     * current video state to the video state history during a call transition except for the
+10 −0
Original line number Original line Diff line number Diff line
@@ -146,6 +146,7 @@ public class CallsManager extends Call.ListenerBase
        void onExternalCallChanged(Call call, boolean isExternalCall);
        void onExternalCallChanged(Call call, boolean isExternalCall);
        void onDisconnectedTonePlaying(boolean isTonePlaying);
        void onDisconnectedTonePlaying(boolean isTonePlaying);
        void onConnectionTimeChanged(Call call);
        void onConnectionTimeChanged(Call call);
        void onConferenceStateChanged(Call call, boolean isConference);
    }
    }


    /** Interface used to define the action which is executed delay under some condition. */
    /** Interface used to define the action which is executed delay under some condition. */
@@ -818,6 +819,15 @@ public class CallsManager extends Call.ListenerBase
        }
        }
    }
    }


    @Override
    public void onConferenceStateChanged(Call call, boolean isConference) {
        // Conference changed whether it is treated as a conference or not.
        updateCanAddCall();
        for (CallsManagerListener listener : mListeners) {
            listener.onConferenceStateChanged(call, isConference);
        }
    }

    @Override
    @Override
    public void onIsVoipAudioModeChanged(Call call) {
    public void onIsVoipAudioModeChanged(Call call) {
        for (CallsManagerListener listener : mListeners) {
        for (CallsManagerListener listener : mListeners) {
+4 −0
Original line number Original line Diff line number Diff line
@@ -96,4 +96,8 @@ public class CallsManagerListenerBase implements CallsManager.CallsManagerListen
    @Override
    @Override
    public void onConnectionTimeChanged(Call call) {
    public void onConnectionTimeChanged(Call call) {
    }
    }

    @Override
    public void onConferenceStateChanged(Call call, boolean isConference) {
    }
}
}
+21 −0
Original line number Original line Diff line number Diff line
@@ -990,6 +990,27 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                Log.endSession();
                Log.endSession();
            }
            }
        }
        }

        @Override
        public void setConferenceState(String callId, boolean isConference,
                Session.Info sessionInfo) throws RemoteException {
            Log.startSession(sessionInfo, "CSW.sCS");
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
                    Call call = mCallIdMapper.getCall(callId);
                    if (call != null) {
                        call.setConferenceState(isConference);
                    }
                }
            } catch (Throwable t) {
                Log.e(ConnectionServiceWrapper.this, t, "");
                throw t;
            } finally {
                Binder.restoreCallingIdentity(token);
                Log.endSession();
            }
        }
    }
    }


    private final Adapter mAdapter = new Adapter();
    private final Adapter mAdapter = new Adapter();
+6 −0
Original line number Original line Diff line number Diff line
@@ -972,6 +972,12 @@ public class InCallController extends CallsManagerListenerBase {
        updateCall(call);
        updateCall(call);
    }
    }


    @Override
    public void onConferenceStateChanged(Call call, boolean isConference) {
        Log.d(this, "onConferenceStateChanged %s ,isConf=%b", call, isConference);
        updateCall(call);
    }

    void bringToForeground(boolean showDialpad) {
    void bringToForeground(boolean showDialpad) {
        if (!mInCallServices.isEmpty()) {
        if (!mInCallServices.isEmpty()) {
            for (IInCallService inCallService : mInCallServices.values()) {
            for (IInCallService inCallService : mInCallServices.values()) {
Loading