adding some crashfixes

This commit is contained in:
tibbi 2020-05-18 12:40:55 +02:00
parent ab6e661a1a
commit 8ab60426af
3 changed files with 23 additions and 11 deletions

View File

@ -56,6 +56,6 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.28.3'
implementation 'com.simplemobiletools:commons:5.28.5'
implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a'
}

View File

@ -255,7 +255,10 @@ class CallActivity : SimpleActivity() {
private fun callStarted() {
incoming_call_holder.beGone()
ongoing_call_holder.beVisible()
callTimer.scheduleAtFixedRate(getCallTimerUpdateTask(), 1000, 1000)
try {
callTimer.scheduleAtFixedRate(getCallTimerUpdateTask(), 1000, 1000)
} catch (ignored: Exception) {
}
}
private fun showPhoneAccountPicker() {
@ -270,12 +273,16 @@ class CallActivity : SimpleActivity() {
proximityWakeLock!!.release()
}
audioManager.mode = AudioManager.MODE_NORMAL
if (isCallEnded) {
finish()
return
}
try {
audioManager.mode = AudioManager.MODE_NORMAL
} catch (ignored: Exception) {
}
isCallEnded = true
if (callDuration > 0) {
runOnUiThread {
@ -400,14 +407,19 @@ class CallActivity : SimpleActivity() {
var bitmap: Bitmap? = null
if (callContact?.photoUri?.isNotEmpty() == true) {
val photoUri = Uri.parse(callContact!!.photoUri)
bitmap = if (isQPlus()) {
val tmbSize = resources.getDimension(R.dimen.list_avatar_size).toInt()
contentResolver.loadThumbnail(photoUri, Size(tmbSize, tmbSize), null)
} else {
MediaStore.Images.Media.getBitmap(contentResolver, photoUri)
}
try {
bitmap = if (isQPlus()) {
val tmbSize = resources.getDimension(R.dimen.list_avatar_size).toInt()
contentResolver.loadThumbnail(photoUri, Size(tmbSize, tmbSize), null)
} else {
MediaStore.Images.Media.getBitmap(contentResolver, photoUri)
bitmap = getCircularBitmap(bitmap!!)
}
bitmap = getCircularBitmap(bitmap!!)
} catch (ignored: Exception) {
return null
}
}
return bitmap

View File

@ -162,7 +162,7 @@ class MainActivity : SimpleActivity() {
override fun onQueryTextChange(newText: String): Boolean {
if (isSearchOpen) {
contacts_fragment.onSearchQueryChanged(newText)
contacts_fragment?.onSearchQueryChanged(newText)
}
return true
}