mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-03-14 02:10:10 +01:00
adding a null check at blocking calls from not stored contacts
This commit is contained in:
parent
d4f9fc28b7
commit
c892bc0492
@ -14,11 +14,13 @@ class SimpleCallScreeningService : CallScreeningService() {
|
||||
|
||||
override fun onScreenCall(callDetails: Call.Details) {
|
||||
if (baseConfig.blockUnknownNumbers) {
|
||||
val simpleContactsHelper = SimpleContactsHelper(this)
|
||||
val number = Uri.decode(callDetails.handle?.toString()).substringAfter("tel:")
|
||||
val privateCursor = getMyContactsCursor(false, true)
|
||||
simpleContactsHelper.exists(number, privateCursor) { exists ->
|
||||
respondToCall(callDetails, !exists)
|
||||
if (callDetails.handle != null) {
|
||||
val simpleContactsHelper = SimpleContactsHelper(this)
|
||||
val number = Uri.decode(callDetails.handle?.toString() ?: "").substringAfter("tel:")
|
||||
val privateCursor = getMyContactsCursor(false, true)
|
||||
simpleContactsHelper.exists(number, privateCursor) { exists ->
|
||||
respondToCall(callDetails, !exists)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
respondToCall(callDetails, false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user