summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/callcomposer/CallComposerActivity.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-21 10:11:17 -0700
committerEric Erfanian <erfanian@google.com>2017-03-21 10:11:17 -0700
commitfc37b02f5d3381a7882770941e461b13b679b6ef (patch)
tree23ce96100a89f1cf8847a4967efd35e56b6f8092 /java/com/android/dialer/callcomposer/CallComposerActivity.java
parent30ccc4f3aa6da94f0bb8a01a880a6353b883b263 (diff)
Update AOSP Dialer source from internal google3 repository at
cl/150756069 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/150392808 (3/16/2017) to cl/150756069 (3/21/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: I0888b5db52efb28eb8194600e0c7804592f975f3
Diffstat (limited to 'java/com/android/dialer/callcomposer/CallComposerActivity.java')
-rw-r--r--java/com/android/dialer/callcomposer/CallComposerActivity.java64
1 files changed, 10 insertions, 54 deletions
diff --git a/java/com/android/dialer/callcomposer/CallComposerActivity.java b/java/com/android/dialer/callcomposer/CallComposerActivity.java
index f73563ff8..9fb6c38f4 100644
--- a/java/com/android/dialer/callcomposer/CallComposerActivity.java
+++ b/java/com/android/dialer/callcomposer/CallComposerActivity.java
@@ -49,7 +49,6 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toolbar;
import com.android.contacts.common.ContactPhotoManager;
-import com.android.contacts.common.util.UriUtils;
import com.android.dialer.callcomposer.CallComposerFragment.CallComposerListener;
import com.android.dialer.callcomposer.nano.CallComposerContact;
import com.android.dialer.callcomposer.util.CopyAndResizeImageTask;
@@ -59,7 +58,6 @@ import com.android.dialer.callintent.nano.CallInitiationType;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.common.UiUtil;
-import com.android.dialer.compat.CompatUtils;
import com.android.dialer.constants.Constants;
import com.android.dialer.enrichedcall.EnrichedCallComponent;
import com.android.dialer.enrichedcall.EnrichedCallManager;
@@ -305,7 +303,7 @@ public class CallComposerActivity extends AppCompatActivity
@Override
public void onCopyFailed(Throwable throwable) {
- // TODO(b/33753902)
+ // TODO(b/34279096) - gracefully handle message failure
LogUtil.e("CallComposerActivity.onCopyFailed", "copy Failed", throwable);
}
})
@@ -473,21 +471,16 @@ public class CallComposerActivity extends AppCompatActivity
return getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}
- /**
- * Populates the contact info fields based on the current contact information. Copied from {@link
- * com.android.contacts.common.dialog.CallSubjectDialog}.
- */
+ /** Populates the contact info fields based on the current contact information. */
private void updateContactInfo() {
- if (contact.contactUri != null) {
- setPhoto(
- contact.photoId,
- Uri.parse(contact.photoUri),
- Uri.parse(contact.contactUri),
- contact.nameOrNumber,
- contact.isBusiness);
- } else {
- contactPhoto.setVisibility(View.GONE);
- }
+ ContactPhotoManager.getInstance(this)
+ .loadDialerThumbnail(
+ contactPhoto,
+ contact.contactUri == null ? null : Uri.parse(contact.contactUri),
+ contact.photoId,
+ contact.nameOrNumber,
+ contact.contactType);
+
nameView.setText(contact.nameOrNumber);
getActionBar().setTitle(contact.nameOrNumber);
if (!TextUtils.isEmpty(contact.numberLabel) && !TextUtils.isEmpty(contact.displayNumber)) {
@@ -505,43 +498,6 @@ public class CallComposerActivity extends AppCompatActivity
}
}
- /**
- * Sets the photo on the quick contact galleryIcon. Copied from {@link
- * com.android.contacts.common.dialog.CallSubjectDialog}.
- */
- private void setPhoto(
- long photoId, Uri photoUri, Uri contactUri, String displayName, boolean isBusiness) {
- contactPhoto.assignContactUri(contactUri);
- if (CompatUtils.isLollipopCompatible()) {
- contactPhoto.setOverlay(null);
- }
-
- int contactType;
- if (isBusiness) {
- contactType = ContactPhotoManager.TYPE_BUSINESS;
- } else {
- contactType = ContactPhotoManager.TYPE_DEFAULT;
- }
-
- String lookupKey = null;
- if (contactUri != null) {
- lookupKey = UriUtils.getLookupKeyFromUri(contactUri);
- }
-
- ContactPhotoManager.DefaultImageRequest request =
- new ContactPhotoManager.DefaultImageRequest(
- displayName, lookupKey, contactType, true /* isCircular */);
-
- if (photoId == 0 && photoUri != null) {
- contactPhoto.setImageDrawable(
- getDrawable(R.drawable.product_logo_avatar_anonymous_color_120));
- } else {
- ContactPhotoManager.getInstance(this)
- .loadThumbnail(
- contactPhoto, photoId, false /* darkTheme */, true /* isCircular */, request);
- }
- }
-
/** Animates compose UI into view */
private void runEntranceAnimation() {
if (!shouldAnimateEntrance) {