diff options
author | Nancy Chen <nancychen@google.com> | 2015-06-04 19:03:37 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2015-06-08 10:50:22 -0700 |
commit | 5638e7fa091fa925b539a54bbf63abf94ea4c257 (patch) | |
tree | 8ecc40582060186626da586732bc921e184d190d /src | |
parent | e9b0be19881605e5d23404c95d2da357ab0879b9 (diff) | |
download | packages_providers_ContactsProvider-5638e7fa091fa925b539a54bbf63abf94ea4c257.zip packages_providers_ContactsProvider-5638e7fa091fa925b539a54bbf63abf94ea4c257.tar.gz packages_providers_ContactsProvider-5638e7fa091fa925b539a54bbf63abf94ea4c257.tar.bz2 |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/VoicemailContentTable.java | 6 |
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 7f943e3..87a2349 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(); |