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

Commit bd80a45d authored by Grant Menke's avatar Grant Menke
Browse files

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

This CL ensures Telecom checks if there are any pending connection attempts before we process the requesto to remove a call. This fixes a race condition issue during an MO Fi call we first attempt to place the call via Telephony CS, if that times ouyt after 25s, we will instead attempt to place the call via Tycho CS. This CL ensures we dont remove the call when that timeout triggers before we have time initiate the 2nd connection attempt via Fi.

Test: manual
Bug: 329462734
Flag: com.android.server.telecom.flags.updated_rcs_call_count_tracking
Change-Id: Ib4ff5aefb79e5bed4e39c3929721cc494a95ddb8
parent 4cbc4447
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2540,6 +2540,17 @@ 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;
        }

    }

    /**
     * Starts the create connection sequence. Upon completion, there should exist an active
     * connection through a connection service (or the call will have failed).
+11 −1
Original line number Diff line number Diff line
@@ -385,7 +385,15 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                            mCallsManager.markCallAsDisconnected(
                                    call, new DisconnectCause(DisconnectCause.REMOTE));
                        }
                        if (!mFlags.updatedRcsCallCountTracking()){
                            mCallsManager.markCallAsRemoved(call);
                        } else if (call.completedProcessingAllAttempts()
                                || !call.isEmergencyCall()) {
                            mCallsManager.markCallAsRemoved(call);
                        } else {
                            Log.i(this, "removeCall: emergency call has not "
                                    + "completed processing all attempts so skipping removal");
                        }
                    }
                }
            } catch (Throwable t) {
@@ -1349,6 +1357,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
    private final CallsManager mCallsManager;
    private final AppOpsManager mAppOpsManager;
    private final Context mContext;
    private final FeatureFlags mFlags;

    private ConnectionServiceFocusManager.ConnectionServiceFocusListener mConnSvrFocusListener;

@@ -1383,6 +1392,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
        mCallsManager = callsManager;
        mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        mContext = context;
        mFlags = featureFlags;
    }

    /** See {@link IConnectionService#addConnectionServiceAdapter}. */