Various fixes from Crashlytics reported issues

This commit is contained in:
Sylvain Berfini 2024-08-05 15:31:19 +02:00
parent 6c20ac8d40
commit 36cc74956e
3 changed files with 29 additions and 8 deletions

View file

@ -673,7 +673,11 @@ fun Friend.getNativeContactPictureUri(): Uri? {
fd.close()
return pictureUri
}
} catch (_: IOException) { }
} catch (ioe: IOException) {
Log.e("[Contacts Manager] Can't open [$pictureUri]: $ioe")
} catch (se: SecurityException) {
Log.e("[Contacts Manager] Can't open [$pictureUri]: $se")
}
// Fallback to thumbnail
return Uri.withAppendedPath(

View file

@ -62,14 +62,21 @@ class TelecomManager @WorkerThread constructor(context: Context) {
private var currentlyFollowedCalls: Int = 0
init {
callsManager.registerAppWithTelecom(
CallsManager.CAPABILITY_BASELINE or
CallsManager.Companion.CAPABILITY_SUPPORTS_VIDEO_CALLING
)
val hasTelecomFeature = context.packageManager.hasSystemFeature("android.software.telecom")
val hasTelecomFeature =
context.packageManager.hasSystemFeature("android.software.telecom")
Log.i(
"$TAG App has been registered with Telecom, android.software.telecom feature is [${if (hasTelecomFeature) "available" else "not available"}]"
"$TAG android.software.telecom feature is [${if (hasTelecomFeature) "available" else "not available"}]"
)
try {
callsManager.registerAppWithTelecom(
CallsManager.CAPABILITY_BASELINE or
CallsManager.Companion.CAPABILITY_SUPPORTS_VIDEO_CALLING
)
Log.i("$TAG App has been registered with Telecom")
} catch (e: Exception) {
Log.e("$TAG Can't init TelecomManager: $e")
}
}
@WorkerThread

View file

@ -193,7 +193,17 @@ class AccountSettingsViewModel @UiThread constructor() : GenericViewModel() {
newParams.mwiServerAddress = null
}
newParams.expires = expire.value?.toInt() ?: 31536000
val expire = expire.value.orEmpty()
val expireInt = if (expire.isEmpty()) {
31536000
} else {
try {
expire.toInt()
} catch (_: NumberFormatException) {
31536000
}
}
newParams.expires = expireInt
val conferenceUri = conferenceFactoryUri.value.orEmpty()
if (conferenceUri.isNotEmpty()) {