No need for "accounts" resume action
This commit is contained in:
@@ -450,14 +450,7 @@ class BaresipService: Service() {
|
|||||||
showStatusNotification()
|
showStatusNotification()
|
||||||
|
|
||||||
val accounts = Utils.getFileContents("$filesPath/accounts")
|
val accounts = Utils.getFileContents("$filesPath/accounts")
|
||||||
if ((accounts == null) || accounts.isEmpty()) {
|
if ((accounts != null) && accounts.isNotEmpty()) {
|
||||||
val newIntent = Intent(this, MainActivity::class.java)
|
|
||||||
newIntent.flags =
|
|
||||||
Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP or
|
|
||||||
Intent.FLAG_ACTIVITY_NEW_TASK
|
|
||||||
newIntent.putExtra("action", "accounts")
|
|
||||||
startActivity(newIntent)
|
|
||||||
} else {
|
|
||||||
Utils.putFileContents("$filesPath/accounts",
|
Utils.putFileContents("$filesPath/accounts",
|
||||||
accounts.toString(Charsets.UTF_8).replace(
|
accounts.toString(Charsets.UTF_8).replace(
|
||||||
"pubint=0;call_transfer",
|
"pubint=0;call_transfer",
|
||||||
|
|||||||
@@ -895,9 +895,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Log.d(TAG, "Handling intent '$action'")
|
Log.d(TAG, "Handling intent '$action'")
|
||||||
val ev = action.split(",")
|
val ev = action.split(",")
|
||||||
when (ev[0]) {
|
when (ev[0]) {
|
||||||
"accounts" -> {
|
|
||||||
resumeAction = "accounts"
|
|
||||||
}
|
|
||||||
"no network" -> {
|
"no network" -> {
|
||||||
Utils.alertView(this, getString(R.string.notice),
|
Utils.alertView(this, getString(R.string.notice),
|
||||||
getString(R.string.no_network))
|
getString(R.string.no_network))
|
||||||
|
|||||||
Reference in New Issue
Block a user