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 {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:faa6a972c2'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:d1d5402388'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
}
|
}
|
||||||
|
@@ -20,10 +20,7 @@ import android.view.WindowManager
|
|||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.core.view.children
|
import androidx.core.view.children
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
import com.simplemobiletools.commons.helpers.*
|
||||||
import com.simplemobiletools.commons.helpers.MINUTE_SECONDS
|
|
||||||
import com.simplemobiletools.commons.helpers.isOreoMr1Plus
|
|
||||||
import com.simplemobiletools.commons.helpers.isOreoPlus
|
|
||||||
import com.simplemobiletools.dialer.R
|
import com.simplemobiletools.dialer.R
|
||||||
import com.simplemobiletools.dialer.extensions.*
|
import com.simplemobiletools.dialer.extensions.*
|
||||||
import com.simplemobiletools.dialer.helpers.*
|
import com.simplemobiletools.dialer.helpers.*
|
||||||
@@ -65,13 +62,9 @@ class CallActivity : SimpleActivity() {
|
|||||||
|
|
||||||
updateTextColors(call_holder)
|
updateTextColors(call_holder)
|
||||||
initButtons()
|
initButtons()
|
||||||
|
|
||||||
audioManager.mode = AudioManager.MODE_IN_CALL
|
audioManager.mode = AudioManager.MODE_IN_CALL
|
||||||
|
|
||||||
addLockScreenFlags()
|
addLockScreenFlags()
|
||||||
|
|
||||||
CallManager.addListener(callCallback)
|
CallManager.addListener(callCallback)
|
||||||
|
|
||||||
updateCallContactInfo(CallManager.getPrimaryCall())
|
updateCallContactInfo(CallManager.getPrimaryCall())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -494,7 +494,10 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun cacheContacts(contacts: List<SimpleContact>) {
|
fun cacheContacts(contacts: List<SimpleContact>) {
|
||||||
cachedContacts.clear()
|
try {
|
||||||
cachedContacts.addAll(contacts)
|
cachedContacts.clear()
|
||||||
|
cachedContacts.addAll(contacts)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.simplemobiletools.dialer.services
|
package com.simplemobiletools.dialer.services
|
||||||
|
|
||||||
import android.app.KeyguardManager
|
import android.app.KeyguardManager
|
||||||
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.telecom.Call
|
import android.telecom.Call
|
||||||
import android.telecom.InCallService
|
import android.telecom.InCallService
|
||||||
@@ -32,8 +33,13 @@ class CallService : InCallService() {
|
|||||||
|
|
||||||
val isScreenLocked = (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).isDeviceLocked
|
val isScreenLocked = (getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager).isDeviceLocked
|
||||||
if (!powerManager.isInteractive || call.isOutgoing() || isScreenLocked) {
|
if (!powerManager.isInteractive || call.isOutgoing() || isScreenLocked) {
|
||||||
startActivity(CallActivity.getStartIntent(this))
|
try {
|
||||||
if (call.getStateCompat() != Call.STATE_RINGING) {
|
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()
|
callNotificationManager.setupNotification()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user