diff options
author | Yorke Lee <yorkelee@google.com> | 2013-11-18 10:03:59 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-03-04 16:32:23 +0000 |
commit | df4d08dcf662f45697236064b02787f7d0a06f83 (patch) | |
tree | 0e12ebdcb085a334734af1df5c70c88c19017a26 /src | |
parent | 3ce60186f646b461635b16d7d9a806ddc0b61bac (diff) |
Use single instance of PhoneNumberUtilsWrapper
PhoneNumberUtilsWrapper is creating a new instance of the class
everytime it tries to look up an unknown number. Just use a single
instance for this instead to avoid redundant object creation.
Change-Id: I418d95ced42c1db06c63848768050a181defb347
(cherry picked from commit dbe9db9e26d4c7ca08ba24630e990e25629aac78)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java index 2133f0f9d..91a818829 100644 --- a/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java +++ b/src/com/android/dialer/calllog/PhoneNumberUtilsWrapper.java @@ -28,7 +28,7 @@ import java.util.Set; * */ public class PhoneNumberUtilsWrapper { - + private static final PhoneNumberUtilsWrapper INSTANCE = new PhoneNumberUtilsWrapper(); private static final Set<String> LEGACY_UNKNOWN_NUMBERS = Sets.newHashSet("-1", "-2", "-3"); /** Returns true if it is possible to place a call to the given number. */ @@ -74,7 +74,7 @@ public class PhoneNumberUtilsWrapper { if (TextUtils.isEmpty(number)) { return false; } - if (new PhoneNumberUtilsWrapper().isVoicemailNumber(number)) { + if (INSTANCE.isVoicemailNumber(number)) { return false; } if (isLegacyUnknownNumbers(number)) { |