mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-03-17 11:50:24 +01:00
do not show blocked numbers at the Recents tab
This commit is contained in:
parent
76ecb2ec1e
commit
b4b376cbfc
app
build.gradle
src/main
@ -56,6 +56,6 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.28.17'
|
||||
implementation 'com.simplemobiletools:commons:5.28.19'
|
||||
implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a'
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CALL_LOG
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.commons.helpers.getQuestionMarks
|
||||
import com.simplemobiletools.dialer.extensions.config
|
||||
import com.simplemobiletools.dialer.extensions.getAvailableSIMCardLabels
|
||||
import com.simplemobiletools.dialer.models.RecentCall
|
||||
|
||||
@ -14,7 +15,8 @@ class RecentsHelper(private val context: Context) {
|
||||
@SuppressLint("MissingPermission")
|
||||
fun getRecentCalls(callback: (ArrayList<RecentCall>) -> Unit) {
|
||||
ensureBackgroundThread {
|
||||
val recentCalls = ArrayList<RecentCall>()
|
||||
var recentCalls = ArrayList<RecentCall>()
|
||||
val blockedNumbers = context.getBlockedNumbers()
|
||||
if (!context.hasPermission(PERMISSION_READ_CALL_LOG)) {
|
||||
callback(recentCalls)
|
||||
return@ensureBackgroundThread
|
||||
@ -63,6 +65,7 @@ class RecentsHelper(private val context: Context) {
|
||||
previousRecentCallFrom = "$number$name"
|
||||
}
|
||||
|
||||
recentCalls = recentCalls.filter { !context.isNumberBlocked(it.phoneNumber) }.toMutableList() as ArrayList<RecentCall>
|
||||
callback(recentCalls)
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,6 @@
|
||||
<item
|
||||
android:id="@+id/cab_remove"
|
||||
android:icon="@drawable/ic_delete_vector"
|
||||
android:title="@string/remove"
|
||||
android:title="@string/delete"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
Loading…
x
Reference in New Issue
Block a user