How to cancel outgoing phone call on android 6.0.1

2019-08-20 08:04发布

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 ?

0条回答
登录 后发表回答