diff options
| author | 2016-10-17 17:41:40 +0000 | |
|---|---|---|
| committer | 2016-10-17 17:41:43 +0000 | |
| commit | cf6782c9409f98404302eba22c891072291e73b3 (patch) | |
| tree | faa034707b88b961bc215ae5a77f857790b0680e | |
| parent | 8a2522e13e8f888b742550100243f8c9c3b74053 (diff) | |
| parent | 203145e52481dea30587960690ea8fc5dacd9145 (diff) | |
Merge "Don't expose raw usage stats to clients; return "low-res" values."
| -rw-r--r-- | core/java/android/provider/Contacts.java | 14 | ||||
| -rw-r--r-- | core/java/android/provider/ContactsContract.java | 48 |
2 files changed, 46 insertions, 16 deletions
diff --git a/core/java/android/provider/Contacts.java b/core/java/android/provider/Contacts.java index d409030495ea..b31b2950f597 100644 --- a/core/java/android/provider/Contacts.java +++ b/core/java/android/provider/Contacts.java @@ -438,21 +438,11 @@ public class Contacts { public static final String PRIMARY_ORGANIZATION_ID = "primary_organization"; /** - * Mark a person as having been contacted. - * - * @param resolver the ContentResolver to use - * @param personId the person who was contacted - * @deprecated see {@link android.provider.ContactsContract} + * This API is no longer supported as of O. */ @Deprecated public static void markAsContacted(ContentResolver resolver, long personId) { - Uri uri = ContentUris.withAppendedId(CONTENT_URI, personId); - uri = Uri.withAppendedPath(uri, "update_contact_time"); - ContentValues values = new ContentValues(); - // There is a trigger in place that will update TIMES_CONTACTED when - // LAST_TIME_CONTACTED is modified. - values.put(LAST_TIME_CONTACTED, System.currentTimeMillis()); - resolver.update(uri, values, null, null); + // No longer supported. } /** diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 8d8c122820e2..a07aee52cf53 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -19,8 +19,6 @@ package android.provider; import android.accounts.Account; import android.annotation.SystemApi; import android.app.Activity; -import android.app.admin.DevicePolicyManager; -import android.content.ActivityNotFoundException; import android.content.ContentProviderClient; import android.content.ContentProviderOperation; import android.content.ContentResolver; @@ -44,7 +42,6 @@ import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Pair; import android.view.View; -import android.widget.Toast; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -118,6 +115,12 @@ public final class ContactsContract { public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY); /** + * Prefix for column names that are not visible to client apps. + * @hide + */ + public static final String HIDDEN_COLUMN_PREFIX = "x_"; + + /** * An optional URI parameter for insert, update, or delete queries * that allows the caller * to specify that it is a sync adapter. The default value is false. If true @@ -869,6 +872,25 @@ public final class ContactsContract { */ public static final String LAST_TIME_CONTACTED = "last_time_contacted"; + /** @hide Raw value. */ + public static final String RAW_TIMES_CONTACTED = HIDDEN_COLUMN_PREFIX + TIMES_CONTACTED; + + /** @hide Raw value. */ + public static final String RAW_LAST_TIME_CONTACTED = + HIDDEN_COLUMN_PREFIX + LAST_TIME_CONTACTED; + + /** + * @hide + * Low res version. Same as {@link #TIMES_CONTACTED} but use it in CP2 for clarification. + */ + public static final String LR_TIMES_CONTACTED = TIMES_CONTACTED; + + /** + * @hide + * Low res version. Same as {@link #TIMES_CONTACTED} but use it in CP2 for clarification. + */ + public static final String LR_LAST_TIME_CONTACTED = LAST_TIME_CONTACTED; + /** * Is the contact starred? * <P>Type: INTEGER (boolean)</P> @@ -1675,7 +1697,7 @@ public final class ContactsContract { Uri uri = ContentUris.withAppendedId(CONTENT_URI, contactId); ContentValues values = new ContentValues(); // TIMES_CONTACTED will be incremented when LAST_TIME_CONTACTED is modified. - values.put(LAST_TIME_CONTACTED, System.currentTimeMillis()); + values.put(LR_LAST_TIME_CONTACTED, System.currentTimeMillis()); resolver.update(uri, values, null, null); } @@ -4230,6 +4252,24 @@ public final class ContactsContract { /** The number of times the referenced {@link Data} has been used. */ public static final String TIMES_USED = "times_used"; + + /** @hide Raw value. */ + public static final String RAW_LAST_TIME_USED = HIDDEN_COLUMN_PREFIX + LAST_TIME_USED; + + /** @hide Raw value. */ + public static final String RAW_TIMES_USED = HIDDEN_COLUMN_PREFIX + TIMES_USED; + + /** + * @hide + * Low res version. Same as {@link #LAST_TIME_USED} but use it in CP2 for clarification. + */ + public static final String LR_LAST_TIME_USED = LAST_TIME_USED; + + /** + * @hide + * Low res version. Same as {@link #TIMES_USED} but use it in CP2 for clarification. + */ + public static final String LR_TIMES_USED = TIMES_USED; } /** |