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

Commit e2980fcf authored by mengsun's avatar mengsun Committed by Ed Carrigan
Browse files

CallLog: Support for active time in CDMA call log

Display the type(Active time/Call out time) in call log of CDMA call.

Change-Id: Icdc459b0e6aff2ae7f9d44395b6886232de16efe
parent 28230632
Loading
Loading
Loading
Loading
+46 −2
Original line number Diff line number Diff line
@@ -180,12 +180,31 @@ public class CallLog {
         */
        public static final String DATE = "date";

        /**
         * duration type for active.
         * @hide
         */
        public static final int DURATION_TYPE_ACTIVE = 0;

        /**
         * duration type for call out time.
         * @hide
         */
        public static final int DURATION_TYPE_CALLOUT = 1;

        /**
         * The duration of the call in seconds
         * <P>Type: INTEGER (long)</P>
         */
        public static final String DURATION = "duration";

        /**
         * The type of the duration
         * <P>Type: INTEGER (long)</P>
         * @hide
         */
        public static final String DURATION_TYPE = "duration_type";

        /**
         * Whether or not the call has been acknowledged
         * <P>Type: INTEGER (boolean)</P>
@@ -312,8 +331,8 @@ public class CallLog {
         */
        public static Uri addCall(CallerInfo ci, Context context, String number,
                int presentation, int callType, long start, int duration) {
            return addCall(ci, context, number, presentation,
                    callType, start, duration, MSimConstants.DEFAULT_SUBSCRIPTION);
            return addCall(ci, context, number, presentation, callType, start, duration,
                    MSimConstants.DEFAULT_SUBSCRIPTION, DURATION_TYPE_ACTIVE);
        }

        /**
@@ -334,6 +353,30 @@ public class CallLog {
         */
        public static Uri addCall(CallerInfo ci, Context context, String number,
                int presentation, int callType, long start, int duration, int subscription) {
            return addCall(ci, context, number, presentation, callType, start, duration,
                    subscription, DURATION_TYPE_ACTIVE);
        }

        /**
         * Add a call to the call log for multi sim, and it can be used in TSTS.
         *
         * @param ci the CallerInfo object to get the target contact from.  Can be null
         * if the contact is unknown.
         * @param context the context used to get the ContentResolver
         * @param number the phone number to be added to the calls db
         * @param presentation the number presenting rules set by the network for
         *        "allowed", "payphone", "restricted" or "unknown"
         * @param callType enumerated values for "incoming", "outgoing", or "missed"
         * @param start time stamp for the call in milliseconds
         * @param duration call duration in seconds
         * @param subscription valid value is 0,1 or 2
         * @param durationType valid value is 0 or 1
         *
         * {@hide}
         */
        public static Uri addCall(CallerInfo ci, Context context, String number,
                int presentation, int callType, long start, int duration, int subscription,
                int durationType) {
            final ContentResolver resolver = context.getContentResolver();
            int numberPresentation = PRESENTATION_ALLOWED;

@@ -366,6 +409,7 @@ public class CallLog {
            values.put(DURATION, Long.valueOf(duration));
            values.put(NEW, Integer.valueOf(1));
            values.put(SUBSCRIPTION, Integer.valueOf(subscription));
            values.put(DURATION_TYPE, Integer.valueOf(durationType));
            if (callType == MISSED_TYPE) {
                values.put(IS_READ, Integer.valueOf(0));
            }