- Upgraded target Android API level to 28 (Android 9)

- Moved some non-UI functionality from main activity to baresip service
- Simplified implementation of call transfer
- Modified baresip launcher and status bar images
This commit is contained in:
Juha Heinanen
2019-04-08 18:47:59 +03:00
parent eb4cfbcece
commit cf5680b52b
19 changed files with 409 additions and 298 deletions
@@ -6,6 +6,8 @@ import android.support.v7.app.AlertDialog
import android.util.Log
import android.os.PowerManager
import android.app.KeyguardManager
import android.content.Intent
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
@@ -115,10 +117,13 @@ object Utils {
}
fun friendlyUri(uri: String, domain: String): String {
if (uri.contains("@") && !uri.substring(4).contains(":") &&
!uri.contains(";")) {
val user = uriUserPart(uri)
val host = uriHostPart(uri)
var u = uri
if (uri.startsWith("<") && (uri.endsWith(">")))
u = uri.substring(1).substringBeforeLast(">")
if (u.contains("@") && !u.substring(4).contains(":") &&
!u.contains(";")) {
val user = uriUserPart(u)
val host = uriHostPart(u)
if (host == domain) return user else return "$user@$host"
} else {
return uri
@@ -281,4 +286,22 @@ object Utils {
}
}
fun dumpIntent(intent: Intent) {
val bundle: Bundle = intent.extras ?: return
val keys = bundle.keySet()
val it = keys.iterator()
Log.d("Baresip", "Dumping intent start")
while (it.hasNext()) {
val key = it.next()
Log.d("Baresip","[" + key + "=" + bundle.get(key)+"]");
}
Log.d("Baresip", "Dumping intent finish")
}
}