Don't show blocking dialog if not necessary

This commit is contained in:
moezbhatti
2019-08-23 01:30:50 +02:00
parent 1439e3f126
commit c5fa1ce0f5
11 changed files with 103 additions and 51 deletions
@@ -29,18 +29,16 @@ class QksmsBlockingClient @Inject constructor(
override fun isAvailable(): Boolean = true
override fun getClientCapability() = BlockingClientCapability.BLOCK_WITHOUT_PERMISSION
override fun isBlocked(address: String): Single<Boolean> = Single.fromCallable {
blockingRepo.isBlocked(address)
}
override fun canBlock(): Boolean = true
override fun block(addresses: List<String>): Completable = Completable.fromCallable {
blockingRepo.blockNumber(*addresses.toTypedArray())
}
override fun canUnblock(): Boolean = true
override fun unblock(addresses: List<String>): Completable = Completable.fromCallable {
blockingRepo.unblockNumbers(*addresses.toTypedArray())
}