mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-01 01:46:46 +01:00
catch exceptions thrown at fetching new thread IDs
This commit is contained in:
parent
9641eed138
commit
05c84e498c
@ -500,7 +500,11 @@ fun Context.markMessageRead(id: Int, isMMS: Boolean) {
|
|||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
fun Context.getThreadId(address: String): Long {
|
fun Context.getThreadId(address: String): Long {
|
||||||
return if (isMarshmallowPlus()) {
|
return if (isMarshmallowPlus()) {
|
||||||
|
try {
|
||||||
Threads.getOrCreateThreadId(this, address)
|
Threads.getOrCreateThreadId(this, address)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
0
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
@ -509,7 +513,11 @@ fun Context.getThreadId(address: String): Long {
|
|||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
fun Context.getThreadId(addresses: Set<String>): Long {
|
fun Context.getThreadId(addresses: Set<String>): Long {
|
||||||
return if (isMarshmallowPlus()) {
|
return if (isMarshmallowPlus()) {
|
||||||
|
try {
|
||||||
Threads.getOrCreateThreadId(this, addresses)
|
Threads.getOrCreateThreadId(this, addresses)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
0
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user