mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
adding some crashfixes
This commit is contained in:
@ -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'
|
||||
}
|
||||
|
@ -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())
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user