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

Commit 162a9a0e authored by Ravi Paluri's avatar Ravi Paluri
Browse files

IMS-VT: Handle buttons display in InCall Screen

1. If number of incall buttons to be shown are more than the
   threshold, move the add participant button inside more menu

2. Change the order of downgrade to audio and switch camera
   options so that downgrade to audio icon is always visible
   as an icon when in a video call

Change-Id: I43495693906833838f2e0fdf9c328f40708aca12
CRs-Fixed: 959132
parent 06fe7f09
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_RECORD;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_RXTX_VIDEO_CALL;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_RX_VIDEO_CALL;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_VO_VIDEO_CALL;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_ADD_PARTICIPANT;

import android.content.Context;
import android.content.res.ColorStateList;
@@ -95,8 +96,8 @@ public class CallButtonFragment
        public static final int BUTTON_HOLD = 3;
        public static final int BUTTON_SWAP = 4;
        public static final int BUTTON_UPGRADE_TO_VIDEO = 5;
        public static final int BUTTON_SWITCH_CAMERA = 6;
        public static final int BUTTON_DOWNGRADE_TO_AUDIO = 7;
        public static final int BUTTON_DOWNGRADE_TO_AUDIO = 6;
        public static final int BUTTON_SWITCH_CAMERA = 7;
        public static final int BUTTON_ADD_CALL = 8;
        public static final int BUTTON_MERGE = 9;
        public static final int BUTTON_PAUSE_VIDEO = 10;
@@ -108,7 +109,8 @@ public class CallButtonFragment
        public static final int BUTTON_RXTX_VIDEO_CALL = 16;
        public static final int BUTTON_RX_VIDEO_CALL = 17;
        public static final int BUTTON_VO_VIDEO_CALL = 18;
        public static final int BUTTON_COUNT = 19;
        public static final int BUTTON_ADD_PARTICIPANT = 19;
        public static final int BUTTON_COUNT = 20;
    }

    private SparseIntArray mButtonVisibilityMap = new SparseIntArray(BUTTON_COUNT);
@@ -492,6 +494,8 @@ public class CallButtonFragment
            return mSwitchCameraButton;
        } else if (id == BUTTON_ADD_CALL) {
            return mAddCallButton;
        } else if (id == BUTTON_ADD_PARTICIPANT) {
            return mAddParticipantButton;
        } else if (id == BUTTON_MERGE) {
            return mMergeButton;
        } else if (id == BUTTON_PAUSE_VIDEO) {
@@ -538,10 +542,6 @@ public class CallButtonFragment
        mPauseVideoButton.setSelected(isPaused);
    }

    public void enableAddParticipant(boolean show) {
        mAddParticipantButton.setVisibility(show ? View.VISIBLE : View.GONE);
    }

    @Override
    public void setMute(boolean value) {
        if (mMuteButton.isSelected() != value) {
+3 −3
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_RECORD;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_RXTX_VIDEO_CALL;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_RX_VIDEO_CALL;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_VO_VIDEO_CALL;
import static com.android.incallui.CallButtonFragment.Buttons.BUTTON_ADD_PARTICIPANT;

import android.content.Context;
import android.os.Build;
@@ -526,9 +527,9 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
        ui.showButton(BUTTON_PAUSE_VIDEO, isVideo && !useExt);
        ui.showButton(BUTTON_DIALPAD, true);
        ui.showButton(BUTTON_MERGE, showMerge);
        ui.enableAddParticipant(showAddParticipant && !mEnhanceEnable);

        ui.showButton(BUTTON_ADD_PARTICIPANT, showAddParticipant && !mEnhanceEnable);
        ui.showButton(BUTTON_RECORD, showRecord);

        /* Depending on the transfer capabilities, display the corresponding buttons */
        if ((callTransferCapabilities & QtiImsExtUtils.QTI_IMS_CONSULTATIVE_TRANSFER) != 0) {
            ui.showButton(BUTTON_TRANSFER_BLIND, true);
@@ -609,7 +610,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
        void setHold(boolean on);
        void setCameraSwitched(boolean isBackFacingCamera);
        void setVideoPaused(boolean isPaused);
        void enableAddParticipant(boolean show);
        void setAudio(int mode);
        void setSupportedAudio(int mask);
        void displayDialpad(boolean on, boolean animate);