In call/dial action URI decode "tel:%2B" to "tel:+"
This commit is contained in:
@ -38,10 +38,8 @@ import com.google.android.material.snackbar.Snackbar
|
|||||||
import com.tutpro.baresip.Utils.showSnackBar
|
import com.tutpro.baresip.Utils.showSnackBar
|
||||||
import com.tutpro.baresip.databinding.ActivityMainBinding
|
import com.tutpro.baresip.databinding.ActivityMainBinding
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.URLDecoder
|
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
private lateinit var binding: ActivityMainBinding
|
private lateinit var binding: ActivityMainBinding
|
||||||
@ -660,7 +658,8 @@ class MainActivity : AppCompatActivity() {
|
|||||||
if (BaresipService.isServiceRunning)
|
if (BaresipService.isServiceRunning)
|
||||||
callAction(intent, if (intent?.action == ACTION_CALL) "call" else "dial")
|
callAction(intent, if (intent?.action == ACTION_CALL) "call" else "dial")
|
||||||
else
|
else
|
||||||
BaresipService.callActionUri = URLDecoder.decode(intent.data.toString(), "UTF-8")
|
BaresipService.callActionUri = intent.data.toString()
|
||||||
|
.replace("tel:%2B", "tel:+")
|
||||||
}
|
}
|
||||||
|
|
||||||
permissions = if (Build.VERSION.SDK_INT >= 33)
|
permissions = if (Build.VERSION.SDK_INT >= 33)
|
||||||
@ -867,7 +866,8 @@ class MainActivity : AppCompatActivity() {
|
|||||||
ua.account.resumeUri = uriStr
|
ua.account.resumeUri = uriStr
|
||||||
}
|
}
|
||||||
"tel" -> {
|
"tel" -> {
|
||||||
val uriStr = uri.toString().filterNot{setOf('-', ' ', '(', ')').contains(it)}
|
val uriStr = uri.toString().replace("%2B", "+")
|
||||||
|
.filterNot{setOf('-', ' ', '(', ')').contains(it)}
|
||||||
var account: Account? = null
|
var account: Account? = null
|
||||||
for (a in Account.accounts())
|
for (a in Account.accounts())
|
||||||
if (a.telProvider != "") {
|
if (a.telProvider != "") {
|
||||||
@ -962,7 +962,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val uap = intent.getLongExtra("uap", 0L)
|
val uap = intent.getLongExtra("uap", 0L)
|
||||||
val ua = UserAgent.ofUap(uap)
|
val ua = UserAgent.ofUap(uap)
|
||||||
if (ua == null) {
|
if (ua == null) {
|
||||||
Log.w(TAG, "onNewIntent did not find ua $uap")
|
Log.w(TAG, "handleIntent did not find ua $uap")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (ua.account.aor != aorSpinner.tag)
|
if (ua.account.aor != aorSpinner.tag)
|
||||||
|
|||||||
Reference in New Issue
Block a user