Loading core/java/android/provider/CallLog.java +46 −2 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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); } /** Loading @@ -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; Loading Loading @@ -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)); } Loading Loading
core/java/android/provider/CallLog.java +46 −2 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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); } /** Loading @@ -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; Loading Loading @@ -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)); } Loading