mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-18 20:40:46 +01:00
decode the incoming call number before displaying
This commit is contained in:
parent
012442a057
commit
9e015c3888
@ -14,12 +14,11 @@ import com.simplemobiletools.contacts.pro.objects.CallManager
|
|||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.M)
|
@TargetApi(Build.VERSION_CODES.M)
|
||||||
class MyIncomingCallService : InCallService() {
|
class MyIncomingCallService : InCallService() {
|
||||||
|
|
||||||
override fun onCallAdded(call: Call) {
|
override fun onCallAdded(call: Call) {
|
||||||
super.onCallAdded(call)
|
super.onCallAdded(call)
|
||||||
call.registerCallback(callCallback)
|
call.registerCallback(callCallback)
|
||||||
|
|
||||||
val handle = call.details.handle.toString()
|
val handle = Uri.decode(call.details.handle.toString())
|
||||||
val callerNumber = if (handle.contains("tel:")) {
|
val callerNumber = if (handle.contains("tel:")) {
|
||||||
handle.substringAfter("tel:")
|
handle.substringAfter("tel:")
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user