diff options
| author | 2021-10-14 02:05:38 +0000 | |
|---|---|---|
| committer | 2021-10-14 02:05:38 +0000 | |
| commit | 9624f6844bf77d3defc1b88ca90e7193670dd299 (patch) | |
| tree | c181a336fe541fc3ada84562d84fad28046fce6d | |
| parent | f4a361baca568330734020ade9aeea852f42a0da (diff) | |
| parent | 8a9f7519403b0684b445b1cd8c68b06a23deb11d (diff) | |
Merge "Update call log provider docs to clarify how to use LIMIT." am: 5563f3ad03 am: 647ac1a233 am: 40f4b45d61 am: 8a9f751940
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1852925
Change-Id: Icd763b868cddf8b049efed9635548957ba16f944
| -rw-r--r-- | core/java/android/provider/CallLog.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 51f19ebee987..b4acb67d2979 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. + * <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 { /** |