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

Commit 7f07f9f6 authored by Victor Chang's avatar Victor Chang
Browse files

Add work description into call state in InCallUI

Only description of incoming call and call ended are affected

BUG=26082618

Change-Id: Ic511aac339b02db4453e695bfc92ccad47a97c83
parent f9aea95a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@
    <string name="card_title_conf_call">Conference call</string>
    <!-- In-call screen: status label for an incoming call [CHAR LIMIT=25] -->
    <string name="card_title_incoming_call">Incoming call</string>
    <!-- In-call screen: status label for an incoming work call [CHAR LIMIT=25] -->
    <string name="card_title_incoming_work_call">Incoming work call</string>
    <!-- In-call screen: status label displayed briefly after a call ends [CHAR LIMIT=25] -->
    <string name="card_title_call_ended">Call ended</string>
    <!-- In-call screen: status label for call that's on hold [CHAR LIMIT=25] -->
+7 −4
Original line number Diff line number Diff line
@@ -714,11 +714,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
            Drawable callStateIcon,
            String gatewayNumber,
            boolean isWifi,
            boolean isConference) {
            boolean isConference,
            boolean isWorkCall) {
        boolean isGatewayCall = !TextUtils.isEmpty(gatewayNumber);
        CallStateLabel callStateLabel = getCallStateLabelFromState(state, videoState,
                sessionModificationState, disconnectCause, connectionLabel, isGatewayCall, isWifi,
                isConference);
                isConference, isWorkCall);

        Log.v(this, "setCallState " + callStateLabel.getCallStateLabel());
        Log.v(this, "AutoDismiss " + callStateLabel.isAutoDismissing());
@@ -1010,7 +1011,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
     */
    private CallStateLabel getCallStateLabelFromState(int state, int videoState,
            int sessionModificationState, DisconnectCause disconnectCause, String label,
            boolean isGatewayCall, boolean isWifi, boolean isConference) {
            boolean isGatewayCall, boolean isWifi, boolean isConference, boolean isWorkCall) {
        final Context context = getView().getContext();
        CharSequence callStateLabel = null;  // Label to display as part of the call banner

@@ -1068,7 +1069,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
                } else if (VideoUtils.isVideoCall(videoState)) {
                    callStateLabel = context.getString(R.string.notification_incoming_video_call);
                } else {
                    callStateLabel = context.getString(R.string.card_title_incoming_call);
                    callStateLabel =
                            context.getString(isWorkCall ? R.string.card_title_incoming_work_call
                                    : R.string.card_title_incoming_call);
                }
                break;
            case Call.State.DISCONNECTING:
+8 −3
Original line number Diff line number Diff line
@@ -318,7 +318,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
                    null,
                    null,
                    false /* isWifi */,
                    false /* isConference */);
                    false /* isConference */,
                    false /* isWorkCall */);
            getUi().showHdAudioIndicator(false);
        }

@@ -410,6 +411,9 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>

    private void updatePrimaryCallState() {
        if (getUi() != null && mPrimary != null) {
            boolean isWorkCall = mPrimary.hasProperty(PROPERTY_WORK_CALL)
                    || (mPrimaryContactInfo == null ? false
                            : mPrimaryContactInfo.userType == ContactsUtils.USER_TYPE_WORK);
            getUi().setCallState(
                    mPrimary.getState(),
                    mPrimary.getVideoState(),
@@ -419,7 +423,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
                    getCallStateIcon(),
                    getGatewayNumber(),
                    mPrimary.hasProperty(Details.PROPERTY_WIFI),
                    mPrimary.isConferenceCall());
                    mPrimary.isConferenceCall(),
                    isWorkCall);

            maybeShowHdAudioIcon();
            setCallbackNumber();
@@ -1108,7 +1113,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
        void setCallState(int state, int videoState, int sessionModificationState,
                DisconnectCause disconnectCause, String connectionLabel,
                Drawable connectionIcon, String gatewayNumber, boolean isWifi,
                boolean isConference);
                boolean isConference, boolean isWorkCall);
        void setPrimaryCallElapsedTime(boolean show, long duration);
        void setPrimaryName(String name, boolean nameIsNumber);
        void setPrimaryImage(Drawable image, boolean isVisible);