- Removed context var from BaresipService.
This commit is contained in:
@ -51,7 +51,6 @@ class BaresipService: Service() {
|
||||
intent.setPackage("com.tutpro.baresip")
|
||||
|
||||
filesPath = filesDir.absolutePath
|
||||
context = applicationContext
|
||||
|
||||
am = getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
val rtUri = RingtoneManager.getActualDefaultRingtoneUri(applicationContext,
|
||||
@ -771,7 +770,6 @@ class BaresipService: Service() {
|
||||
var callVolume = 0
|
||||
|
||||
var filesPath = ""
|
||||
var context: Context? = null
|
||||
var uas = ArrayList<UserAgent>()
|
||||
var status = ArrayList<Int>()
|
||||
var calls = ArrayList<Call>()
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package com.tutpro.baresip
|
||||
|
||||
import android.content.Context
|
||||
import java.io.File
|
||||
|
||||
object Config {
|
||||
|
||||
private val path = BaresipService.filesPath + "/config"
|
||||
private val file = File(path)
|
||||
private val context = BaresipService.context
|
||||
|
||||
private var config = Utils.getFileContents(file)
|
||||
|
||||
fun initialize() {
|
||||
@ -75,8 +74,8 @@ object Config {
|
||||
add(variable, value)
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
Utils.copyAssetToFile(context!!, "config", path)
|
||||
fun reset(ctx: Context) {
|
||||
Utils.copyAssetToFile(ctx, "config", path)
|
||||
}
|
||||
|
||||
fun save() {
|
||||
|
||||
@ -193,7 +193,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
if (reset.isChecked) {
|
||||
Config.reset()
|
||||
Config.reset(this)
|
||||
save = false
|
||||
restart = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user