- Return AoR of the account as the result from AccountActivity.
This commit is contained in:
@@ -212,6 +212,9 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
if (BaresipService.activities.indexOf("account,$accp") == -1) return true
|
if (BaresipService.activities.indexOf("account,$accp") == -1) return true
|
||||||
|
|
||||||
|
val intent = Intent()
|
||||||
|
intent.putExtra("aor", aor)
|
||||||
|
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
|
|
||||||
R.id.checkIcon -> {
|
R.id.checkIcon -> {
|
||||||
@@ -466,25 +469,17 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
if (regCheck.isChecked && !((acc.authUser != "") && (acc.authPass == "")))
|
if (regCheck.isChecked && !((acc.authUser != "") && (acc.authPass == "")))
|
||||||
Api.ua_register(ua.uap)
|
Api.ua_register(ua.uap)
|
||||||
|
|
||||||
BaresipService.activities.remove("account,$accp")
|
setResult(Activity.RESULT_OK, intent)
|
||||||
val i = Intent()
|
|
||||||
i.putExtra("accp", accp)
|
|
||||||
setResult(Activity.RESULT_OK, i)
|
|
||||||
finish()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android.R.id.home -> {
|
android.R.id.home ->
|
||||||
|
setResult(Activity.RESULT_CANCELED, intent)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
BaresipService.activities.remove("account,$accp")
|
BaresipService.activities.remove("account,$accp")
|
||||||
val i = Intent()
|
|
||||||
setResult(Activity.RESULT_CANCELED, i)
|
|
||||||
finish()
|
finish()
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -492,8 +487,9 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
|
|
||||||
BaresipService.activities.remove("account,$accp")
|
BaresipService.activities.remove("account,$accp")
|
||||||
val i = Intent()
|
val intent = Intent()
|
||||||
setResult(Activity.RESULT_CANCELED, i)
|
intent.putExtra("aor", aor)
|
||||||
|
setResult(Activity.RESULT_CANCELED, intent)
|
||||||
finish()
|
finish()
|
||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class AccountsActivity : AppCompatActivity() {
|
|||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
ACCOUNT_CODE -> {
|
ACCOUNT_CODE -> {
|
||||||
if (resultCode == Activity.RESULT_OK) {
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
val aor = Account.find(data!!.getStringExtra("accp"))!!.aor
|
val aor = data!!.getStringExtra("aor")
|
||||||
val ua = UserAgent.uas()[UserAgent.findAorIndex(aor)!!]
|
val ua = UserAgent.uas()[UserAgent.findAorIndex(aor)!!]
|
||||||
if (aorPasswords.containsKey(aor) && aorPasswords[aor] == "")
|
if (aorPasswords.containsKey(aor) && aorPasswords[aor] == "")
|
||||||
askPassword(String.format(getString(R.string.account_password),
|
askPassword(String.format(getString(R.string.account_password),
|
||||||
|
|||||||
@@ -1114,13 +1114,14 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ACCOUNT_CODE -> {
|
ACCOUNT_CODE -> {
|
||||||
val ua = UserAgent.uas()[aorSpinner.selectedItemPosition]
|
val aor = data!!.getStringExtra("aor")
|
||||||
val account = ua.account
|
spinToAor(aor)
|
||||||
updateIcons(account)
|
val ua = Account.findUa(aor)!!
|
||||||
|
updateIcons(ua.account)
|
||||||
if (resultCode == Activity.RESULT_OK)
|
if (resultCode == Activity.RESULT_OK)
|
||||||
if (aorPasswords.containsKey(account.aor) && aorPasswords[account.aor] == "")
|
if (aorPasswords.containsKey(aor) && aorPasswords[aor] == "")
|
||||||
askPassword(String.format(getString(R.string.account_password),
|
askPassword(String.format(getString(R.string.account_password),
|
||||||
Utils.plainAor(account.aor)), ua)
|
Utils.plainAor(aor)), ua)
|
||||||
}
|
}
|
||||||
|
|
||||||
CONTACTS_CODE -> {
|
CONTACTS_CODE -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user