CallLog内容提供商500返回最大结果 [英] CallLog content provider returns 500 results max
问题描述
由于某些原因,如果我查询CallLog内容提供商,我得到最大的500个结果。
此外,它似乎我只是得到的结果长达1个月前(当我的设备Phone应用程序显示我此刻的约8个月)。
For some reason, If I query the CallLog Content provider, I get maximum 500 results. Also, it seems I only get results up to 1 month ago (when my devices Phone app shows me about 8 months at the moment).
我GOOGLE了它,但我发现是'商店CallLog.Calls进另一个表它提供了无解的。
I googled it, but all I found was 'Store 'CallLog.Calls' into another table' which offers no solution.
这是我的code:
String[] strFields = {
android.provider.CallLog.Calls.NUMBER,
android.provider.CallLog.Calls.DURATION,
android.provider.CallLog.Calls.DATE,
};
Cursor cursor = MainApplication.getAppContext().getContentResolver().query(
android.provider.CallLog.Calls.CONTENT_URI,
strFields,
null,
null,
null
);
if (cursor != null) {
Log.d("aaa", cursor.getCount());
...
}
...
我尝试添加更高的限制,但没有改变。
I tried adding a higher limit, but nothing changed.
有谁知道为什么我的结果是有限的?
Does anyone know why my results are limited?
编辑:
在Android的code挖了一点后,我到了一个叫方法<一href=\"http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.3_r2.1/android/provider/CallLog.java#CallLog.Calls.removeExpiredEntries%28android.content.Context%29\"相对=在android.provider.CallLognofollow的> removeExpiredEntries ()
After digging a little in Android code, I got to a method called removeExpiredEntries() in android.provider.CallLog
private static void removeExpiredEntries(Context context) {
final ContentResolver resolver = context.getContentResolver();
resolver.delete(CONTENT_URI, "_id IN " +
"(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
+ " LIMIT -1 OFFSET 500)", null);
}
这是所谓的每一个呼叫被添加到日志时间:/
这意味着,通话记录内容提供商最多可返回500个条目。
Which is called every time a call is added to the log :/ This means the call log content provider can return up to 500 entries.
这给我留下这样一个问题:如何在本土手机应用程序(在我的情况下,三星的手机应用程序)说明了什么似乎是数千个条目更加
This leaves me with the question: how does the native phone app (in my case, Samsung's phone app) shows what seems to be thousands entries more?
推荐答案
因此,从看日志,我来到了有500多的时候,什么设备的手机应用程序的作用是内容提供商确实删除条目的结论通过它的自我保存日志
So from looking at the logs, I came to the conclusion that the content provider indeed deletes entries when having more than 500, and what the device's Phone app does is save logs by it self
这篇关于CallLog内容提供商500返回最大结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!