diff options
author | Nancy Chen <nancychen@google.com> | 2015-02-12 18:00:43 -0800 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2015-03-02 11:01:48 -0800 |
commit | 7f768367db3394324234ac807f10f99ad505dbd9 (patch) | |
tree | b49ec7bb0b8ee21444113bf7312cfc2036b55663 /src | |
parent | 8730ff591ed078b3e81d9dd6a2b36cc620fccb1a (diff) |
Ignore all voicemails in the call log marked "deleted".
With the addition of the visual voicemail sync adapter, we want to have
a flag in the voicemail provider that will indicate that a voicemail was
deleted but not yet synced to the server. However, we no longer want
the entry to show up in the dialer call log, so make sure to ignore all
voicemails marked with "deleted" when querying the call log table.
Bug: 19236241
Change-Id: Ib80537c3b8630dd99b5e2b9b20d81015eafd114c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogQueryHandler.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/com/android/dialer/calllog/CallLogQueryHandler.java b/src/com/android/dialer/calllog/CallLogQueryHandler.java index dfc9c7834..761c8e08c 100644 --- a/src/com/android/dialer/calllog/CallLogQueryHandler.java +++ b/src/com/android/dialer/calllog/CallLogQueryHandler.java @@ -32,11 +32,13 @@ import android.os.Looper; import android.os.Message; import android.provider.CallLog.Calls; import android.provider.VoicemailContract.Status; +import android.provider.VoicemailContract.Voicemails; import android.util.Log; import com.android.common.io.MoreCloseables; import com.android.contacts.common.database.NoNullCursorAsyncQueryHandler; import com.android.dialer.voicemail.VoicemailStatusHelperImpl; + import com.google.common.collect.Lists; import java.lang.ref.WeakReference; @@ -140,15 +142,18 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { StringBuilder where = new StringBuilder(); List<String> selectionArgs = Lists.newArrayList(); + // Ignore voicemails marked as deleted + where.append(Voicemails.DELETED); + where.append(" = 0"); + if (newOnly) { + where.append(" AND "); where.append(Calls.NEW); where.append(" = 1"); } if (callType > CALL_TYPE_ALL) { - if (where.length() > 0) { - where.append(" AND "); - } + 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 @@ -156,9 +161,7 @@ public class CallLogQueryHandler extends NoNullCursorAsyncQueryHandler { } if (newerThan > 0) { - if (where.length() > 0) { - where.append(" AND "); - } + where.append(" AND "); where.append(String.format("(%s > ?)", Calls.DATE)); selectionArgs.add(Long.toString(newerThan)); } |