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

Commit ca55429b authored by Thomas Stuart's avatar Thomas Stuart Committed by Android (Google) Code Review
Browse files

Merge "remove transactional_hold_disconnects_unholdable flag" into main

parents 7f435313 d5e1e61a
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -17,17 +17,6 @@ flag {
  bug: "327038818"
}

# OWNER=tjstuart TARGET=24Q4
flag {
  name: "transactional_hold_disconnects_unholdable"
  namespace: "telecom"
  description: "Disconnect ongoing unholdable calls for CallControlCallbacks"
  bug: "340621152"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

# OWNER=tgunn TARGET=25Q2
flag {
  name: "enable_call_audio_watchdog"
+0 −38
Original line number Diff line number Diff line
@@ -4224,44 +4224,6 @@ public class CallsManager extends Call.ListenerBase
        }
    }

    /**
     * The transactional unflagged (original) code path to hold or swap the active call in favor of
     * a new call request. Refer to
     * {@link CallsManagerCallSequencingAdapter#transactionHoldPotentialActiveCallForNewCall}.
     */
    public void transactionHoldPotentialActiveCallForNewCallUnflagged(Call activeCall, Call newCall,
            OutcomeReceiver<Boolean, CallException> callback) {
        // before attempting CallsManager#holdActiveCallForNewCall(Call), check if it'll fail
        // early
        if (!canHold(activeCall) &&
                !(supportsHold(activeCall) && areFromSameSource(activeCall, newCall))) {
            String msg = "call does not support hold";
            Log.i(this, "transactionHoldPotentialActiveCallForNewCall: " + msg);
            callback.onError(new CallException(msg,
                    CallException.CODE_CANNOT_HOLD_CURRENT_ACTIVE_CALL));
            if (mFeatureFlags.enableCallExceptionAnomReports()) {
                mAnomalyReporter.reportAnomaly(CANNOT_HOLD_CURRENT_ACTIVE_CALL_ERROR_UUID, msg);
            }
            return;
        }

        // attempt to hold the active call
        if (!holdActiveCallForNewCall(newCall)) {
            String msg = "cannot hold active call failed";
            Log.i(this, "transactionHoldPotentialActiveCallForNewCall: " + msg);
            callback.onError(new CallException(msg,
                    CallException.CODE_CANNOT_HOLD_CURRENT_ACTIVE_CALL));
            if (mFeatureFlags.enableCallExceptionAnomReports()) {
                mAnomalyReporter.reportAnomaly(CANNOT_HOLD_CURRENT_ACTIVE_CALL_ERROR_UUID, msg);
            }
            return;
        }

        // officially mark the activeCall as held
        markCallAsOnHold(activeCall);
        callback.onResult(true);
    }

    public boolean canHoldOrSwapActiveCall(Call activeCall, Call newCall) {
        return canHold(activeCall) || sameSourceHoldCase(activeCall, newCall);
    }
+18 −25
Original line number Diff line number Diff line
@@ -199,8 +199,6 @@ public class CallsManagerCallSequencingAdapter {
            callback.onResult(true);
            return;
        }

        if (mFeatureFlags.transactionalHoldDisconnectsUnholdable()) {
        // prevent bad actors from disconnecting the activeCall. Instead, clients will need to
        // notify the user that they need to disconnect the ongoing call before making the
        // new call ACTIVE.
@@ -222,11 +220,6 @@ public class CallsManagerCallSequencingAdapter {
            mCallsManager.transactionHoldPotentialActiveCallForNewCallOld(newCall,
                    activeCall, callback);
        }
        } else {
            // The unflagged path (aka original code with no flags).
            mCallsManager.transactionHoldPotentialActiveCallForNewCallUnflagged(activeCall,
                    newCall, callback);
        }
    }

    /**
+0 −8
Original line number Diff line number Diff line
@@ -71,14 +71,6 @@ public class RequestNewActiveCallTransaction extends CallTransaction {
            return future;
        }

        if (!Flags.transactionalHoldDisconnectsUnholdable() &&
                mCallsManager.getActiveCall() != null) {
            future.complete(new CallTransactionResult(
                    CallException.CODE_CALL_CANNOT_BE_SET_TO_ACTIVE,
                    "Already an active call. Request hold on current active call."));
            return future;
        }

        mCallsManager.requestNewCallFocusAndVerify(mCall, new OutcomeReceiver<>() {
                    @Override
                    public void onResult(Boolean result) {
+0 −1
Original line number Diff line number Diff line
@@ -4016,7 +4016,6 @@ public class CallsManagerTest extends TelecomTestCase {
            boolean expectOnResult)
            throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(1);
        when(mFeatureFlags.transactionalHoldDisconnectsUnholdable()).thenReturn(true);
        when(mConnectionSvrFocusMgr.getCurrentFocusCall()).thenReturn(activeCall);
        mCallsManager.getCallSequencingAdapter().transactionHoldPotentialActiveCallForNewCall(
                newCall,