From f13f0b8bc727c3a9428c78fd193197b3232cf1e0 Mon Sep 17 00:00:00 2001 From: Android Dialer Date: Wed, 23 May 2018 14:05:34 -0700 Subject: Updating locations where PrimaryInfo#setPhoto is used to also PrimaryInfo#setPhotoUri for new GlidePhotoManager implementation. As part of this addition, we also are cleaning the setPhoto(null) because this is not explicitly needed. Bug: 76206920 Test: BottomRowTest,TopRowTest,SpeakEasyFragmentV2Test PiperOrigin-RevId: 197785533 Change-Id: I1702f43ec206a6c31cf162978712292aff0f8a17 --- java/com/android/incallui/CallCardPresenter.java | 1 + java/com/android/incallui/callpending/CallPendingActivity.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 9772cb1df..6614e7c74 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -722,6 +722,7 @@ public class CallCardPresenter : null) .setLabel(isChildNumberShown || isCallSubjectShown ? null : primaryContactInfo.label) .setPhoto(primaryContactInfo.photo) + .setPhotoUri(primaryContactInfo.displayPhotoUri) .setPhotoType(primaryContactInfo.photoType) .setIsSipCall(primaryContactInfo.isSipCall) .setIsContactPhotoShown(showContactPhoto) diff --git a/java/com/android/incallui/callpending/CallPendingActivity.java b/java/com/android/incallui/callpending/CallPendingActivity.java index 3c69f97b5..a686308c2 100644 --- a/java/com/android/incallui/callpending/CallPendingActivity.java +++ b/java/com/android/incallui/callpending/CallPendingActivity.java @@ -166,9 +166,9 @@ public class CallPendingActivity extends FragmentActivity } Drawable photo = null; + Uri photoUri = getPhotoUri(); try { // TODO(calderwoodra) move to background thread - Uri photoUri = getPhotoUri(); InputStream is = getContentResolver().openInputStream(photoUri); photo = Drawable.createFromStream(is, photoUri.toString()); } catch (FileNotFoundException e) { @@ -185,6 +185,7 @@ public class CallPendingActivity extends FragmentActivity .setNameIsNumber(name != null && name.equals(number)) .setLabel(getPhoneLabel()) .setPhoto(photo) + .setPhotoUri(photoUri) .setPhotoType(ContactPhotoType.CONTACT) .setIsSipCall(false) .setIsContactPhotoShown(true) -- cgit v1.2.3