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

Commit 49f2952d authored by Matthieu Baglin's avatar Matthieu Baglin Committed by Tyler Gunn
Browse files

InCallUi basic video call fixes



This patch resolves some issues in video call establishment
on L MR1 InCallUi.

Change-Id: Ib72894f7e81932200b09b9995d169ef1124fc5b5
Signed-off-by: default avatarMatthieu Baglin <matthieu.baglin@intel.com>
parent 7583ceb3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -371,8 +371,12 @@ public final class Call {
    }

    public boolean isVideoCall(Context context) {
        return CallUtil.isVideoEnabled(context) &&
                VideoProfile.VideoState.isBidirectional(getVideoState());
        // We want to show Video call buttons even if only one direction is enabled
        // (That is what is happening when we receive a video call for example)
        return CallUtil.isVideoEnabled(context) && (
            VideoProfile.VideoState.isBidirectional(getVideoState()) ||
            VideoProfile.VideoState.isReceptionEnabled(getVideoState()) ||
            VideoProfile.VideoState.isTransmissionEnabled(getVideoState()));
    }

    public void setSessionModificationState(int state) {
+1 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ public class GlowPadWrapper extends GlowPadView implements GlowPadView.OnTrigger
                mTargetTriggered = true;
                break;
            case R.drawable.ic_videocam:
            case R.drawable.ic_lockscreen_answer_video:
                mAnswerListener.onAnswer(VideoProfile.VideoState.BIDIRECTIONAL, getContext());
                mTargetTriggered = true;
                break;
+8 −6
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter,
            // orientation change.
            if (mSavedSurfaceTexture == null) {
                mSavedSurfaceTexture = surfaceTexture;
                surfaceCreated = createSurface();
                surfaceCreated = createSurface(width, height);
            } else {
                // A saved SurfaceTexture was found.
                surfaceCreated = true;
@@ -266,18 +266,20 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter,
            mHeight = height;

            if (mSavedSurfaceTexture != null) {
                createSurface();
                createSurface(width, height);
            }
        }

        /**
         * Creates the {@link Surface}, adjusting the {@link SurfaceTexture} buffer size.
         * @param width The width of the surface to create.
         * @param height The height of the surface to create.
         */
        private boolean createSurface() {
            if (mWidth != DIMENSIONS_NOT_SET && mHeight != DIMENSIONS_NOT_SET &&
                    mSavedSurfaceTexture != null) {
        private boolean createSurface(int width, int height) {
            if (width != DIMENSIONS_NOT_SET && height != DIMENSIONS_NOT_SET
                    && mSavedSurfaceTexture != null) {

                mSavedSurfaceTexture.setDefaultBufferSize(mWidth, mHeight);
                mSavedSurfaceTexture.setDefaultBufferSize(width, height);
                mSavedSurface = new Surface(mSavedSurfaceTexture);
                return true;
            }