Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbe9db9e authored by Yorke Lee's avatar Yorke Lee
Browse files

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
parent 9acb00ee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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.toString())) {