- Small edits and code improvements.
This commit is contained in:
@@ -72,7 +72,6 @@ class AccountActivity : AppCompatActivity() {
|
|||||||
spinner.layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)
|
spinner.layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)
|
||||||
spinner.setPopupBackgroundResource(R.drawable.spinner_background)
|
spinner.setPopupBackgroundResource(R.drawable.spinner_background)
|
||||||
layout.addView(spinner)
|
layout.addView(spinner)
|
||||||
|
|
||||||
if (acc.audioCodec.size > i) {
|
if (acc.audioCodec.size > i) {
|
||||||
val codec = acc.audioCodec[i]
|
val codec = acc.audioCodec[i]
|
||||||
spinnerList[i].add(codec)
|
spinnerList[i].add(codec)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class BaresipService: Service() {
|
|||||||
object : ConnectivityManager.NetworkCallback() {
|
object : ConnectivityManager.NetworkCallback() {
|
||||||
override fun onAvailable(network: Network) {
|
override fun onAvailable(network: Network) {
|
||||||
super.onAvailable(network)
|
super.onAvailable(network)
|
||||||
Log.d(LOG_TAG, "Network $network is available")
|
Log.d(LOG_TAG, "Network '$network' is available")
|
||||||
if (disconnected) {
|
if (disconnected) {
|
||||||
UserAgent.register()
|
UserAgent.register()
|
||||||
disconnected = false
|
disconnected = false
|
||||||
@@ -79,12 +79,12 @@ class BaresipService: Service() {
|
|||||||
if (dynDns) {
|
if (dynDns) {
|
||||||
val dnsServers = cm.getLinkProperties(network).getDnsServers()
|
val dnsServers = cm.getLinkProperties(network).getDnsServers()
|
||||||
if (Config.updateDnsServers(dnsServers) != 0)
|
if (Config.updateDnsServers(dnsServers) != 0)
|
||||||
Log.w(LOG_TAG, "Failed to update DNS servers '$dnsServers")
|
Log.w(LOG_TAG, "Failed to update DNS servers '$dnsServers'")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
override fun onLost(network: Network) {
|
override fun onLost(network: Network) {
|
||||||
super.onLost(network)
|
super.onLost(network)
|
||||||
Log.d(LOG_TAG, "Network $network is lost")
|
Log.d(LOG_TAG, "Network '$network' is lost")
|
||||||
disconnected = true
|
disconnected = true
|
||||||
}
|
}
|
||||||
override fun onLinkPropertiesChanged(network: Network, linkProperties: LinkProperties) {
|
override fun onLinkPropertiesChanged(network: Network, linkProperties: LinkProperties) {
|
||||||
@@ -93,7 +93,7 @@ class BaresipService: Service() {
|
|||||||
if (dynDns) {
|
if (dynDns) {
|
||||||
val dnsServers = linkProperties.getDnsServers()
|
val dnsServers = linkProperties.getDnsServers()
|
||||||
if (Config.updateDnsServers(dnsServers) != 0)
|
if (Config.updateDnsServers(dnsServers) != 0)
|
||||||
Log.w(LOG_TAG, "Failed to update DNS servers '$dnsServers")
|
Log.w(LOG_TAG, "Failed to update DNS servers '$dnsServers'")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,10 +141,10 @@ class BaresipService: Service() {
|
|||||||
for (a in assets) {
|
for (a in assets) {
|
||||||
file = File("${filesPath}/$a")
|
file = File("${filesPath}/$a")
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
Log.d(LOG_TAG, "Copying asset $a")
|
Log.d(LOG_TAG, "Copying asset '$a'")
|
||||||
Utils.copyAssetToFile(applicationContext, a, "$filesPath/$a")
|
Utils.copyAssetToFile(applicationContext, a, "$filesPath/$a")
|
||||||
} else {
|
} else {
|
||||||
Log.d(LOG_TAG, "Asset $a already copied")
|
Log.d(LOG_TAG, "Asset '$a' already copied")
|
||||||
if (a == "config") {
|
if (a == "config") {
|
||||||
var dnsServers = listOf<InetAddress>()
|
var dnsServers = listOf<InetAddress>()
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
@@ -384,7 +384,9 @@ class BaresipService: Service() {
|
|||||||
.setColor(ContextCompat.getColor(this,
|
.setColor(ContextCompat.getColor(this,
|
||||||
R.color.colorBaresip))
|
R.color.colorBaresip))
|
||||||
.setContentIntent(pi)
|
.setContentIntent(pi)
|
||||||
|
.setCategory(Notification.CATEGORY_CALL)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
|
.setOngoing(true)
|
||||||
.setContentTitle(getString(R.string.incoming_call_from))
|
.setContentTitle(getString(R.string.incoming_call_from))
|
||||||
.setContentText(caller)
|
.setContentText(caller)
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||||
|
|||||||
Reference in New Issue
Block a user