- all user interface unrelated data is now kept in baresip service

allowing proper recovery in case Android kills other activities
- many other improvements and bug fixes
This commit is contained in:
Juha Heinanen
2018-11-23 10:35:48 +02:00
parent 0a9108f846
commit 18478c3436
23 changed files with 872 additions and 679 deletions
@@ -32,9 +32,9 @@ class AccountActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_account)
acc = Account.find(MainActivity.uas, intent.extras.getString("accp"))!!
acc = Account.find(intent.extras.getString("accp"))!!
aor = acc.aor
uaIndex = UserAgent.findAorIndex(MainActivity.uas, aor)!!
uaIndex = UserAgent.findAorIndex(UserAgent.uas(), aor)!!
setTitle(aor.replace("sip:", ""))
@@ -220,7 +220,7 @@ class AccountActivity : AppCompatActivity() {
if (acc.regint != 3600) newRegint = 3600
} else {
if (acc.regint != 0) {
UserAgent.ua_unregister(MainActivity.uas[uaIndex].uap)
Api.ua_unregister(UserAgent.uas()[uaIndex].uap)
newRegint = 0
}
}
@@ -285,20 +285,18 @@ class AccountActivity : AppCompatActivity() {
if (save) {
AccountsActivity.saveAccounts()
if (UserAgent.ua_update_account(MainActivity.uas[uaIndex].uap) != 0)
if (Api.ua_update_account(UserAgent.uas()[uaIndex].uap) != 0)
Log.e("Baresip", "Failed to update UA with AoR $aor")
}
if (regCheck.isChecked) UserAgent.ua_register(MainActivity.uas[uaIndex].uap)
if (regCheck.isChecked) Api.ua_register(UserAgent.uas()[uaIndex].uap)
setResult(RESULT_OK, intent)
finish()
return true
} else if (item.itemId == android.R.id.home) {
Log.d("Baresip", "Back array was pressed at Account")
setResult(RESULT_CANCELED, intent)
finish()
return true