From 91ce7d2a476bd04fe525049a37a2f8b2824e9724 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Mon, 5 Jun 2017 13:35:02 -0700 Subject: Update AOSP Dialer source from internal google3 repository at cl/158012278. Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/152373142 (4/06/2017) to cl/158012278 (6/05/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: I4d3f14b5140e2e51bead9497bc118a205b3ebe76 --- .../contacts/common/ContactPhotoManager.java | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'java/com/android/contacts/common/ContactPhotoManager.java') diff --git a/java/com/android/contacts/common/ContactPhotoManager.java b/java/com/android/contacts/common/ContactPhotoManager.java index 169348b25..3e1a78f63 100644 --- a/java/com/android/contacts/common/ContactPhotoManager.java +++ b/java/com/android/contacts/common/ContactPhotoManager.java @@ -36,14 +36,6 @@ import com.android.dialer.util.PermissionsUtil; /** Asynchronously loads contact photos and maintains a cache of photos. */ public abstract class ContactPhotoManager implements ComponentCallbacks2 { - /** Contact type constants used for default letter images */ - public static final int TYPE_PERSON = LetterTileDrawable.TYPE_PERSON; - - public static final int TYPE_SPAM = LetterTileDrawable.TYPE_SPAM; - public static final int TYPE_BUSINESS = LetterTileDrawable.TYPE_BUSINESS; - public static final int TYPE_VOICEMAIL = LetterTileDrawable.TYPE_VOICEMAIL; - public static final int TYPE_DEFAULT = LetterTileDrawable.TYPE_DEFAULT; - public static final int TYPE_GENERIC_AVATAR = LetterTileDrawable.TYPE_GENERIC_AVATAR; /** Scale and offset default constants used for default letter images */ public static final float SCALE_DEFAULT = 1.0f; @@ -88,7 +80,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { if (!TextUtils.isEmpty(request.identifier)) { builder.appendQueryParameter(IDENTIFIER_PARAM_KEY, request.identifier); } - if (request.contactType != TYPE_DEFAULT) { + if (request.contactType != LetterTileDrawable.TYPE_DEFAULT) { builder.appendQueryParameter(CONTACT_TYPE_PARAM_KEY, String.valueOf(request.contactType)); } if (request.scale != SCALE_DEFAULT) { @@ -114,7 +106,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { public static String appendBusinessContactType(String photoUrl) { Uri uri = Uri.parse(photoUrl); Builder builder = uri.buildUpon(); - builder.encodedFragment(String.valueOf(TYPE_BUSINESS)); + builder.encodedFragment(String.valueOf(LetterTileDrawable.TYPE_BUSINESS)); return builder.build().toString(); } @@ -147,7 +139,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { String encodedFragment = photoUri.getEncodedFragment(); return !TextUtils.isEmpty(encodedFragment) - && encodedFragment.equals(String.valueOf(TYPE_BUSINESS)); + && encodedFragment.equals(String.valueOf(LetterTileDrawable.TYPE_BUSINESS)); } protected static DefaultImageRequest getDefaultImageRequestFromUri(Uri uri) { @@ -378,7 +370,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { * be returned. */ public static final DefaultImageRequest EMPTY_DEFAULT_BUSINESS_IMAGE_REQUEST = - new DefaultImageRequest(null, null, TYPE_BUSINESS, false); + new DefaultImageRequest(null, null, LetterTileDrawable.TYPE_BUSINESS, false); /** * Used to indicate that a circular drawable that represents a contact without any contact * details should be returned. @@ -390,7 +382,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { * should be returned. */ public static final DefaultImageRequest EMPTY_CIRCULAR_BUSINESS_IMAGE_REQUEST = - new DefaultImageRequest(null, null, TYPE_BUSINESS, true); + new DefaultImageRequest(null, null, LetterTileDrawable.TYPE_BUSINESS, true); /** The contact's display name. The display name is used to */ public String displayName; /** @@ -403,10 +395,9 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { /** * The type of this contact. This contact type may be used to decide the kind of image to use in * the case where a unique letter cannot be generated from the contact's display name and - * identifier. See: {@link #TYPE_PERSON} {@link #TYPE_BUSINESS} {@link #TYPE_PERSON} {@link - * #TYPE_DEFAULT} + * identifier. */ - public int contactType = TYPE_DEFAULT; + public @LetterTileDrawable.ContactType int contactType = LetterTileDrawable.TYPE_DEFAULT; /** * The amount to scale the letter or bitmap to, as a ratio of its default size (from a range of * 0.0f to 2.0f). The default value is 1.0f. @@ -429,7 +420,13 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 { public DefaultImageRequest() {} public DefaultImageRequest(String displayName, String identifier, boolean isCircular) { - this(displayName, identifier, TYPE_DEFAULT, SCALE_DEFAULT, OFFSET_DEFAULT, isCircular); + this( + displayName, + identifier, + LetterTileDrawable.TYPE_DEFAULT, + SCALE_DEFAULT, + OFFSET_DEFAULT, + isCircular); } public DefaultImageRequest( -- cgit v1.2.3