Add account label to call details if appropriate
We will be adding the account label field to call details if there is
more than one account to disambiguate. Otherwise this field will be
hidden.
Bug: 16488229
Change-Id: Idb03d09d63372655504a5f9178e6f2e408aefb88
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index cd5fb3b..e44ff83 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -115,6 +115,7 @@
private QuickContactBadge mQuickContactBadge;
private TextView mCallerName;
private TextView mCallerNumber;
+ private TextView mAccountLabel;
private AsyncTaskExecutor mAsyncTaskExecutor;
private ContactInfoHelper mContactInfoHelper;
@@ -246,6 +247,7 @@
mQuickContactBadge.setOverlay(null);
mCallerName = (TextView) findViewById(R.id.caller_name);
mCallerNumber = (TextView) findViewById(R.id.caller_number);
+ mAccountLabel = (TextView) findViewById(R.id.phone_account_label);
mDefaultCountryIso = GeoUtil.getCurrentCountryIso(this);
mContactPhotoManager = ContactPhotoManager.getInstance(this);
mProximitySensorManager = new ProximitySensorManager(this, mProximitySensorListener);
@@ -438,6 +440,13 @@
}
+ if (!TextUtils.isEmpty(firstDetails.accountLabel)) {
+ mAccountLabel.setText(firstDetails.accountLabel);
+ mAccountLabel.setVisibility(View.VISIBLE);
+ } else {
+ mAccountLabel.setVisibility(View.GONE);
+ }
+
mHasEditNumberBeforeCallOption =
canPlaceCallsTo && !isSipNumber && !isVoicemailNumber;
mHasTrashOption = hasVoicemail();
@@ -520,7 +529,7 @@
final String geocode = callCursor.getString(GEOCODED_LOCATION_COLUMN_INDEX);
final String transcription = callCursor.getString(TRANSCRIPTION_COLUMN_INDEX);
- final Drawable accountIcon = PhoneAccountUtils.getAccountIcon(this,
+ final String accountLabel = PhoneAccountUtils.getAccountLabel(this,
PhoneAccountUtils.getAccount(
callCursor.getString(ACCOUNT_COMPONENT_NAME),
callCursor.getString(ACCOUNT_ID)));
@@ -571,7 +580,7 @@
formattedNumber, countryIso, geocode,
new int[]{ callType }, date, duration,
nameText, numberType, numberLabel, lookupUri, photoUri, sourceType,
- accountIcon, features, dataUsage, transcription);
+ accountLabel, null, features, dataUsage, transcription);
} finally {
if (callCursor != null) {
callCursor.close();