Fix phone number matching, add tests

This commit is contained in:
Moez Bhatti
2019-11-19 02:13:09 -05:00
parent 9ea613bf39
commit 5927138a29
2 changed files with 74 additions and 4 deletions
@@ -44,10 +44,8 @@ class PhoneNumberUtils @Inject constructor(context: Context) {
}
if (PhoneNumberUtils.compare(first, second)) {
val firstNumber = parse(first) ?: return false
val secondNumber = parse(second) ?: return false
val matchType = phoneNumberUtil.isNumberMatch(firstNumber, secondNumber)
if (matchType >= PhoneNumberUtil.MatchType.NSN_MATCH) {
val matchType = phoneNumberUtil.isNumberMatch(first, second)
if (matchType >= PhoneNumberUtil.MatchType.SHORT_NSN_MATCH) {
return true
}
}