Skip to content

Commit

Permalink
Merge pull request #24 from Aga-C/fix-importing-blocked-numbers
Browse files Browse the repository at this point in the history
Fixed importing blocked numbers
  • Loading branch information
naveensingh authored Jan 20, 2024
2 parents 3586136 + 5d8e447 commit a445ec5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.fossify.commons.helpers
import android.app.Activity
import android.telephony.PhoneNumberUtils
import org.fossify.commons.extensions.addBlockedNumber
import org.fossify.commons.extensions.isPhoneNumber
import org.fossify.commons.extensions.showErrorToast
import java.io.File

Expand All @@ -18,7 +19,7 @@ class BlockedNumbersImporter(
val inputStream = File(path).inputStream()
val numbers = inputStream.bufferedReader().use {
val content = it.readText().trimEnd().split(BLOCKED_NUMBERS_EXPORT_DELIMITER)
content.filter { text -> PhoneNumberUtils.isGlobalPhoneNumber(text) }
content.filter { text -> text.isPhoneNumber() }
}
if (numbers.isNotEmpty()) {
numbers.forEach { number ->
Expand Down

0 comments on commit a445ec5

Please sign in to comment.