mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
updating commons
This commit is contained in:
@ -61,6 +61,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:10c8ac2f1e'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:0907d2e57f'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import android.telecom.Call
|
|||||||
import android.telecom.CallScreeningService
|
import android.telecom.CallScreeningService
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import com.simplemobiletools.commons.extensions.baseConfig
|
import com.simplemobiletools.commons.extensions.baseConfig
|
||||||
|
import com.simplemobiletools.commons.extensions.getMyContactsCursor
|
||||||
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
|
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
@ -15,7 +16,8 @@ class SimpleCallScreeningService : CallScreeningService() {
|
|||||||
val simpleContactsHelper = SimpleContactsHelper(this)
|
val simpleContactsHelper = SimpleContactsHelper(this)
|
||||||
val number = Uri.decode(callDetails.handle.toString()).substringAfter("tel:")
|
val number = Uri.decode(callDetails.handle.toString()).substringAfter("tel:")
|
||||||
if (baseConfig.blockUnknownNumbers) {
|
if (baseConfig.blockUnknownNumbers) {
|
||||||
simpleContactsHelper.exists(number) { exists ->
|
val privateCursor = getMyContactsCursor(false, true)
|
||||||
|
simpleContactsHelper.exists(number, privateCursor) { exists ->
|
||||||
respondToCall(callDetails, !exists)
|
respondToCall(callDetails, !exists)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user