Merge "Update call log provider docs to clarify how to use LIMIT." am: 5563f3ad03 am: 647ac1a233

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1852925

Change-Id: I8a3c4e109195f4133efa42722f8b6883dc798adf
This commit is contained in:
Tyler Gunn
2021-10-14 01:37:39 +00:00
committed by Automerger Merge Worker

View File

@@ -706,6 +706,25 @@ public class CallLog {
/** /**
* Contains the recent calls. * Contains the recent calls.
* <p>
* 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:
* <pre>
* {@code
* getContentResolver().query(
* Calls.CONTENT_URI.buildUpon().appendQueryParameter(LIMIT_PARAM_KEY, "1")
* .build(),
* null, null, null, null);
* }
* </pre>
* <p>
* The call log provider enforces strict SQL grammar, so you CANNOT append "LIMIT" to the SQL
* query as below:
* <pre>
* {@code
* getContentResolver().query(Calls.CONTENT_URI, null, "LIMIT 1", null, null);
* }
* </pre>
*/ */
public static class Calls implements BaseColumns { public static class Calls implements BaseColumns {
/** /**