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