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

Commit bd3cae59 authored by Pengquan Meng's avatar Pengquan Meng
Browse files

Integrate connectionServiceFocusManager into call flow

This changed allows multiple calls existed at the same time by
mataining the ConnectionService focus.

design doc: go/android-telecom-3p-enhancements
Bug: 69651192
Test: unit test

Change-Id: Ifcf64664f61d1b792daa1cab504d9045f2dbc975
Merged-In: Ifcf64664f61d1b792daa1cab504d9045f2dbc975
parent 43f20c39
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1762,7 +1762,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
    /**
     * Puts the call on hold if it is currently active.
     */
    void hold() {
    @VisibleForTesting
    public void hold() {
        if (mState == CallState.ACTIVE) {
            if (mConnectionService != null) {
                mConnectionService.hold(this);
@@ -1777,7 +1778,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
    /**
     * Releases the call from hold if it is currently active.
     */
    void unhold() {
    @VisibleForTesting
    public void unhold() {
        if (mState == CallState.ON_HOLD) {
            if (mConnectionService != null) {
                mConnectionService.unhold(this);
@@ -2781,6 +2783,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        return mOriginalConnectionId;
    }

    ConnectionServiceFocusManager getConnectionServiceFocusManager() {
        return mCallsManager.getConnectionServiceFocusManager();
    }

    /**
     * Determines if a {@link Call}'s capabilities bitmask indicates that video is supported either
     * remotely or locally.
+228 −139

File changed.

Preview size limit exceeded, changes collapsed.

+37 −13

File changed.

Preview size limit exceeded, changes collapsed.

+42 −4

File changed.

Preview size limit exceeded, changes collapsed.

+13 −1
Original line number Diff line number Diff line
@@ -214,7 +214,19 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
                mCall.setConnectionService(mService);
                setTimeoutIfNeeded(mService, attempt);

                mService.createConnection(mCall, this);
                // Start to create the connection after the ConnectionService of the call has gained
                // the focus.
                mCall.getConnectionServiceFocusManager().requestFocus(
                        mCall,
                        new CallsManager.RequestCallback(new CallsManager.PendingAction() {
                            @Override
                            public void performAction() {
                                Log.d(this, "perform create connection");
                                mService.createConnection(
                                        mCall,
                                        CreateConnectionProcessor.this);
                            }
                        }));
            }
        } else {
            Log.v(this, "attemptNextPhoneAccount, no more accounts, failing");
Loading