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

Commit c2dc86a5 authored by Zhu Youhua's avatar Zhu Youhua Committed by Gerrit - the friendly Code Review server
Browse files

VideoCall: preview before upgrade video call is accepted.

preview myself before upgrade video call is handled by the receiver
and stop review if the receiver has reject or error occurs.

Change-Id: I4dbf5e469c725024bc8376c6a91bafda3a9f993e
CRs-Fixed: 1057509
parent fbc87c0a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -52,4 +52,6 @@
    <bool name="add_multi_participants_enabled">false</bool>
    <!-- Config to add participant only in conferencall call-->
    <bool name="add_participant_only_in_conference">false</bool>
    <!-- Config to if show preview before the receiver accepts a show me upgrade video call -->
    <bool name="config_enable_modify_call_preview">false</bool>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ public class AnswerPresenter extends Presenter<AnswerPresenter.AnswerUi>
        }
    }

    public void onSessionModificationStateChange(int sessionModificationState) {
    public void onSessionModificationStateChange(Call call, int sessionModificationState) {
        boolean isUpgradePending = sessionModificationState ==
                Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST;

+2 −2
Original line number Diff line number Diff line
@@ -343,19 +343,19 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
    }

    public void changeToVideo(int videoState) {
        final Context context = getUi().getContext();
        if(mCall == null) {
            return;
        }

        if(VideoProfile.isVideo(videoState) &&
                !PresenceHelper.getVTCapability(mCall.getNumber())) {
            Context context = getUi().getContext();
            Toast.makeText(context,context.getString(R.string.video_call_cannot_upgrade),
                    Toast.LENGTH_SHORT).show();
            return;
        }
        final VideoProfile videoProfile = new VideoProfile(videoState);
        QtiCallUtils.changeToVideoCall(mCall, videoProfile);
        QtiCallUtils.changeToVideoCall(mCall, videoProfile, context);
    }
    /**
     * Switches the camera between the front-facing and back-facing camera.
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
     * @param sessionModificationState The new session modification state.
     */
    @Override
    public void onSessionModificationStateChange(int sessionModificationState) {
    public void onSessionModificationStateChange(Call call, int sessionModificationState) {
        Log.d(this, "onSessionModificationStateChange : sessionModificationState = " +
                sessionModificationState);

+2 −2
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class CallList {
        final List<CallUpdateListener> listeners = mCallUpdateListenerMap.get(call.getId());
        if (listeners != null) {
            for (CallUpdateListener listener : listeners) {
                listener.onSessionModificationStateChange(sessionModificationState);
                listener.onSessionModificationStateChange(call, sessionModificationState);
            }
        }
    }
@@ -717,7 +717,7 @@ public class CallList {
         *
         * @param sessionModificationState The new session modification state.
         */
        public void onSessionModificationStateChange(int sessionModificationState);
        public void onSessionModificationStateChange(Call call, int sessionModificationState);

        /**
         * Notifies of a change to the last forwarded number for a call.
Loading