Various fixes for crash reported on Crashlytics

This commit is contained in:
Sylvain Berfini 2024-04-22 16:16:00 +02:00
parent aa36129053
commit a64db777d9
4 changed files with 16 additions and 10 deletions

View file

@ -434,8 +434,12 @@ class NotificationsManager @MainThread constructor(private val context: Context)
if (clearPreviousChannels) {
Log.w("$TAG We were asked to remove all existing notification channels")
for (channel in notificationManager.notificationChannels) {
Log.i("$TAG Deleting notification channel ID [${channel.id}]")
notificationManager.deleteNotificationChannel(channel.id)
try {
Log.i("$TAG Deleting notification channel ID [${channel.id}]")
notificationManager.deleteNotificationChannel(channel.id)
} catch (e: Exception) {
Log.e("$TAG Failed to delete notification channel ID [${channel.id}]: $e")
}
}
}

View file

@ -149,6 +149,7 @@ class TelecomCallControlCallback(
Log.i(
"$TAG We're asked to [${if (muted) "mute" else "unmute"}] the call in state [$callState]"
)
// This is to prevent mic not muted when joining conference if user decided to join as muted
if (muted || !LinphoneUtils.isCallOutgoing(callState, false)) {
call.microphoneMuted = muted
} else {

View file

@ -70,14 +70,6 @@ class LandingFragment : Fragment() {
binding.lifecycleOwner = viewLifecycleOwner
binding.viewModel = viewModel
coreContext.postOnCoreThread {
val dialPlan = PhoneNumberUtils.getDeviceDialPlan(requireContext())
if (dialPlan != null) {
viewModel.internationalPrefix.postValue(dialPlan.countryCallingCode)
viewModel.internationalPrefixIsoCountryCode.postValue(dialPlan.isoCountryCode)
}
}
binding.setBackClickListener {
requireActivity().finish()
}
@ -138,6 +130,14 @@ class LandingFragment : Fragment() {
)
}
}
coreContext.postOnCoreThread {
val dialPlan = PhoneNumberUtils.getDeviceDialPlan(requireContext())
if (dialPlan != null) {
viewModel.internationalPrefix.postValue(dialPlan.countryCallingCode)
viewModel.internationalPrefixIsoCountryCode.postValue(dialPlan.isoCountryCode)
}
}
}
private fun goToRegisterFragment() {

View file

@ -128,6 +128,7 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
if (defaultAccount == null) {
Log.w("$TAG Default account is now null!")
return
} else {
Log.i(
"$TAG Default account has changed [${defaultAccount.params.identityAddress?.asStringUriOnly()}]"