Handles special numbers in call details page.
Some numbers (unknown, private, payphones, and voicemails) should be
shown using text instead of the row number strings.
Change-Id: I297d44bd762548f08c975adc1ba56fc4a9edd146
diff --git a/src/com/android/contacts/CallDetailActivity.java b/src/com/android/contacts/CallDetailActivity.java
index 43b3bee..43376ca 100644
--- a/src/com/android/contacts/CallDetailActivity.java
+++ b/src/com/android/contacts/CallDetailActivity.java
@@ -114,8 +114,8 @@
mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
mResources = getResources();
- mPhoneCallDetailsViews = new PhoneCallDetailsViews(getWindow().getDecorView());
- mPhoneCallDetailsHelper = new PhoneCallDetailsHelper(getResources());
+ mPhoneCallDetailsViews = PhoneCallDetailsViews.fromView(getWindow().getDecorView());
+ mPhoneCallDetailsHelper = new PhoneCallDetailsHelper(getResources(), getVoicemailNumber());
mCallActionView = findViewById(R.id.call);
mContactPhotoView = (ImageView) findViewById(R.id.contact_photo);
mContactBackgroundView = (ImageView) findViewById(R.id.contact_background);
@@ -307,6 +307,12 @@
return getString(R.string.callDetailsDurationFormat, minutes, seconds);
}
+ private String getVoicemailNumber() {
+ TelephonyManager telephonyManager =
+ (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+ return telephonyManager.getVoiceMailNumber();
+ }
+
static final class ViewEntry {
public int icon = -1;
public String text = null;