refactoring

This commit is contained in:
Mysochenko Yuriy
2022-05-19 14:06:07 +03:00
parent 936f232f44
commit 7142b6363b
5 changed files with 11 additions and 16 deletions

View File

@ -17,6 +17,7 @@ fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Uni
callback(CallContact(context.getString(R.string.conference), "", "", ""))
return
}
val privateCursor = context.getMyContactsCursor(false, true)
ensureBackgroundThread {
val callContact = CallContact("", "", "", "")

View File

@ -46,12 +46,8 @@ class CallManager {
fun getPhoneState(): PhoneState {
return when (calls.size) {
0 -> {
NoCall
}
1 -> {
SingleCall(calls.first())
}
0 -> NoCall
1 -> SingleCall(calls.first())
2 -> {
val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE }
val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING }