aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2015-06-04 19:03:37 -0700
committerNancy Chen <nancychen@google.com>2015-06-08 10:50:22 -0700
commit5638e7fa091fa925b539a54bbf63abf94ea4c257 (patch)
tree8ecc40582060186626da586732bc921e184d190d
parente9b0be19881605e5d23404c95d2da357ab0879b9 (diff)
downloadContactsProvider-5638e7fa091fa925b539a54bbf63abf94ea4c257.tar.gz
Set Calls.NEW to 0 if the voicemail is read.
Newly inserted read voicemails were notifying because the Calls.NEW flag was set to true. Add logic to set it to false if the Voicemails.IS_READ flag is set to true. Bug: 21085233 Change-Id: Ibb969de54684578473b7617095b63dd04c953abc
-rw-r--r--src/com/android/providers/contacts/VoicemailContentTable.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/VoicemailContentTable.java b/src/com/android/providers/contacts/VoicemailContentTable.java
index 7f943e32..87a23495 100644
--- a/src/com/android/providers/contacts/VoicemailContentTable.java
+++ b/src/com/android/providers/contacts/VoicemailContentTable.java
@@ -140,9 +140,11 @@ public class VoicemailContentTable implements VoicemailTable.Delegate {
// call type is always voicemail.
copiedValues.put(Calls.TYPE, Calls.VOICEMAIL_TYPE);
- // By default marked as new, unless explicitly overridden.
+ // A voicemail is marked as new unless it is marked as read or explicitly overridden.
+ boolean isRead = values.containsKey(Calls.IS_READ) ?
+ values.get(Calls.IS_READ).equals(1) : false;
if (!values.containsKey(Calls.NEW)) {
- copiedValues.put(Calls.NEW, 1);
+ copiedValues.put(Calls.NEW, !isRead);
}
SQLiteDatabase db = mDbHelper.getWritableDatabase();