summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/glidephotomanager/impl
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-03-06 12:13:27 -0800
committerCopybara-Service <copybara-piper@google.com>2018-03-06 12:17:15 -0800
commit9e8b6733962641d137c4d084b843c069b6545953 (patch)
tree505df3fffb3147adddf2f569e1d11def6c098bf0 /java/com/android/dialer/glidephotomanager/impl
parentf7539b6d7f483462082370e9972edb5c5a9a0401 (diff)
Covnert @AutoValue PhotoInfo into a proto.
Bug: 74202944 Test: Existing tests PiperOrigin-RevId: 188060790 Change-Id: I4d79a353abf767935383d4149f261f5e96fd7acb
Diffstat (limited to 'java/com/android/dialer/glidephotomanager/impl')
-rw-r--r--java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java b/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java
index e14e604a1..45af4e3e2 100644
--- a/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java
+++ b/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java
@@ -49,7 +49,7 @@ public class GlidePhotoManagerImpl implements GlidePhotoManager {
@Override
public void loadQuickContactBadge(QuickContactBadge badge, PhotoInfo photoInfo) {
Assert.isMainThread();
- badge.assignContactUri(parseUri(photoInfo.lookupUri()));
+ badge.assignContactUri(parseUri(photoInfo.getLookupUri()));
badge.setOverlay(null);
GlideRequest<Drawable> request = buildRequest(GlideApp.with(badge), photoInfo);
request.into(badge);
@@ -62,20 +62,20 @@ public class GlidePhotoManagerImpl implements GlidePhotoManager {
GlideRequest<Drawable> request;
boolean circleCrop = true; // Photos are cropped to a circle by default.
- if (photoInfo.isBlocked()) {
+ if (photoInfo.getIsBlocked()) {
// Whether the number is blocked takes precedence over the spam status.
request = requestManager.load(R.drawable.ic_block_grey_48dp);
- } else if (photoInfo.isSpam()) {
+ } else if (photoInfo.getIsSpam()) {
request = requestManager.load(R.drawable.quantum_ic_report_vd_red_24);
circleCrop = false; // The spam icon is an octagon so we don't crop it.
- } else if (!TextUtils.isEmpty(photoInfo.photoUri())) {
- request = requestManager.load(parseUri(photoInfo.photoUri()));
+ } else if (!TextUtils.isEmpty(photoInfo.getPhotoUri())) {
+ request = requestManager.load(parseUri(photoInfo.getPhotoUri()));
- } else if (photoInfo.photoId() != 0) {
+ } else if (photoInfo.getPhotoId() != 0) {
request =
- requestManager.load(ContentUris.withAppendedId(Data.CONTENT_URI, photoInfo.photoId()));
+ requestManager.load(ContentUris.withAppendedId(Data.CONTENT_URI, photoInfo.getPhotoId()));
} else {
// load null to indicate fallback should be used.
@@ -102,23 +102,25 @@ public class GlidePhotoManagerImpl implements GlidePhotoManager {
LetterTileDrawable letterTileDrawable = new LetterTileDrawable(appContext.getResources());
String displayName;
String identifier;
- if (TextUtils.isEmpty(photoInfo.lookupUri())) {
+ if (TextUtils.isEmpty(photoInfo.getLookupUri())) {
// Use generic avatar instead of letter for non-contacts.
displayName = null;
identifier =
- TextUtils.isEmpty(photoInfo.name()) ? photoInfo.formattedNumber() : photoInfo.name();
+ TextUtils.isEmpty(photoInfo.getName())
+ ? photoInfo.getFormattedNumber()
+ : photoInfo.getName();
} else {
- displayName = photoInfo.name();
- identifier = photoInfo.lookupUri();
+ displayName = photoInfo.getName();
+ identifier = photoInfo.getLookupUri();
}
letterTileDrawable.setCanonicalDialerLetterTileDetails(
displayName,
identifier,
LetterTileDrawable.SHAPE_CIRCLE,
LetterTileDrawable.getContactTypeFromPrimitives(
- photoInfo.isVoicemail(),
- photoInfo.isSpam(),
- photoInfo.isBusiness(),
+ photoInfo.getIsVoicemail(),
+ photoInfo.getIsSpam(),
+ photoInfo.getIsBusiness(),
TelecomManager.PRESENTATION_ALLOWED, // TODO(twyen):implement
false)); // TODO(twyen):implement
return letterTileDrawable;