adding some crashfixes

This commit is contained in:
tibbi
2022-06-22 23:13:20 +02:00
parent 1af7f8569a
commit a9490ddea6
4 changed files with 15 additions and 13 deletions

View File

@ -61,6 +61,6 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:faa6a972c2'
implementation 'com.github.SimpleMobileTools:Simple-Commons:d1d5402388'
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
}

View File

@ -20,10 +20,7 @@ import android.view.WindowManager
import android.widget.ImageView
import androidx.core.view.children
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
import com.simplemobiletools.commons.helpers.MINUTE_SECONDS
import com.simplemobiletools.commons.helpers.isOreoMr1Plus
import com.simplemobiletools.commons.helpers.isOreoPlus
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.dialer.R
import com.simplemobiletools.dialer.extensions.*
import com.simplemobiletools.dialer.helpers.*
@ -65,13 +62,9 @@ class CallActivity : SimpleActivity() {
updateTextColors(call_holder)
initButtons()
audioManager.mode = AudioManager.MODE_IN_CALL
addLockScreenFlags()
CallManager.addListener(callCallback)
updateCallContactInfo(CallManager.getPrimaryCall())
}

View File

@ -494,7 +494,10 @@ class MainActivity : SimpleActivity() {
}
fun cacheContacts(contacts: List<SimpleContact>) {
cachedContacts.clear()
cachedContacts.addAll(contacts)
try {
cachedContacts.clear()
cachedContacts.addAll(contacts)
} catch (e: Exception) {
}
}
}

View File

@ -1,6 +1,7 @@
package com.simplemobiletools.dialer.services
import android.app.KeyguardManager
import android.content.ActivityNotFoundException
import android.content.Context
import android.telecom.Call
import android.telecom.InCallService
@ -32,8 +33,13 @@ class CallService : InCallService() {
val isScreenLocked = (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).isDeviceLocked
if (!powerManager.isInteractive || call.isOutgoing() || isScreenLocked) {
startActivity(CallActivity.getStartIntent(this))
if (call.getStateCompat() != Call.STATE_RINGING) {
try {
startActivity(CallActivity.getStartIntent(this))
if (call.getStateCompat() != Call.STATE_RINGING) {
callNotificationManager.setupNotification()
}
} catch (e: ActivityNotFoundException) {
// seems like startActivity can thrown AndroidRuntimeException and ActivityNotFoundException, not yet sure when and why, lets show a notification
callNotificationManager.setupNotification()
}
} else {