summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/calllog/CallLogQueryHandler.java
diff options
context:
space:
mode:
authorlinus_lee <llee@cyngn.com>2015-01-05 12:45:34 -0800
committerLinus Lee <llee@cyngn.com>2015-01-06 01:32:33 +0000
commit0aa14c90ab580d1f7185235d2613238235f2ce70 (patch)
tree1f1c9a0560d372cc4a6c097f674b7ea7d77e3034 /src/com/android/dialer/calllog/CallLogQueryHandler.java
parent5406f450138cd7e2f355fe6aed6f6df5dab737f1 (diff)
downloadandroid_packages_apps_Dialer-0aa14c90ab580d1f7185235d2613238235f2ce70.tar.gz
android_packages_apps_Dialer-0aa14c90ab580d1f7185235d2613238235f2ce70.tar.bz2
android_packages_apps_Dialer-0aa14c90ab580d1f7185235d2613238235f2ce70.zip
Separate blacklist from missed filter in history/stats
Change-Id: I50e2467b7ac8568c6956c2dbc085985fd2f34d99 (cherry picked from commit 2f4890478123a3b6a9ba0a8b23f9a290f6c4ec73)
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogQueryHandler.java')
-rwxr-xr-xsrc/com/android/dialer/calllog/CallLogQueryHandler.java50
1 files changed, 1 insertions, 49 deletions
diff --git a/src/com/android/dialer/calllog/CallLogQueryHandler.java b/src/com/android/dialer/calllog/CallLogQueryHandler.java
index 293c21e7c..b2399b9ea 100755
--- a/src/com/android/dialer/calllog/CallLogQueryHandler.java
+++ b/src/com/android/dialer/calllog/CallLogQueryHandler.java
@@ -159,49 +159,7 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler {
/** Fetches the list of calls in the call log. */
private void fetchCalls(int token, int callType, boolean newOnly, long newerThan) {
- // We need to check for NULL explicitly otherwise entries with where READ is NULL
- // may not match either the query or its negation.
- // We consider the calls that are not yet consumed (i.e. IS_READ = 0) as "new".
- StringBuilder where = new StringBuilder();
- List<String> selectionArgs = Lists.newArrayList();
-
- if (newOnly) {
- where.append(Calls.NEW);
- where.append(" = 1");
- }
-
- if (callType > CALL_TYPE_ALL) {
- if (where.length() > 0) {
- where.append(" AND ");
- }
- // Add a clause to fetch only items of type voicemail.
- where.append(String.format("(%s = ?)", Calls.TYPE));
- // Add a clause to fetch only items newer than the requested date
- selectionArgs.add(Integer.toString(callType));
- if (callType == Calls.MISSED_TYPE) {
- // also query for blacklisted calls as they are 'missed'
- where.append(" OR ");
- where.append(String.format("(%s = ?)", Calls.TYPE));
- selectionArgs.add(Integer.toString(Calls.BLACKLIST_TYPE));
- }
- }
-
- if (newerThan > 0) {
- if (where.length() > 0) {
- where.append(" AND ");
- }
- where.append(String.format("(%s > ?)", Calls.DATE));
- selectionArgs.add(Long.toString(newerThan));
- }
-
- final int limit = (mLogLimit == -1) ? NUM_LOGS_TO_DISPLAY : mLogLimit;
- final String selection = where.length() > 0 ? where.toString() : null;
- Uri uri = Calls.CONTENT_URI_WITH_VOICEMAIL.buildUpon()
- .appendQueryParameter(Calls.LIMIT_PARAM_KEY, Integer.toString(limit))
- .build();
- startQuery(token, null, uri,
- CallLogQuery._PROJECTION, selection, selectionArgs.toArray(EMPTY_STRING_ARRAY),
- Calls.DEFAULT_SORT_ORDER);
+ fetchCalls(token, callType, newOnly, newerThan, CALL_SUB_ALL);
}
private void fetchCalls(int token, int callType, boolean newOnly,
@@ -225,12 +183,6 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler {
where.append(String.format("(%s = ?)", Calls.TYPE));
// Add a clause to fetch only items newer than the requested date
selectionArgs.add(Integer.toString(callType));
- if (callType == Calls.MISSED_TYPE) {
- // also query for blacklisted calls as they are 'missed'
- where.append(" OR ");
- where.append(String.format("(%s = ?)", Calls.TYPE));
- selectionArgs.add(Integer.toString(Calls.BLACKLIST_TYPE));
- }
}
if (slotId > CALL_SUB_ALL) {