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

Commit cdfad1fa authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Remove code which prevents making a video call when one is in progress.

This restriction doesn't match how VT works; it is reasonable to make
multiple VT calls at the same time.

Bug: 27073894
Change-Id: Ief68b8cae7cdb2352e33cbac761fad2d75dbd063
parent 5abd4681
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -64,9 +64,6 @@ public class CallIntentProcessor {
            Context context,
            CallsManager callsManager,
            Intent intent) {
        if (shouldPreventDuplicateVideoCall(context, callsManager, intent)) {
            return;
        }

        Uri handle = intent.getData();
        String scheme = handle.getScheme();
@@ -178,31 +175,4 @@ public class CallIntentProcessor {
            context.startActivityAsUser(errorIntent, UserHandle.CURRENT);
        }
    }

    /**
     * Whether an outgoing video call should be prevented from going out. Namely, don't allow an
     * outgoing video call if there is already an ongoing video call. Notify the user if their call
     * is not sent.
     *
     * @return {@code true} if the outgoing call is a video call and should be prevented from going
     *     out, {@code false} otherwise.
     */
    private static boolean shouldPreventDuplicateVideoCall(
            Context context,
            CallsManager callsManager,
            Intent intent) {
        int intentVideoState = intent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE,
                VideoProfile.STATE_AUDIO_ONLY);
        if (VideoProfile.isAudioOnly(intentVideoState)
                || !callsManager.hasVideoCall()) {
            return false;
        } else {
            // Display an error toast to the user.
            Toast.makeText(
                    context,
                    context.getResources().getString(R.string.duplicate_video_call_not_allowed),
                    Toast.LENGTH_LONG).show();
            return true;
        }
    }
}