aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa-wei Yen <twyen@google.com>2017-05-26 01:36:42 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-26 01:36:42 +0000
commit9ff27b66e1536a9ab643fe854c602be45ff3e55b (patch)
treec2b2cb8fa0bf049e872c3a851b3a589c89735465
parent6737a4b64d12b657f4ce01a5e6b25c2ac17ff02e (diff)
parent9805122df1cd098678b5349b509198ae1d95e211 (diff)
downloadContactsProvider-9ff27b66e1536a9ab643fe854c602be45ff3e55b.tar.gz
Allow voicemail DIRTY flag to be explicity set am: 58a1f876fb
am: 9805122df1 Change-Id: Ia736c692fe18c85bb481612d9943ce2ccae1f5bb
-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,