More USSD and MMI code handling improvements

Removed support for secret codes (not permitted)
This commit is contained in:
Juha Heinanen
2026-07-04 10:18:49 +03:00
parent 8545ca10c3
commit ee1dcb44d2
5 changed files with 13 additions and 14 deletions
@@ -1699,13 +1699,6 @@ class BaresipService: Service() {
val ua = UserAgent.ofUap(uap)
if (ua != null && ua.account.isMobile) {
val user = Utils.uriUserPart(uri)
if (user.startsWith("*#*#") && user.endsWith("#*#*")) {
val code = user.substring(4, user.length - 4)
val intent = Intent("android.provider.Telephony.SECRET_CODE", "android_secret_code://$code".toUri())
sendBroadcast(intent)
postServiceEvent(ServiceEvent("ussd response", arrayListOf(uap, user, ""), System.nanoTime()))
return
}
if (user == "*#06#") {
val imei = getDeviceId(this)
postServiceEvent(ServiceEvent("imei", arrayListOf(uap, user, imei), System.nanoTime()))
@@ -2359,7 +2352,7 @@ class BaresipService: Service() {
return try {
tm.imei ?: tm.meid ?: "N/A"
} catch (_: SecurityException) {
"N/A"
getString(R.string.permission_denied)
}
}