Many fixed and improvements related to asking passwords
This commit is contained in:
@@ -87,7 +87,7 @@ class Account(val accp: Long) {
|
|||||||
|
|
||||||
if (authUser != "") res += ";auth_user=\"${authUser}\""
|
if (authUser != "") res += ";auth_user=\"${authUser}\""
|
||||||
|
|
||||||
if ((authPass != "") && !MainActivity.aorPasswords.containsKey(aor))
|
if ((authPass != "") && !BaresipService.aorPasswords.containsKey(aor))
|
||||||
res += ";auth_pass=\"${authPass}\""
|
res += ";auth_pass=\"${authPass}\""
|
||||||
|
|
||||||
if (outbound.size > 0) {
|
if (outbound.size > 0) {
|
||||||
@@ -142,7 +142,8 @@ class Account(val accp: Long) {
|
|||||||
if (!callHistory)
|
if (!callHistory)
|
||||||
extra += ";call_history=no"
|
extra += ";call_history=no"
|
||||||
|
|
||||||
extra += ";tel_provider=${URLEncoder.encode(telProvider, "UTF-8")}"
|
if (telProvider != "")
|
||||||
|
extra += ";tel_provider=${URLEncoder.encode(telProvider, "UTF-8")}"
|
||||||
|
|
||||||
if (countryCode != "")
|
if (countryCode != "")
|
||||||
extra += ";country_code=$countryCode"
|
extra += ";country_code=$countryCode"
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
displayName.setText(acc.displayName)
|
displayName.setText(acc.displayName)
|
||||||
authUser.setText(acc.authUser)
|
authUser.setText(acc.authUser)
|
||||||
|
|
||||||
if (MainActivity.aorPasswords.containsKey(aor) || acc.authPass == NO_AUTH_PASS)
|
if (BaresipService.aorPasswords[aor] != null || acc.authPass == NO_AUTH_PASS)
|
||||||
authPass.setText("")
|
authPass.setText("")
|
||||||
else
|
else
|
||||||
authPass.setText(acc.authPass)
|
authPass.setText(acc.authPass)
|
||||||
@@ -351,7 +351,6 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
vmUri.setText(acc.vmUri)
|
vmUri.setText(acc.vmUri)
|
||||||
|
|
||||||
defaultCheck.isChecked = uaIndex == 0
|
defaultCheck.isChecked = uaIndex == 0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
@@ -431,31 +430,31 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
if (ap != "") {
|
if (ap != "") {
|
||||||
if (ap != acc.authPass) {
|
if (ap != acc.authPass) {
|
||||||
if (Account.checkAuthPass(ap)) {
|
if (Account.checkAuthPass(ap)) {
|
||||||
setAuthPass(acc, ap)
|
if (Api.account_set_auth_pass(acc.accp, ap) == 0) {
|
||||||
MainActivity.aorPasswords.remove(aor)
|
acc.authPass = Api.account_auth_pass(acc.accp)
|
||||||
|
save = true
|
||||||
|
if (acc.regint > 0)
|
||||||
|
reRegister = true
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "Setting of auth pass failed")
|
||||||
|
}
|
||||||
|
BaresipService.aorPasswords.remove(acc.aor)
|
||||||
} else {
|
} else {
|
||||||
Utils.alertView(this, getString(R.string.notice),
|
Utils.alertView(this, getString(R.string.notice),
|
||||||
String.format(getString(R.string.invalid_authentication_password), ap))
|
String.format(getString(R.string.invalid_authentication_password), ap))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (MainActivity.aorPasswords.containsKey(aor)) {
|
BaresipService.aorPasswords.remove(acc.aor)
|
||||||
MainActivity.aorPasswords.remove(aor)
|
|
||||||
save = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else { // ap == ""
|
} else { // ap == ""
|
||||||
if (acc.authUser != "") {
|
if (acc.authPass != NO_AUTH_PASS &&
|
||||||
if (!MainActivity.aorPasswords.containsKey(aor)) {
|
acc.authPass != BaresipService.aorPasswords[acc.aor])
|
||||||
setAuthPass(acc, "")
|
if (Api.account_set_auth_pass(acc.accp, "") == 0) {
|
||||||
MainActivity.aorPasswords[aor] = ""
|
acc.authPass = NO_AUTH_PASS
|
||||||
|
BaresipService.aorPasswords[aor] = NO_AUTH_PASS
|
||||||
|
save = true
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (acc.authPass != "") {
|
|
||||||
setAuthPass(acc, "")
|
|
||||||
MainActivity.aorPasswords.remove(aor)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val ob = ArrayList<String>()
|
val ob = ArrayList<String>()
|
||||||
@@ -505,8 +504,7 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
(regCheck.isChecked && newConfiguredRegInt != acc.configuredRegInt)
|
(regCheck.isChecked && newConfiguredRegInt != acc.configuredRegInt)
|
||||||
if (reReg) {
|
if (reReg) {
|
||||||
if (Api.account_set_regint(acc.accp,
|
if (Api.account_set_regint(acc.accp,
|
||||||
if (regCheck.isChecked) newConfiguredRegInt else 0
|
if (regCheck.isChecked) newConfiguredRegInt else 0) != 0) {
|
||||||
) != 0) {
|
|
||||||
Log.e(TAG, "Setting of regint failed")
|
Log.e(TAG, "Setting of regint failed")
|
||||||
} else {
|
} else {
|
||||||
acc.regint = Api.account_regint(acc.accp)
|
acc.regint = Api.account_regint(acc.accp)
|
||||||
@@ -833,17 +831,6 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setAuthPass(acc: Account, ap: String) {
|
|
||||||
if (Api.account_set_auth_pass(acc.accp, ap) == 0) {
|
|
||||||
acc.authPass = Api.account_auth_pass(acc.accp)
|
|
||||||
MainActivity.aorPasswords.remove(acc.aor)
|
|
||||||
save = true
|
|
||||||
reRegister = true
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "Setting of auth pass failed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun checkOutboundUri(uri: String): Boolean {
|
private fun checkOutboundUri(uri: String): Boolean {
|
||||||
if (!uri.startsWith("sip:")) return false
|
if (!uri.startsWith("sip:")) return false
|
||||||
return Utils.checkHostPortParams(uri.substring(4))
|
return Utils.checkHostPortParams(uri.substring(4))
|
||||||
|
|||||||
@@ -3,15 +3,11 @@ package com.tutpro.baresip
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.widget.EditText
|
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.activity.OnBackPressedCallback
|
import androidx.activity.OnBackPressedCallback
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
|
||||||
import com.tutpro.baresip.databinding.ActivityAccountsBinding
|
import com.tutpro.baresip.databinding.ActivityAccountsBinding
|
||||||
|
|
||||||
class AccountsActivity : AppCompatActivity() {
|
class AccountsActivity : AppCompatActivity() {
|
||||||
@@ -41,15 +37,7 @@ class AccountsActivity : AppCompatActivity() {
|
|||||||
listView.adapter = alAdapter
|
listView.adapter = alAdapter
|
||||||
|
|
||||||
val accountRequest =
|
val accountRequest =
|
||||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {}
|
||||||
if (it.resultCode == RESULT_OK) {
|
|
||||||
val aor = it.data!!.getStringExtra("aor")!!
|
|
||||||
val ua = UserAgent.ofAor(aor)!!
|
|
||||||
if (MainActivity.aorPasswords.containsKey(aor) &&
|
|
||||||
MainActivity.aorPasswords[aor] == "")
|
|
||||||
askPassword(ua)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val addAccountButton = binding.addAccount
|
val addAccountButton = binding.addAccount
|
||||||
val newAorView = binding.newAor
|
val newAorView = binding.newAor
|
||||||
@@ -95,35 +83,6 @@ class AccountsActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun askPassword(ua: UserAgent) {
|
|
||||||
val layout = LayoutInflater.from(this)
|
|
||||||
.inflate(R.layout.password_dialog, findViewById(android.R.id.content),
|
|
||||||
false)
|
|
||||||
val titleView = layout.findViewById(R.id.title) as TextView
|
|
||||||
titleView.text = getString(R.string.authentication_password)
|
|
||||||
val messageView = layout.findViewById(R.id.message) as TextView
|
|
||||||
val message = getString(R.string.account) + " " + Utils.plainAor(ua.account.aor)
|
|
||||||
messageView.text = message
|
|
||||||
val input = layout.findViewById(R.id.password) as EditText
|
|
||||||
with (MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
|
||||||
setView(layout)
|
|
||||||
setPositiveButton(android.R.string.ok) { dialog, _ ->
|
|
||||||
dialog.dismiss()
|
|
||||||
var password = input.text.toString().trim()
|
|
||||||
if (!Account.checkAuthPass(password)) {
|
|
||||||
Utils.alertView(this@AccountsActivity, getString(R.string.notice),
|
|
||||||
String.format(getString(R.string.invalid_authentication_password), password))
|
|
||||||
password = ""
|
|
||||||
}
|
|
||||||
setAuthPass(ua, password)
|
|
||||||
}
|
|
||||||
setNeutralButton(android.R.string.cancel) { dialog, _ ->
|
|
||||||
dialog.cancel()
|
|
||||||
}
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
|
||||||
if (BaresipService.activities.indexOf("accounts,$aor") == -1)
|
if (BaresipService.activities.indexOf("accounts,$aor") == -1)
|
||||||
@@ -180,7 +139,7 @@ class AccountsActivity : AppCompatActivity() {
|
|||||||
accounts = accounts + a.print() + "\n"
|
accounts = accounts + a.print() + "\n"
|
||||||
}
|
}
|
||||||
Utils.putFileContents(BaresipService.filesPath + "/accounts", accounts.toByteArray())
|
Utils.putFileContents(BaresipService.filesPath + "/accounts", accounts.toByteArray())
|
||||||
// Log.d(TAG, "Saved accounts '${accounts}' to '${BaresipService.filesPath}/accounts'")
|
// Log.e(TAG, "Saved accounts '${accounts}' to '${BaresipService.filesPath}/accounts'")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun noAccounts(): Boolean {
|
fun noAccounts(): Boolean {
|
||||||
@@ -188,17 +147,6 @@ class AccountsActivity : AppCompatActivity() {
|
|||||||
return contents == null || contents.isEmpty()
|
return contents == null || contents.isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setAuthPass(ua: UserAgent, ap: String) {
|
|
||||||
val acc = ua.account
|
|
||||||
if (Api.account_set_auth_pass(acc.accp, ap) == 0) {
|
|
||||||
acc.authPass = Api.account_auth_pass(acc.accp)
|
|
||||||
MainActivity.aorPasswords[acc.aor] = ap
|
|
||||||
if ((ap != "") && (acc.regint > 0))
|
|
||||||
Api.ua_register(ua.uap)
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "Setting of auth pass failed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -564,14 +564,16 @@ class BaresipService: Service() {
|
|||||||
|
|
||||||
val acc = ua.account
|
val acc = ua.account
|
||||||
if (acc.authUser != "" && acc.authPass == NO_AUTH_PASS) {
|
if (acc.authUser != "" && acc.authPass == NO_AUTH_PASS) {
|
||||||
val password = if (MainActivity.aorPasswords[acc.aor] != null)
|
val password = aorPasswords[acc.aor]
|
||||||
MainActivity.aorPasswords[acc.aor]!!
|
if (password != null) {
|
||||||
else
|
Api.account_set_auth_pass(acc.accp, password)
|
||||||
""
|
acc.authPass = password
|
||||||
Api.account_set_auth_pass(acc.accp, password)
|
} else {
|
||||||
acc.authPass = Api.account_auth_pass(ua.account.accp)
|
Api.account_set_auth_pass(acc.accp, NO_AUTH_PASS)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.d(TAG, "got uaEvent $event/${acc.aor}")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1527,6 +1529,8 @@ class BaresipService: Service() {
|
|||||||
var dnsServers = listOf<InetAddress>()
|
var dnsServers = listOf<InetAddress>()
|
||||||
val serviceEvent = MutableLiveData<Event<Long>>()
|
val serviceEvent = MutableLiveData<Event<Long>>()
|
||||||
val serviceEvents = mutableListOf<ServiceEvent>()
|
val serviceEvents = mutableListOf<ServiceEvent>()
|
||||||
|
// <aor, password> of those accounts that have auth username without auth password
|
||||||
|
val aorPasswords = mutableMapOf<String, String>()
|
||||||
|
|
||||||
private var audioFocusRequest: AudioFocusRequestCompat? = null
|
private var audioFocusRequest: AudioFocusRequestCompat? = null
|
||||||
private var btAdapter: BluetoothAdapter? = null
|
private var btAdapter: BluetoothAdapter? = null
|
||||||
|
|||||||
@@ -175,9 +175,6 @@ class CallsActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
||||||
|
|
||||||
File("${BaresipService.filesPath}/recordings").walk().forEach { f ->
|
|
||||||
Log.d(TAG, "***** recording ${f.name}")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import android.content.Intent.ACTION_CALL
|
|||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.content.res.Configuration.ORIENTATION_PORTRAIT
|
import android.content.res.Configuration.ORIENTATION_PORTRAIT
|
||||||
import android.media.AudioAttributes
|
import android.media.AudioAttributes
|
||||||
import android.media.AudioDeviceInfo
|
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.*
|
import android.os.*
|
||||||
@@ -250,7 +249,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val ua = UserAgent.ofAor(activityAor)!!
|
val ua = UserAgent.ofAor(activityAor)!!
|
||||||
updateIcons(ua.account)
|
updateIcons(ua.account)
|
||||||
if (it.resultCode == Activity.RESULT_OK)
|
if (it.resultCode == Activity.RESULT_OK)
|
||||||
if (aorPasswords.containsKey(activityAor) && aorPasswords[activityAor] == "")
|
if (BaresipService.aorPasswords[activityAor] == NO_AUTH_PASS)
|
||||||
askPassword(getString(R.string.authentication_password), ua)
|
askPassword(getString(R.string.authentication_password), ua)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,11 +287,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val ua = UserAgent.ofAor(aorSpinner.tag.toString())
|
val ua = UserAgent.ofAor(aorSpinner.tag.toString())
|
||||||
if (ua != null) {
|
if (ua != null) {
|
||||||
val acc = ua.account
|
val acc = ua.account
|
||||||
if (Api.account_regint(acc.accp) == REGISTRATION_INTERVAL) {
|
if (Api.account_regint(acc.accp) > 0) {
|
||||||
Api.account_set_regint(acc.accp, 0)
|
Api.account_set_regint(acc.accp, 0)
|
||||||
Api.ua_unregister(ua.uap)
|
Api.ua_unregister(ua.uap)
|
||||||
} else {
|
} else {
|
||||||
Api.account_set_regint(acc.accp, REGISTRATION_INTERVAL)
|
Api.account_set_regint(acc.accp, acc.configuredRegInt)
|
||||||
Api.ua_register(ua.uap)
|
Api.ua_register(ua.uap)
|
||||||
}
|
}
|
||||||
acc.regint = Api.account_regint(acc.accp)
|
acc.regint = Api.account_regint(acc.accp)
|
||||||
@@ -1580,7 +1579,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
val input = layout.findViewById(R.id.password) as EditText
|
val input = layout.findViewById(R.id.password) as EditText
|
||||||
input.requestFocus()
|
input.requestFocus()
|
||||||
val context = this
|
|
||||||
with (MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
with (MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
||||||
setView(layout)
|
setView(layout)
|
||||||
setPositiveButton(android.R.string.ok) { dialog, _ ->
|
setPositiveButton(android.R.string.ok) { dialog, _ ->
|
||||||
@@ -1588,8 +1586,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
var password = input.text.toString().trim()
|
var password = input.text.toString().trim()
|
||||||
if (!Account.checkAuthPass(password)) {
|
if (!Account.checkAuthPass(password)) {
|
||||||
Utils.alertView(context, getString(R.string.notice),
|
Toast.makeText(
|
||||||
String.format(getString(R.string.invalid_authentication_password), password))
|
applicationContext,
|
||||||
|
String.format(getString(R.string.invalid_authentication_password), password),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
password = ""
|
password = ""
|
||||||
}
|
}
|
||||||
when (title) {
|
when (title) {
|
||||||
@@ -1598,7 +1599,17 @@ class MainActivity : AppCompatActivity() {
|
|||||||
getString(R.string.decrypt_password) ->
|
getString(R.string.decrypt_password) ->
|
||||||
if (password != "") restore(password)
|
if (password != "") restore(password)
|
||||||
else ->
|
else ->
|
||||||
AccountsActivity.setAuthPass(ua!!, password)
|
if (password == "") {
|
||||||
|
askPassword(title, ua!!)
|
||||||
|
} else {
|
||||||
|
Api.account_set_auth_pass(ua!!.account.accp, password)
|
||||||
|
ua.account.authPass = Api.account_auth_pass(ua.account.accp)
|
||||||
|
BaresipService.aorPasswords[ua.account.aor] = ua.account.authPass
|
||||||
|
if (ua.account.regint == 0)
|
||||||
|
Api.ua_unregister(ua.uap)
|
||||||
|
else
|
||||||
|
Api.ua_register(ua.uap)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setNeutralButton(android.R.string.cancel) { dialog, _ ->
|
setNeutralButton(android.R.string.cancel) { dialog, _ ->
|
||||||
@@ -1606,6 +1617,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
dialog.cancel()
|
dialog.cancel()
|
||||||
}
|
}
|
||||||
val dialog = this.create()
|
val dialog = this.create()
|
||||||
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||||
dialog.show()
|
dialog.show()
|
||||||
}
|
}
|
||||||
@@ -1628,28 +1640,34 @@ class MainActivity : AppCompatActivity() {
|
|||||||
messageView.text = message
|
messageView.text = message
|
||||||
val input = layout.findViewById(R.id.password) as EditText
|
val input = layout.findViewById(R.id.password) as EditText
|
||||||
input.requestFocus()
|
input.requestFocus()
|
||||||
val context = this
|
|
||||||
with (MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
with (MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
||||||
setView(layout)
|
setView(layout)
|
||||||
|
|
||||||
setPositiveButton(android.R.string.ok) { dialog, _ ->
|
setPositiveButton(android.R.string.ok) { dialog, _ ->
|
||||||
imm.hideSoftInputFromWindow(input.windowToken, 0)
|
imm.hideSoftInputFromWindow(input.windowToken, 0)
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
val password = input.text.toString().trim()
|
val password = input.text.toString().trim()
|
||||||
if (!Account.checkAuthPass(password)) {
|
if (!Account.checkAuthPass(password)) {
|
||||||
Utils.alertView(context, getString(R.string.notice),
|
Toast.makeText(
|
||||||
String.format(getString(R.string.invalid_authentication_password), password))
|
applicationContext,
|
||||||
|
String.format(getString(R.string.invalid_authentication_password),
|
||||||
|
password),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
accounts.add(0, account)
|
||||||
} else {
|
} else {
|
||||||
aorPasswords[aor] = password
|
BaresipService.aorPasswords[aor] = password
|
||||||
}
|
}
|
||||||
askPasswords(accounts)
|
askPasswords(accounts)
|
||||||
}
|
}
|
||||||
setNeutralButton(android.R.string.cancel) { dialog, _ ->
|
setNeutralButton(android.R.string.cancel) { dialog, _ ->
|
||||||
imm.hideSoftInputFromWindow(input.windowToken, 0)
|
imm.hideSoftInputFromWindow(input.windowToken, 0)
|
||||||
dialog.cancel()
|
dialog.cancel()
|
||||||
aorPasswords[aor] = ""
|
BaresipService.aorPasswords[aor] = NO_AUTH_PASS
|
||||||
askPasswords(accounts)
|
askPasswords(accounts)
|
||||||
}
|
}
|
||||||
val dialog = this.create()
|
val dialog = this.create()
|
||||||
|
dialog.setCanceledOnTouchOutside(false)
|
||||||
dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
dialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||||
dialog.show()
|
dialog.show()
|
||||||
}
|
}
|
||||||
@@ -2199,8 +2217,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
var accountRequest: ActivityResultLauncher<Intent>? = null
|
var accountRequest: ActivityResultLauncher<Intent>? = null
|
||||||
var activityAor = ""
|
var activityAor = ""
|
||||||
// <aor, password> of those accounts that have auth username without auth password
|
|
||||||
val aorPasswords = mutableMapOf<String, String>()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user