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

Commit 6b27bf15 authored by Ravi Paluri's avatar Ravi Paluri Committed by Gerrit - the friendly Code Review server
Browse files

IMS-VT: Remove one directional video call support

Remove one directional video call support thereby not giving
user the flexibility
1. to accept incoming video call as one way video call
2. to modify the call as one way video call
3. to accept incoming upgrade request as one way video call

Change-Id: I0c242d40a3d254b150ebeef354761fa67b17296f
CRs-Fixed: 1002286
parent 0e8b0923
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@
  ~ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  -->
<resources>
    <!-- Determines UI extensions for video calls should be used. -->
    <bool name="video_call_use_ext">true</bool>
    <!-- Config to show/hide Video quality toast -->
    <bool name="config_display_video_quality_toast">true</bool>
    <!-- Config to show/hide call session event toast like player start/stop -->
+24 −5
Original line number Diff line number Diff line
@@ -316,6 +316,11 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto

        VideoProfile videoProfile = new VideoProfile(VideoProfile.STATE_AUDIO_ONLY);
        videoCall.sendSessionModifyRequest(videoProfile);

        if (QtiCallUtils.useCustomVideoUi(getUi().getContext())) {
            InCallAudioManager.getInstance().onModifyCallClicked(mCall,
                    VideoProfile.STATE_AUDIO_ONLY);
        }
    }

    public void showDialpadClicked(boolean checked) {
@@ -341,6 +346,11 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
        VideoProfile videoProfile = new VideoProfile(currUnpausedVideoState);
        videoCall.sendSessionModifyRequest(videoProfile);
        mCall.setSessionModificationState(Call.SessionModificationState.WAITING_FOR_RESPONSE);

        if (QtiCallUtils.useCustomVideoUi(context)) {
            InCallAudioManager.getInstance().onModifyCallClicked(mCall,
                    currUnpausedVideoState);
        }
    }

    public void changeToVideo(int videoState) {
@@ -481,11 +491,20 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
        final boolean showMerge = call.can(
                android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE);
        final boolean useExt = QtiCallUtils.useExt(ui.getContext());

        final boolean useCustomVideoUi =
                QtiCallUtils.useCustomVideoUi(ui.getContext());
        final boolean isCallActive = call.getState() == Call.State.ACTIVE;
        final boolean showUpgradeToVideo = (!isVideo  && !useExt && hasVideoCallCapabilities(call))
                || (useExt && QtiCallUtils.hasVoiceOrVideoCapabilities(call)
                && (isCallActive || isCallOnHold));

        final boolean showUpgradeToVideo =
                /* When useExt is true, show upgrade button for an active/held
                   call if the call has either voice or video capabilities */
                ((useExt && QtiCallUtils.hasVoiceOrVideoCapabilities(call)) ||
                /* When useCustomVideoUi is true, show upgrade button for an active/held
                   voice call only if the current call has video capabilities */
                (useCustomVideoUi && !isVideo && hasVideoCallCapabilities(call))
                && (isCallActive || isCallOnHold)) ||
                /* When useExt and custom UI are false, default to Google behaviour */
                (!isVideo && !useExt && !useCustomVideoUi && hasVideoCallCapabilities(call));

        final boolean showDowngradeToAudio = isVideo && isDowngradeToAudioSupported(call);
        final int callState = call.getState();
@@ -524,7 +543,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
        ui.showButton(BUTTON_UPGRADE_TO_VIDEO, showUpgradeToVideo && !mEnhanceEnable);
        ui.showButton(BUTTON_DOWNGRADE_TO_AUDIO, showDowngradeToAudio && !useExt);
        ui.showButton(BUTTON_SWITCH_CAMERA, isVideo);
        ui.showButton(BUTTON_PAUSE_VIDEO, isVideo && !useExt);
        ui.showButton(BUTTON_PAUSE_VIDEO, isVideo && !useExt && !useCustomVideoUi);
        ui.showButton(BUTTON_DIALPAD, true);
        ui.showButton(BUTTON_MERGE, showMerge);
        ui.showButton(BUTTON_ADD_PARTICIPANT, showAddParticipant && !mEnhanceEnable);
+14 −2
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import java.util.ArrayList;

import org.codeaurora.internal.IExtTelephony;
import org.codeaurora.ims.QtiCallConstants;
import org.codeaurora.ims.utils.QtiImsExtUtils;

/**
 * This class contains Qti specific utiltity functions.
@@ -239,7 +240,18 @@ public class QtiCallUtils {
        if (context == null) {
            Log.w(context, "Context is null...");
        }
        return context != null && context.getResources().getBoolean(R.bool.video_call_use_ext);
        return context != null && QtiImsExtUtils.useExt(context);
    }

    /**
     * Checks the boolean flag in config file to figure out if custom video ui is required or
     * not
     */
    public static boolean useCustomVideoUi(Context context) {
        if (context == null) {
            Log.w(context, "Context is null...");
        }
        return context != null && QtiImsExtUtils.useCustomVideoUi(context);
    }

    /**
@@ -515,7 +527,7 @@ public class QtiCallUtils {

    /**
     * Returns true if local has the VT Receive and if remote capability has VT Transmit set i.e.
     * Local can transmit and remote can receive
     * Remote can transmit and local can receive
     */
    public static boolean hasReceiveVideoCapabilities(Call call) {
        return call != null &&