mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Catch exception when posting a navigation task on main thread
This commit is contained in:
parent
ab1ea3392d
commit
674fa1f41b
5 changed files with 26 additions and 8 deletions
|
|
@ -93,8 +93,12 @@ class AssistantActivity : GenericActivity() {
|
|||
coreContext.postOnCoreThread { core ->
|
||||
if (core.accountList.isNotEmpty()) {
|
||||
coreContext.postOnMainThread {
|
||||
Log.w("$TAG At least one account was found, leaving assistant")
|
||||
finish()
|
||||
try {
|
||||
Log.w("$TAG At least one account was found, leaving assistant")
|
||||
finish()
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("$TAG Can't finish activity: $ise")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ class NewCallFragment : AbstractNewTransferCallFragment() {
|
|||
coreContext.startAudioCall(address)
|
||||
|
||||
coreContext.postOnMainThread {
|
||||
findNavController().popBackStack()
|
||||
try {
|
||||
findNavController().popBackStack()
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("$TAG Can't go back: $ise")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,11 @@ class TransferCallFragment : AbstractNewTransferCallFragment() {
|
|||
callViewModel.blindTransferCallTo(address)
|
||||
|
||||
coreContext.postOnMainThread {
|
||||
findNavController().popBackStack()
|
||||
try {
|
||||
findNavController().popBackStack()
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("$TAG Can't go back: $ise")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -509,12 +509,20 @@ class MainActivity : GenericActivity() {
|
|||
Log.i("$TAG First time Linphone 6.0 has been started, showing Welcome activity")
|
||||
corePreferences.firstLaunch = false
|
||||
coreContext.postOnMainThread {
|
||||
startActivity(Intent(this, WelcomeActivity::class.java))
|
||||
try {
|
||||
startActivity(Intent(this, WelcomeActivity::class.java))
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("$TAG Can't start activity: $ise")
|
||||
}
|
||||
}
|
||||
} else if (core.accountList.isEmpty()) {
|
||||
Log.w("$TAG No account found, showing Assistant activity")
|
||||
coreContext.postOnMainThread {
|
||||
startActivity(Intent(this, AssistantActivity::class.java))
|
||||
try {
|
||||
startActivity(Intent(this, AssistantActivity::class.java))
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("$TAG Can't start activity: $ise")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (intent.hasExtra("Chat")) {
|
||||
|
|
|
|||
|
|
@ -170,8 +170,6 @@ class ConversationForwardMessageViewModel @UiThread constructor() : AddressSelec
|
|||
)
|
||||
|
||||
showNumberOrAddressPickerDialogEvent.postValue(Event(list))
|
||||
coreContext.postOnMainThread {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue