summaryrefslogtreecommitdiff
path: root/java/com/android/contacts/common/ContactPhotoManager.java
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-06-09 14:16:05 +0000
committerTobias Thierer <tobiast@google.com>2017-06-09 14:16:05 +0000
commitcded3beaf28a703e1ef8f71bbc6836e6806c3736 (patch)
treec1b5e8199b5996fc848e7455d04126b9cdbb3c39 /java/com/android/contacts/common/ContactPhotoManager.java
parentc67d658e7daa453fe9ad9fd1a37f81eaf2048c44 (diff)
Revert "Update AOSP Dialer source from internal google3 repository at cl/158012278. am: 91ce7d2a47"
This reverts commit c67d658e7daa453fe9ad9fd1a37f81eaf2048c44. Reason for revert: This CL broke the sailfish-userdebug_javac-all target on master. Change-Id: I9b54333a654c00154ca84f4ece84bea4f07cc19b
Diffstat (limited to 'java/com/android/contacts/common/ContactPhotoManager.java')
-rw-r--r--java/com/android/contacts/common/ContactPhotoManager.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/java/com/android/contacts/common/ContactPhotoManager.java b/java/com/android/contacts/common/ContactPhotoManager.java
index 3e1a78f63..169348b25 100644
--- a/java/com/android/contacts/common/ContactPhotoManager.java
+++ b/java/com/android/contacts/common/ContactPhotoManager.java
@@ -36,6 +36,14 @@ 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;
@@ -80,7 +88,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 {
if (!TextUtils.isEmpty(request.identifier)) {
builder.appendQueryParameter(IDENTIFIER_PARAM_KEY, request.identifier);
}
- if (request.contactType != LetterTileDrawable.TYPE_DEFAULT) {
+ if (request.contactType != TYPE_DEFAULT) {
builder.appendQueryParameter(CONTACT_TYPE_PARAM_KEY, String.valueOf(request.contactType));
}
if (request.scale != SCALE_DEFAULT) {
@@ -106,7 +114,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(LetterTileDrawable.TYPE_BUSINESS));
+ builder.encodedFragment(String.valueOf(TYPE_BUSINESS));
return builder.build().toString();
}
@@ -139,7 +147,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 {
String encodedFragment = photoUri.getEncodedFragment();
return !TextUtils.isEmpty(encodedFragment)
- && encodedFragment.equals(String.valueOf(LetterTileDrawable.TYPE_BUSINESS));
+ && encodedFragment.equals(String.valueOf(TYPE_BUSINESS));
}
protected static DefaultImageRequest getDefaultImageRequestFromUri(Uri uri) {
@@ -370,7 +378,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 {
* be returned.
*/
public static final DefaultImageRequest EMPTY_DEFAULT_BUSINESS_IMAGE_REQUEST =
- new DefaultImageRequest(null, null, LetterTileDrawable.TYPE_BUSINESS, false);
+ new DefaultImageRequest(null, null, TYPE_BUSINESS, false);
/**
* Used to indicate that a circular drawable that represents a contact without any contact
* details should be returned.
@@ -382,7 +390,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 {
* should be returned.
*/
public static final DefaultImageRequest EMPTY_CIRCULAR_BUSINESS_IMAGE_REQUEST =
- new DefaultImageRequest(null, null, LetterTileDrawable.TYPE_BUSINESS, true);
+ new DefaultImageRequest(null, null, TYPE_BUSINESS, true);
/** The contact's display name. The display name is used to */
public String displayName;
/**
@@ -395,9 +403,10 @@ 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.
+ * identifier. See: {@link #TYPE_PERSON} {@link #TYPE_BUSINESS} {@link #TYPE_PERSON} {@link
+ * #TYPE_DEFAULT}
*/
- public @LetterTileDrawable.ContactType int contactType = LetterTileDrawable.TYPE_DEFAULT;
+ public int contactType = 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.
@@ -420,13 +429,7 @@ public abstract class ContactPhotoManager implements ComponentCallbacks2 {
public DefaultImageRequest() {}
public DefaultImageRequest(String displayName, String identifier, boolean isCircular) {
- this(
- displayName,
- identifier,
- LetterTileDrawable.TYPE_DEFAULT,
- SCALE_DEFAULT,
- OFFSET_DEFAULT,
- isCircular);
+ this(displayName, identifier, TYPE_DEFAULT, SCALE_DEFAULT, OFFSET_DEFAULT, isCircular);
}
public DefaultImageRequest(