- Added possibility to set an account as the default account.
This commit is contained in:
@@ -24,6 +24,7 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
internal lateinit var regCheck: CheckBox
|
internal lateinit var regCheck: CheckBox
|
||||||
internal lateinit var mediaEnc: String
|
internal lateinit var mediaEnc: String
|
||||||
internal lateinit var vmUri: EditText
|
internal lateinit var vmUri: EditText
|
||||||
|
internal lateinit var defaultCheck: CheckBox
|
||||||
|
|
||||||
private var newCodecs = ArrayList<String>()
|
private var newCodecs = ArrayList<String>()
|
||||||
private var save = false
|
private var save = false
|
||||||
@@ -130,6 +131,9 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
vmUri = findViewById(R.id.voicemailUri) as EditText
|
vmUri = findViewById(R.id.voicemailUri) as EditText
|
||||||
vmUri.setText(acc.vmUri)
|
vmUri.setText(acc.vmUri)
|
||||||
|
|
||||||
|
defaultCheck = findViewById(R.id.Default) as CheckBox
|
||||||
|
defaultCheck.isChecked = uaIndex == 0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
@@ -338,6 +342,13 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
save = true
|
save = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defaultCheck.isChecked && (uaIndex > 0)) {
|
||||||
|
val tmp = BaresipService.uas[0]
|
||||||
|
BaresipService.uas[0] = BaresipService.uas[uaIndex]
|
||||||
|
BaresipService.uas[uaIndex] = tmp
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
|
||||||
if (save) {
|
if (save) {
|
||||||
AccountsActivity.saveAccounts()
|
AccountsActivity.saveAccounts()
|
||||||
if (Api.ua_update_account(UserAgent.uas()[uaIndex].uap) != 0)
|
if (Api.ua_update_account(UserAgent.uas()[uaIndex].uap) != 0)
|
||||||
@@ -395,6 +406,10 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
Utils.alertView(this, "Voicemail URI",
|
Utils.alertView(this, "Voicemail URI",
|
||||||
getText(R.string.vmUri).toString())
|
getText(R.string.vmUri).toString())
|
||||||
}
|
}
|
||||||
|
findViewById(R.id.DefaultTitle) as TextView -> {
|
||||||
|
Utils.alertView(this, "Default Account",
|
||||||
|
getText(R.string.defaultAccount).toString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -225,6 +225,30 @@
|
|||||||
android:layout_width="fill_parent">
|
android:layout_width="fill_parent">
|
||||||
</EditText>
|
</EditText>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal" >
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/DefaultTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:text="Default Account" >
|
||||||
|
</TextView>
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/Default"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:checked="false" >
|
||||||
|
</CheckBox>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
<string name="vmUri">SIP URI for checking of voicemail messages. If left empty, voicemail
|
<string name="vmUri">SIP URI for checking of voicemail messages. If left empty, voicemail
|
||||||
messages (Message Waiting Indications) are not subscribed to.
|
messages (Message Waiting Indications) are not subscribed to.
|
||||||
</string>>
|
</string>>
|
||||||
|
<string name="defaultAccount">If checked, this account is selected when baresip is started.
|
||||||
|
</string>>
|
||||||
<string name="autoStart">If checked, baresip starts automatically after device (re)start.</string>
|
<string name="autoStart">If checked, baresip starts automatically after device (re)start.</string>
|
||||||
<string name="dnsServers">Comma separated list of DNS servers. Each DNS server is of form
|
<string name="dnsServers">Comma separated list of DNS servers. Each DNS server is of form
|
||||||
server:port. Factory default value is \'8.8.8.8:53\' pointing to public Google DNS server.</string>
|
server:port. Factory default value is \'8.8.8.8:53\' pointing to public Google DNS server.</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user