Improve phone number matching when country code might be there

This commit is contained in:
moezbhatti
2019-11-08 01:05:48 -05:00
parent 1484ab3e45
commit 76c89dfed6
@@ -44,7 +44,10 @@ class PhoneNumberUtils @Inject constructor(context: Context) {
}
if (PhoneNumberUtils.compare(first, second)) {
if (phoneNumberUtil.isNumberMatch(first, second) >= PhoneNumberUtil.MatchType.NSN_MATCH) {
val firstNumber = parse(first) ?: return false
val secondNumber = parse(second) ?: return false
val matchType = phoneNumberUtil.isNumberMatch(firstNumber, secondNumber)
if (matchType >= PhoneNumberUtil.MatchType.NSN_MATCH) {
return true
}
}