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

Commit dbca1bac authored by cdu's avatar cdu
Browse files

IMS: Add support to display Ims related call logs.

1) add ims call type in call log activities,
   using overlay contraled only diaplay for CMCC mode.
2) show "4G voice call" in call log details for VoLTE calls.

Change-Id: I5bc5f3651b27ed6a64d081188e45af492c72aa61
parent f9b2351f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@
    <string name="type_incoming_video" msgid="82323391702796181">"视频通话来电"</string>
    <string name="type_outgoing_video" msgid="2858140021680755266">"拨出的视频通话"</string>
    <string name="type_missed_video" msgid="954396897034220545">"错过的视频通话"</string>
    <string name="type_incoming_volte">4G语音通话来电</string>
    <string name="type_outgoing_volte">外拨4G语音通话</string>
    <string name="type_missed_volte">未接4G语音通话</string>
    <string name="type_voicemail" msgid="5153139450668549908">"语音信箱"</string>
    <string name="actionIncomingCall" msgid="6028930669817038600">"来电"</string>
    <string name="description_call_log_play_button" msgid="651182125650429846">"播放语音邮件"</string>
+2 −0
Original line number Diff line number Diff line
@@ -37,4 +37,6 @@
    <bool name="call_duration_enabled">true</bool>

    <bool name="call_durationtype_enabled">false</bool>

    <bool name="ims_call_type_enabled">false</bool>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -412,6 +412,15 @@
    <!-- Title for missed video call in call details screen [CHAR LIMIT=60] -->
    <string name="type_missed_video">Missed video call</string>

    <!-- Title for incoming 4G voice call in call details screen [CHAR LIMIT=60] -->
    <string name="type_incoming_volte">Incoming 4G voice call</string>

    <!-- Title for outgoing 4G voice call in call details screen [CHAR LIMIT=60] -->
    <string name="type_outgoing_volte">Outgoing 4G voice call</string>

    <!-- Title for missed 4G voice call in call details screen [CHAR LIMIT=60] -->
    <string name="type_missed_volte">Missed 4G voice call</string>

    <!-- Title for voicemail details screen -->
    <string name="type_voicemail">Voicemail</string>

+22 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.dialer.util.DialerUtils;
import com.google.common.collect.Lists;

import java.util.ArrayList;
import android.util.Log;

/**
 * Adapter for a ListView containing history items from the details of a call.
@@ -125,10 +126,30 @@ public class CallDetailHistoryAdapter extends BaseAdapter {
        int callType = details.callTypes[0];
        boolean isVideoCall = (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO
                && (CallUtil.isVideoEnabled(mContext) || CallUtil.isCSVTEnabled());

        boolean isVoLTE = (callType == Calls.INCOMING_IMS_TYPE) ||
                          (callType == Calls.OUTGOING_IMS_TYPE) ||
                          (callType == Calls.MISSED_IMS_TYPE);
        Log.d("CallDetailHistoryAdapter", "isVideoCall = " + isVideoCall
                    + ", isVoLTE = " + isVoLTE);
        callTypeIconView.clear();
        callTypeIconView.add(callType);
        callTypeIconView.setShowVideo(isVideoCall);
        boolean imsCallLogEnabled = mContext.getResources()
                .getBoolean(R.bool.ims_call_type_enabled);
        if (!imsCallLogEnabled) {
            switch (callType) {
                case Calls.INCOMING_IMS_TYPE:
                    callType = Calls.INCOMING_TYPE;
                    break;
                case Calls.OUTGOING_IMS_TYPE:
                    callType = Calls.OUTGOING_TYPE;
                    break;
                case Calls.MISSED_IMS_TYPE:
                    callType = Calls.MISSED_TYPE;
                    break;
                default:
            }
        }
        callTypeTextView.setText(mCallTypeHelper.getCallTypeText(callType, isVideoCall));
        // Set the date.
        CharSequence dateValue = DateUtils.formatDateRange(mContext, details.date, details.date,
+16 −2
Original line number Diff line number Diff line
@@ -215,10 +215,24 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler {
            if (where.length() > 0) {
                where.append(" AND ");
            }

            if ((callType == Calls.INCOMING_TYPE) || (callType == Calls.OUTGOING_TYPE)
                    || (callType == Calls.MISSED_TYPE)) {
                where.append(String.format("(%s = ? OR %s = ?)",
                        Calls.TYPE, Calls.TYPE));
            } else {
                // Add a clause to fetch only items of type voicemail.
                where.append(String.format("(%s = ?)", Calls.TYPE));
            }
            // Add a clause to fetch only items newer than the requested date
            selectionArgs.add(Integer.toString(callType));
            if (callType == Calls.INCOMING_TYPE) {
                selectionArgs.add(Integer.toString(Calls.INCOMING_IMS_TYPE));
            } else if (callType == Calls.OUTGOING_TYPE) {
                selectionArgs.add(Integer.toString(Calls.OUTGOING_IMS_TYPE));
            } else if (callType == Calls.MISSED_TYPE) {
                selectionArgs.add(Integer.toString(Calls.MISSED_IMS_TYPE));
            }
        }

        if (slotId > CALL_SUB_ALL) {
Loading