aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2017-06-05 13:49:04 -0700
committerMakoto Onuki <omakoto@google.com>2017-06-05 13:49:04 -0700
commitf752e4fbe36b30346c33c97a12ed7bb2bcf4256c (patch)
tree5de4ab9595e840f53826e7908344b92e5435081c
parent544cb78646d1631f502762ac52594ea8d478b1d6 (diff)
downloadContactsProvider-f752e4fbe36b30346c33c97a12ed7bb2bcf4256c.tar.gz
Allow updating TIMES_CONTACTED again.android-vts-8.0_r2android-vts-8.0_r1oreo-dev
Explicitly setting to TIMES_CONTACTED was allowed on pre-N builds. We tried to disable it for O, but turned out some system apps are using it. Let's re-open it. Test: adb shell am instrument -w com.android.providers.contacts.tests Test: adb shell am instrument -w -e package android.provider.cts.contacts android.provider.cts/android.support.test.runner.AndroidJUnitRunner Bug: 35321783 Change-Id: I07af087256cc9908b031bd8dfbd9fad479d4681f
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java7
-rw-r--r--tests/src/com/android/providers/contacts/ContactsProvider2Test.java2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 69b87cf2..7d626aee 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -4529,10 +4529,9 @@ public class ContactsProvider2 extends AbstractContactsProvider
ContactsDatabaseHelper.copyLongValue(
ret, Contacts.RAW_LAST_TIME_CONTACTED,
ret, Contacts.LR_LAST_TIME_CONTACTED);
- if (ret.containsKey(Contacts.LR_TIMES_CONTACTED)) {
- Log.w(TAG, "Column '" + Contacts.LR_TIMES_CONTACTED + "' can no longer be modified"
- + " directly, ignored. Caller=" + getCallingPackage());
- }
+ ContactsDatabaseHelper.copyLongValue(
+ ret, Contacts.RAW_TIMES_CONTACTED,
+ ret, Contacts.LR_TIMES_CONTACTED);
ret.remove(Contacts.LR_LAST_TIME_CONTACTED);
ret.remove(Contacts.LR_TIMES_CONTACTED);
diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java
index e9cf2a18..8930338e 100644
--- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java
+++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java
@@ -979,7 +979,7 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test {
long rawContactId = ContentUris.parseId(rowUri);
values.put(RawContacts.LAST_TIME_CONTACTED, 86400);
- values.put(RawContacts.TIMES_CONTACTED, 0); // This is not insertable.
+ values.put(RawContacts.TIMES_CONTACTED, 10);
assertStoredValues(rowUri, values);
assertSelection(RawContacts.CONTENT_URI, values, RawContacts._ID, rawContactId);