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

Commit ec6f82f0 authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

DSDA: Modify max outgoing call restriction errors

Modifies how we portray the max outgoing call restrictions for when we
have an ongoing call being set up and we place another call. The message
should indicate that the user needs to wait for the call to be answered
or should disconnect it before placing a new call. Likewise, for when we
have a held + active call and try placing a 3rd outgoing call, we should
indicate to the user that merging the calls is not possible for
cross-sim based calling.

Bug: 403293836
Test: Manual test verification for both scenarios
Flag: EXEMPT bugfix
Change-Id: I7d7659fa576c2c8b69e0ea0085f4521b5edf7d35
parent 321a6ac4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -419,7 +419,13 @@
    <string name="call_streaming_notification_action_switch_here">Switch here</string>
    <!-- In-call screen: error message shown when the user attempts to place a call, but calling has
         been disabled using a debug property. -->
    <string name="callFailed_too_many_calls">Cannot place a call as there are already two calls in progress. Disconnect one of the calls or merge them into a conference prior to placing a new call.</string>
    <string name="callFailed_outgoing_already_present">Cannot place a call as there is already another call connecting. Wait for the call to be answered or disconnect it before placing another call.</string>
    <!-- In-call screen: error message shown when the user attempts to place a call, but calling has
         been disabled using a debug property. -->
    <string name="callFailed_too_many_calls_include_merge">Cannot place a call as there are already two calls in progress. Disconnect one of the calls or merge them into a conference prior to placing a new call.</string>
    <!-- In-call screen: error message shown when the user attempts to place a call, but calling has
             been disabled using a debug property. -->
    <string name="callFailed_too_many_calls_exclude_merge">Cannot place a call as there are already two calls in progress. Disconnect one of the calls prior to placing a new call.</string>
    <!-- In-call screen: error message shown when the user attempts to place a call, but the live
         call cannot be held. -->
    <string name="callFailed_unholdable_call">Cannot place a call as there is an unholdable call. Disconnect the call prior to placing a new call.</string>
+18 −6
Original line number Diff line number Diff line
@@ -761,7 +761,7 @@ public class CallSequencingController {
                        "Disconnecting call in SELECT_PHONE_ACCOUNT in favor of new "
                                + "outgoing call.");
            }
            showErrorDialogForMaxOutgoingCall(call);
            showErrorDialogForMaxOutgoingCallOutgoingPresent(call);
            return CompletableFuture.completedFuture(false);
        }

@@ -778,7 +778,9 @@ public class CallSequencingController {
        // different failure cause. Now, we perform this early check to ensure the right max
        // outgoing call restriction error is displayed instead.
        if (mCallsManager.hasMaximumManagedHoldingCalls(call) && !mCallsManager.canHold(liveCall)) {
            showErrorDialogForMaxOutgoingCall(call);
            Call heldCall = mCallsManager.getFirstCallWithState(CallState.ON_HOLD);
            showErrorDialogForMaxOutgoingCallTooManyCalls(call,
                    arePhoneAccountsSame(heldCall, liveCall));
            return CompletableFuture.completedFuture(false);
        }

@@ -1101,10 +1103,20 @@ public class CallSequencingController {
        }
    }

    private void showErrorDialogForMaxOutgoingCall(Call call) {
        int resourceId = R.string.callFailed_too_many_calls;
        String reason = " there are two calls already in progress. Disconnect one of the calls "
                + "or merge the calls.";
    private void showErrorDialogForMaxOutgoingCallOutgoingPresent(Call call) {
        int resourceId = R.string.callFailed_outgoing_already_present;
        String reason = " there is already another call connecting. Wait for the "
                + "call to be answered or disconnect before placing another call.";
        showErrorDialogForFailedCall(call, CallFailureCause.MAX_OUTGOING_CALLS, resourceId, reason);
    }

    private void showErrorDialogForMaxOutgoingCallTooManyCalls(
            Call call, boolean arePhoneAccountsSame) {
        int resourceId = arePhoneAccountsSame
                ? R.string.callFailed_too_many_calls_include_merge
                : R.string.callFailed_too_many_calls_exclude_merge;
        String reason = " there are two calls already in progress. Disconnect one "
                + "of the calls or merge the calls (if possible).";
        showErrorDialogForFailedCall(call, CallFailureCause.MAX_OUTGOING_CALLS, resourceId, reason);
    }