From 509e1f1a97d65ca3356794ac9a85b5c38329c2ea Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Wed, 1 Aug 2012 15:40:55 -0700 Subject: [PATCH] Adding limit and offset query parameters to CallLog. Allows clients to paginate through call logs. Change-Id: Icdd796f990ccf25f5f5e2183412e5391f4572add --- api/current.txt | 2 ++ core/java/android/provider/CallLog.java | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index c910bd02cf40f..42068962bf9e3 100644 --- a/api/current.txt +++ b/api/current.txt @@ -17167,9 +17167,11 @@ package android.provider { field public static final java.lang.String DURATION = "duration"; field public static final int INCOMING_TYPE = 1; // 0x1 field public static final java.lang.String IS_READ = "is_read"; + field public static final java.lang.String LIMIT_PARAM_KEY = "limit"; field public static final int MISSED_TYPE = 3; // 0x3 field public static final java.lang.String NEW = "new"; field public static final java.lang.String NUMBER = "number"; + field public static final java.lang.String OFFSET_PARAM_KEY = "offset"; field public static final int OUTGOING_TYPE = 2; // 0x2 field public static final java.lang.String TYPE = "type"; } diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 22b68bc0f9a23..5dca67ff6f989 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -17,9 +17,6 @@ package android.provider; -import com.android.internal.telephony.CallerInfo; -import com.android.internal.telephony.PhoneConstants; - import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; @@ -30,6 +27,9 @@ import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.DataUsageFeedback; import android.text.TextUtils; +import com.android.internal.telephony.CallerInfo; +import com.android.internal.telephony.PhoneConstants; + /** * The CallLog provider contains information about placed and received calls. */ @@ -58,6 +58,20 @@ public class CallLog { public static final Uri CONTENT_FILTER_URI = Uri.parse("content://call_log/calls/filter"); + /** + * Query parameter used to limit the number of call logs returned. + *

+ * TYPE: integer + */ + public static final String LIMIT_PARAM_KEY = "limit"; + + /** + * Query parameter used to specify the starting record to return. + *

+ * TYPE: integer + */ + public static final String OFFSET_PARAM_KEY = "offset"; + /** * An optional URI parameter which instructs the provider to allow the operation to be * applied to voicemail records as well.