- avoid possible crash when returning to main activity after deleting an
account - use force when Quit is done again (it may still take some time to quit if there is no network connectivity) - increased version codes
This commit is contained in:
@ -7,8 +7,8 @@ android {
|
||||
applicationId = 'com.tutpro.baresip'
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode = 31
|
||||
versionName = '3.2.2'
|
||||
versionCode = 32
|
||||
versionName = '3.2.3'
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cFlags '-DHAVE_INTTYPES_H'
|
||||
|
||||
@ -427,9 +427,10 @@ class BaresipService: Service() {
|
||||
if (this::nm.isInitialized) nm.cancelAll()
|
||||
if (this::wl.isInitialized && wl.isHeld) wl.release()
|
||||
if (this::fl.isInitialized && fl.isHeld) fl.release()
|
||||
if (IS_SERVICE_RUNNING)
|
||||
baresipStop(false)
|
||||
else if (RESTARTING)
|
||||
if (IS_SERVICE_RUNNING) {
|
||||
baresipStop(forceStop)
|
||||
if (!forceStop) forceStop = true
|
||||
} else if (RESTARTING)
|
||||
restart()
|
||||
}
|
||||
|
||||
@ -452,6 +453,7 @@ class BaresipService: Service() {
|
||||
val DEFAULT_CHANNEL_ID = "com.tutpro.baresip.default"
|
||||
val HIGH_CHANNEL_ID = "com.tutpro.baresip.high"
|
||||
var disconnected = false
|
||||
var forceStop = false
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -860,9 +860,10 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
ACCOUNTS_CODE -> {
|
||||
uaAdapter.notifyDataSetChanged()
|
||||
if ((aorSpinner.selectedItemPosition == -1) && (uas.size > 0))
|
||||
aorSpinner.setSelection(0)
|
||||
if (aorSpinner.selectedItemPosition >= 0) {
|
||||
if (uas.size > 0) {
|
||||
if ((aorSpinner.selectedItemPosition == -1) ||
|
||||
(aorSpinner.selectedItemPosition >= uas.size))
|
||||
aorSpinner.setSelection(0)
|
||||
val acc = uas[aorSpinner.selectedItemPosition].account
|
||||
if (acc.vmUri != "") {
|
||||
if (acc.vmNew > 0)
|
||||
@ -873,6 +874,8 @@ class MainActivity : AppCompatActivity() {
|
||||
} else {
|
||||
voicemailButton.visibility = View.INVISIBLE
|
||||
}
|
||||
} else {
|
||||
aorSpinner.setSelection(-1)
|
||||
}
|
||||
baresipService.setAction("UpdateNotification")
|
||||
startService(baresipService)
|
||||
|
||||
Reference in New Issue
Block a user