diff options
author | Nancy Chen <nancychen@google.com> | 2014-07-25 13:23:16 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-07-25 19:09:33 -0700 |
commit | 1970263aad3e26c0e36dbe3783bef5d9f0ff29f0 (patch) | |
tree | 5904f0ae809fddb5addcc6e55507a7d660b100c1 /src/com/android/dialer/CallDetailActivity.java | |
parent | 5da21ca847fbb1303bdd92d7c9ced16f94f80674 (diff) |
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
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index cd5fb3bc7..e44ff83bc 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -115,6 +115,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware private QuickContactBadge mQuickContactBadge; private TextView mCallerName; private TextView mCallerNumber; + private TextView mAccountLabel; private AsyncTaskExecutor mAsyncTaskExecutor; private ContactInfoHelper mContactInfoHelper; @@ -246,6 +247,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware 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 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware } + 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 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware 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 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware 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(); |