How to cancel outgoing phone call on android 6.0.1

跟風遠走 提交于 2020-01-06 06:40:06

问题


I have the receiver that is triggered when outgoing call is placed.

Now I am trying to figure it out how to cancel the outgoing call. The phone I need to implement this has 6.0.1 SDK 23 android version, and it is a company phone for a specific purpose.

I was able to implement it in version 8 of android with this approach

TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);

telecomManager.endCall()

but on android 6.0 I get no permission on

   if (ActivityCompat.checkSelfPermission(context, 
     Manifest.permission.ANSWER_PHONE_CALLS) != PackageManager.PERMISSION_GRANTED)

because it is included only in android version 8

I tried this approach with ITelephony but my ide is throwing all kinds of errors.

Any idea how to cancel call on 6.0.1 ?

来源:https://stackoverflow.com/questions/55519529/how-to-cancel-outgoing-phone-call-on-android-6-0-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!