diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 8553c24ce368c..0cc5bfda75e85 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -706,6 +706,25 @@ public class CallLog { /** * Contains the recent calls. + *
+ * Note: If you want to query the call log and limit the results to a single value, you should + * append the {@link #LIMIT_PARAM_KEY} parameter to the content URI. For example: + *
+ * {@code
+ * getContentResolver().query(
+ * Calls.CONTENT_URI.buildUpon().appendQueryParameter(LIMIT_PARAM_KEY, "1")
+ * .build(),
+ * null, null, null, null);
+ * }
+ *
+ * + * The call log provider enforces strict SQL grammar, so you CANNOT append "LIMIT" to the SQL + * query as below: + *
+ * {@code
+ * getContentResolver().query(Calls.CONTENT_URI, null, "LIMIT 1", null, null);
+ * }
+ *
*/
public static class Calls implements BaseColumns {
/**