summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/PhoneCallDetailsHelper.java5
-rw-r--r--src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java12
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java10
3 files changed, 16 insertions, 11 deletions
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index af0a5257e..2a4a1425c 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -63,8 +63,8 @@ public class PhoneCallDetailsHelper {
PhoneNumberUtilsWrapper phoneUtils) {
mResources = resources;
mCallTypeHelper = callTypeHelper;
- mPhoneNumberHelper = new PhoneNumberDisplayHelper(resources);
mPhoneNumberUtilsWrapper = phoneUtils;
+ mPhoneNumberHelper = new PhoneNumberDisplayHelper(mPhoneNumberUtilsWrapper, resources);
}
/** Fills the call details views with content. */
@@ -122,7 +122,7 @@ public class PhoneCallDetailsHelper {
nameText = displayNumber;
if (TextUtils.isEmpty(details.geocode)
|| mPhoneNumberUtilsWrapper.isVoicemailNumber(details.number)) {
- numberText = mResources.getString(R.string.call_log_empty_gecode);
+ numberText = mResources.getString(R.string.call_log_empty_geocode);
} else {
numberText = details.geocode;
}
@@ -137,7 +137,6 @@ public class PhoneCallDetailsHelper {
}
views.nameView.setText(nameText);
-
views.labelView.setText(labelText);
views.labelView.setVisibility(TextUtils.isEmpty(labelText) ? View.GONE : View.VISIBLE);
}
diff --git a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java
index 81f3ca1e5..5d7ce7ea9 100644
--- a/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java
+++ b/src/com/android/dialer/calllog/PhoneNumberDisplayHelper.java
@@ -18,8 +18,8 @@ package com.android.dialer.calllog;
import android.content.res.Resources;
import android.provider.CallLog.Calls;
-import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
+import android.util.Log;
import com.android.dialer.R;
@@ -27,10 +27,17 @@ import com.android.dialer.R;
* Helper for formatting and managing the display of phone numbers.
*/
public class PhoneNumberDisplayHelper {
+ private final PhoneNumberUtilsWrapper mPhoneNumberUtils;
private final Resources mResources;
public PhoneNumberDisplayHelper(Resources resources) {
mResources = resources;
+ mPhoneNumberUtils = new PhoneNumberUtilsWrapper();
+ }
+
+ public PhoneNumberDisplayHelper(PhoneNumberUtilsWrapper phoneNumberUtils, Resources resources) {
+ mPhoneNumberUtils = phoneNumberUtils;
+ mResources = resources;
}
/* package */ CharSequence getDisplayName(CharSequence number, int presentation) {
@@ -43,7 +50,7 @@ public class PhoneNumberDisplayHelper {
if (presentation == Calls.PRESENTATION_PAYPHONE) {
return mResources.getString(R.string.payphone);
}
- if (new PhoneNumberUtilsWrapper().isVoicemailNumber(number)) {
+ if (mPhoneNumberUtils.isVoicemailNumber(number)) {
return mResources.getString(R.string.voicemail);
}
if (PhoneNumberUtilsWrapper.isLegacyUnknownNumbers(number)) {
@@ -62,7 +69,6 @@ public class PhoneNumberDisplayHelper {
int presentation, CharSequence formattedNumber) {
final CharSequence displayName = getDisplayName(number, presentation);
-
if (!TextUtils.isEmpty(displayName)) {
return displayName;
}
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 00b8281a7..093cde246 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -1560,9 +1560,9 @@ public class DialpadFragment extends Fragment
* or Wait character (;).
*/
private void updateDialString(char newDigit) {
- if(newDigit != WAIT && newDigit != PAUSE) {
- Log.wtf(TAG, "Not expected for anything other than PAUSE & WAIT");
- return;
+ if (newDigit != WAIT && newDigit != PAUSE) {
+ throw new IllegalArgumentException(
+ "Not expected for anything other than PAUSE & WAIT");
}
int selectionStart;
@@ -1642,8 +1642,8 @@ public class DialpadFragment extends Fragment
/* package */ static boolean canAddDigit(CharSequence digits, int start, int end,
char newDigit) {
if(newDigit != WAIT && newDigit != PAUSE) {
- Log.wtf(TAG, "Should not be called for anything other than PAUSE & WAIT");
- return false;
+ throw new IllegalArgumentException(
+ "Should not be called for anything other than PAUSE & WAIT");
}
// False if no selection, or selection is reversed (end < start)