diff options
author | Makoto Onuki <omakoto@google.com> | 2017-02-24 17:02:33 -0800 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2017-02-27 12:30:33 -0800 |
commit | beeee64617684297013c023ece2eb2d5e8f94376 (patch) | |
tree | 7b636ddd01b36bc060a3974c5b9547fbde54e3f7 /src | |
parent | 343f231980f4f4035b18e0402cb07d3523de0db4 (diff) | |
download | ContactsProvider-beeee64617684297013c023ece2eb2d5e8f94376.tar.gz |
Sanity check against contact-id = 0
Test: adb shell am instrument -w com.android.providers.contacts.tests
Bug 35756516
Change-Id: I3627fab41781b9d547f69320ff2519708d81135b
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java b/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java index 2a366758..20e3bbec 100644 --- a/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java +++ b/src/com/android/providers/contacts/aggregation/AbstractContactAggregator.java @@ -69,6 +69,7 @@ import android.provider.ContactsContract.StatusUpdates; import android.text.TextUtils; import android.util.EventLog; import android.util.Log; +import android.util.Slog; import java.util.ArrayList; import java.util.Collections; @@ -917,6 +918,10 @@ public abstract class AbstractContactAggregator { * Updates the contact ID for the specified contact and marks the raw contact as aggregated. */ private void setContactIdAndMarkAggregated(long rawContactId, long contactId) { + if (contactId == 0) { + // Use Slog instead of Log, to prevent the process from crashing. + Slog.wtfStack(TAG, "Detected contact-id 0"); + } mContactIdAndMarkAggregatedUpdate.bindLong(1, contactId); mContactIdAndMarkAggregatedUpdate.bindLong(2, rawContactId); mContactIdAndMarkAggregatedUpdate.execute(); |