When necessary, show dialog prompting user to go to external blocking manager

This commit is contained in:
moezbhatti
2019-06-21 02:40:11 -04:00
parent 25132b58d6
commit a3824825f6
21 changed files with 195 additions and 83 deletions
@@ -35,9 +35,9 @@ interface BlockingClient {
fun canBlock(): Boolean = false
/**
* Blocks the number or opens the manager
* Blocks the numbers or opens the manager
*/
fun block(address: String): Completable
fun block(addresses: List<String>): Completable
/**
* Returns true if the client is capable of unblocking the address in the manager without any
@@ -46,8 +46,8 @@ interface BlockingClient {
fun canUnblock(): Boolean = false
/**
* Unblocks the number or opens the manager
* Unblocks the numbers or opens the manager
*/
fun unblock(address: String): Completable
fun unblock(addresses: List<String>): Completable
}
@@ -43,6 +43,11 @@ interface ConversationRepository {
fun getConversation(threadId: Long): Conversation?
/**
* Returns all conversations with an id in [threadIds]
*/
fun getConversations(vararg threadIds: Long): RealmResults<Conversation>
fun getThreadId(recipient: String): Long?
fun getThreadId(recipients: Collection<String>): Long?
@@ -60,6 +60,10 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences)
const val SWIPE_ACTION_CALL = 3
const val SWIPE_ACTION_READ = 4
const val SWIPE_ACTION_UNREAD = 5
const val BLOCKING_MANAGER_QKSMS = 0
const val BLOCKING_MANAGER_CC = 1
const val BLOCKING_MANAGER_SIA = 2
}
// Internal
@@ -76,6 +80,7 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences)
val black = rxPrefs.getBoolean("black", false)
val systemFont = rxPrefs.getBoolean("systemFont", false)
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
val callControl = rxPrefs.getBoolean("callControl", false)
val sia = rxPrefs.getBoolean("sia", false)
val drop = rxPrefs.getBoolean("drop", false)