aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa-wei Yen <twyen@google.com>2017-05-26 01:23:53 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-26 01:23:53 +0000
commit9805122df1cd098678b5349b509198ae1d95e211 (patch)
treecc1272d4f26940a2f1f541139772ea016ea17019
parentfa76abec36a133ed32d522a1fc697f0d570cda67 (diff)
parent58a1f876fb972d290bba505365605ab6f4087c7f (diff)
downloadContactsProvider-9805122df1cd098678b5349b509198ae1d95e211.tar.gz
Allow voicemail DIRTY flag to be explicity set
am: 58a1f876fb Change-Id: Ie1cb636aa5714b464afc8aac0873000ec8363d40
-rw-r--r--src/com/android/providers/contacts/DbModifierWithNotification.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/providers/contacts/DbModifierWithNotification.java b/src/com/android/providers/contacts/DbModifierWithNotification.java
index f67a2a8f..cb5460ce 100644
--- a/src/com/android/providers/contacts/DbModifierWithNotification.java
+++ b/src/com/android/providers/contacts/DbModifierWithNotification.java
@@ -37,9 +37,11 @@ import android.provider.VoicemailContract;
import android.provider.VoicemailContract.Status;
import android.provider.VoicemailContract.Voicemails;
import android.util.Log;
+
import com.android.common.io.MoreCloseables;
import com.android.providers.contacts.CallLogDatabaseHelper.Tables;
import com.android.providers.contacts.util.DbQueryUtils;
+
import com.google.android.collect.Lists;
import com.google.common.collect.Iterables;
import java.util.ArrayList;
@@ -172,7 +174,14 @@ public class DbModifierWithNotification implements DatabaseModifier {
// from the server and thus is synced or "clean". Otherwise, it means that a local
// change is being made to the database, so the entries should be marked as "dirty"
// so that the corresponding sync adapter knows they need to be synced.
- final int isDirty = isSelfModifyingOrInternal(packagesModified) ? 0 : 1;
+ int isDirty;
+ Integer callerSetDirty = values.getAsInteger(Voicemails.DIRTY);
+ if (callerSetDirty != null) {
+ // Respect the calling package if it sets the dirty flag
+ isDirty = callerSetDirty == 0 ? 0 : 1;
+ } else {
+ isDirty = isSelfModifyingOrInternal(packagesModified) ? 0 : 1;
+ }
values.put(VoicemailContract.Voicemails.DIRTY, isDirty);
if (isDirty == 0 && values.containsKey(Calls.IS_READ) && getAsBoolean(values,