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

Commit 96d3afba authored by Zhao Fan's avatar Zhao Fan Committed by Linux Build Service Account
Browse files

IMS: Pop up reminder after max attendees for conference call

Pop up "Number of attendees exceed limitation" after max
attendees for conference call via "Add call".

Change-Id: Ic5fb6e6b5db3464759ca7de2a6aca7e519a32300
CRs-Fixed: 1004410
parent de5e7546
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -196,4 +196,5 @@
    <string name="closed_today_at" msgid="4060072663433467233">"已于今天<xliff:g id="CLOSE_TIME">%s</xliff:g>结束营业"</string>
    <string name="open_now" msgid="4615706338669555999">"营业中"</string>
    <string name="closed_now" msgid="2635314668145282080">"现已结束营业"</string>
    <string name="too_many_recipients">4G会议电话的参与人数上限为6人。</string>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -536,4 +536,5 @@
    <string name="call_state_unknown">Unknown</string>
    <string name="call_state_disconnecting">Disconnecting</string>
    <string name="call_state_disconnected">Disconnected</string>
    <string name="too_many_recipients">The maximum allowed participants in a 4G conference call are 6.</string>
</resources>
+20 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.telecom.InCallService.VideoCall;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
import android.telecom.VideoProfile;
import android.widget.Toast;

import com.android.contacts.common.compat.CallSdkCompat;
import com.android.contacts.common.compat.SdkVersionOverride;
@@ -66,6 +67,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
    private Call mCall;
    private boolean mAutomaticallyMuted = false;
    private boolean mPreviousMuteState = false;
    private static final int MAX_PARTICIPANTS_LIMIT = 6;

    // NOTE: Capability constant definition has been duplicated to avoid bundling
    // the Dialer with Frameworks.
@@ -257,6 +259,24 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto
    }

    public void mergeClicked() {
        if (getUi().getContext().getResources().getBoolean(
                R.bool.add_multi_participants_enabled)){
            int participantsCount = 0;
            if (mCall.isConferenceCall()) {
                participantsCount = mCall.getChildCallIds().size();
            } else {
                Call backgroundCall = CallList.getInstance().getBackgroundCall();
                if (backgroundCall != null && backgroundCall.isConferenceCall()) {
                    participantsCount = backgroundCall.getChildCallIds().size();
                }
            }
            Log.i(this, "Number of participantsCount is " + participantsCount);
            if (participantsCount >= MAX_PARTICIPANTS_LIMIT) {
                Toast.makeText(getUi().getContext(),
                        R.string.too_many_recipients, Toast.LENGTH_SHORT).show();
                return;
            }
         }
        TelecomAdapter.getInstance().merge(mCall.getId());
    }