Use lowercase contact mode values
This commit is contained in:
@ -363,7 +363,7 @@ class BaresipService: Service() {
|
||||
File(filesDir, "history").renameTo(File(filesDir, "calls"))
|
||||
|
||||
|
||||
if (contactsMode != "Android")
|
||||
if (contactsMode != "android")
|
||||
Contact.restoreBaresipContacts()
|
||||
if (contactsMode != "baresip") {
|
||||
Contact.loadAndroidContacts(applicationContext)
|
||||
|
||||
@ -300,11 +300,11 @@ class ConfigActivity : AppCompatActivity() {
|
||||
darkTheme.isChecked = oldDisplayTheme == AppCompatDelegate.MODE_NIGHT_YES
|
||||
|
||||
contactsSpinner = binding.contactsSpinner
|
||||
contactsModeKeys = arrayListOf("baresip", "Android", "Both")
|
||||
contactsModeKeys = arrayListOf("baresip", "android", "both")
|
||||
val contactsModeVals = arrayListOf(getString(R.string.baresip), getString(R.string.android),
|
||||
getString(R.string.both))
|
||||
val ctCv = Config.variable("contacts_mode")
|
||||
oldContactsMode = if (ctCv.size == 0) "baresip" else ctCv[0]
|
||||
oldContactsMode = if (ctCv.size == 0) "baresip" else ctCv[0].lowercase()
|
||||
contactsMode = oldContactsMode
|
||||
val keyIndex = contactsModeKeys.indexOf(oldContactsMode)
|
||||
val keyValue = contactsModeVals.elementAt(keyIndex)
|
||||
@ -518,12 +518,12 @@ class ConfigActivity : AppCompatActivity() {
|
||||
Contact.restoreBaresipContacts()
|
||||
baresipService.action = "Stop Content Observer"
|
||||
}
|
||||
"Android" -> {
|
||||
"android" -> {
|
||||
BaresipService.baresipContacts.clear()
|
||||
Contact.loadAndroidContacts(this)
|
||||
baresipService.action = "Start Content Observer"
|
||||
}
|
||||
"Both" -> {
|
||||
"both" -> {
|
||||
Contact.restoreBaresipContacts()
|
||||
Contact.loadAndroidContacts(this)
|
||||
baresipService.action = "Start Content Observer"
|
||||
|
||||
@ -195,7 +195,7 @@ sealed class Contact {
|
||||
|
||||
fun contactsUpdate() {
|
||||
BaresipService.contacts.clear()
|
||||
if (BaresipService.contactsMode != "Android")
|
||||
if (BaresipService.contactsMode != "android")
|
||||
BaresipService.contacts.addAll(BaresipService.baresipContacts)
|
||||
if (BaresipService.contactsMode != "baresip")
|
||||
addAndroidContacts()
|
||||
|
||||
@ -80,7 +80,7 @@ class ContactActivity : AppCompatActivity() {
|
||||
else
|
||||
uriView.setText(uri)
|
||||
uOrI = uri
|
||||
if ((BaresipService.contactsMode == "Android")) {
|
||||
if ((BaresipService.contactsMode == "android")) {
|
||||
androidCheck.isChecked = true
|
||||
androidCheck.isClickable = false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user