update to the latest commons version
This commit is contained in:
parent
d6b7d4c23f
commit
a06d4b2596
|
@ -61,6 +61,6 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:59f709a2a8'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:10c8ac2f1e'
|
||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||
}
|
||||
|
|
|
@ -14,7 +14,16 @@ class SimpleCallScreeningService : CallScreeningService() {
|
|||
override fun onScreenCall(callDetails: Call.Details) {
|
||||
val simpleContactsHelper = SimpleContactsHelper(this)
|
||||
val number = Uri.decode(callDetails.handle.toString()).substringAfter("tel:")
|
||||
val isBlocked = baseConfig.blockUnknownNumbers && !simpleContactsHelper.exists(number)
|
||||
if (baseConfig.blockUnknownNumbers) {
|
||||
simpleContactsHelper.exists(number) { exists ->
|
||||
respondToCall(callDetails, !exists)
|
||||
}
|
||||
} else {
|
||||
respondToCall(callDetails, false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun respondToCall(callDetails: Call.Details, isBlocked: Boolean) {
|
||||
val response = CallResponse.Builder()
|
||||
.setDisallowCall(isBlocked)
|
||||
.setRejectCall(isBlocked)
|
||||
|
|
Loading…
Reference in New Issue