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

Commit 5210d96e authored by Grant Menke's avatar Grant Menke Committed by Android (Google) Code Review
Browse files

Revert "Ignore requests to remove a connMgr call when there are pending connection attempts."

This reverts commit 28cd9add.

Reason for revert: auto merged before we could apply an update 

Change-Id: I807c1ef889c63c71acd482148e8854978cdf839d
parent 28cd9add
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -2540,20 +2540,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        }
    }

    boolean completedProcessingAllAttempts() {
        if (mCreateConnectionProcessor != null) {
            return (!mCreateConnectionProcessor.isCallTimedOut() &&
                    mCreateConnectionProcessor.isProcessingComplete());
        } else {
            // If mCreateConnectionProcessor is null then there are no attempts to process:
            return true;
        }
    }

    boolean haveAnyAttemptsUsedConnectionManager() {
        return mCreateConnectionProcessor.haveAnyAttemptsUsedConnectionManager();
    }

    /**
     * Starts the create connection sequence. Upon completion, there should exist an active
     * connection through a connection service (or the call will have failed).
+1 −10
Original line number Diff line number Diff line
@@ -385,18 +385,9 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                            mCallsManager.markCallAsDisconnected(
                                    call, new DisconnectCause(DisconnectCause.REMOTE));
                        }
                        if (!call.completedProcessingAllAttempts() && call.isEmergencyCall() &&
                                call.haveAnyAttemptsUsedConnectionManager()) {
                            // This is the first attempt of an emergency call via a connection
                            // manager. Skip removing the call for now to allow the second attempt
                            // to process OTT:
                            Log.i(this, "removeCall: emergency connMgr call has "
                                    + "not completed processing all attempts so skipping removal");
                        } else {
                        mCallsManager.markCallAsRemoved(call);
                    }
                }
                }
            } catch (Throwable t) {
                Log.e(ConnectionServiceWrapper.this, t, "");
                throw t;
+3 −15
Original line number Diff line number Diff line
@@ -63,8 +63,6 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
        // The PhoneAccount which we will tell the target connection service to use
        // for attempting to make the actual phone call
        public final PhoneAccountHandle targetPhoneAccount;
        // This field will be set to true if this call attempt used a connection manager
        public boolean isConnectionManager = false;

        public CallAttemptRecord(
                PhoneAccountHandle connectionManagerPhoneAccount,
@@ -75,9 +73,9 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {

        @Override
        public String toString() {
            return "CallAttemptRecord( isConnectionManager=[" + isConnectionManager + "], "
                    + "connMgrPhAcc=[" + connectionManagerPhoneAccount + "], targetPhAcc=["
                    + targetPhoneAccount + "])";
            return "CallAttemptRecord("
                    + Objects.toString(connectionManagerPhoneAccount) + ","
                    + Objects.toString(targetPhoneAccount) + ")";
        }

        /**
@@ -202,15 +200,6 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
        return mAttemptRecordIterator.hasNext();
    }

    boolean haveAnyAttemptsUsedConnectionManager() {
        for (CallAttemptRecord attemptRecord : mAttemptRecords) {
            if (attemptRecord.isConnectionManager) {
                return true;
            }
        }
        return false;
    }

    void continueProcessingIfPossible(CreateConnectionResponse response,
            DisconnectCause disconnectCause) {
        Log.v(this, "continueProcessingIfPossible");
@@ -522,7 +511,6 @@ public class CreateConnectionProcessor implements CreateConnectionResponse {
                            && !mAttemptRecords.contains(callAttemptRecord)) {
                        Log.i(this, "Will try Connection Manager account %s for emergency",
                                callManager);
                        callAttemptRecord.isConnectionManager = true;
                        mAttemptRecords.add(callAttemptRecord);
                    }
                }