6

Before I used below code to end the call

val telecomManager = context.getSystemService(Context.TELECOM_SERVICE) as TelecomManager
                if (PermissionsUtil(context).checkPermissions()) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                        telecomManager.endCall()
                    } else {
                        //telecomManager.isInCall
                        declinePhone(context)
                    }
                }

but now in API 29 telecomManager.endCall() shows deprecated. Do I have to create a service running in the background CallScreeningService or InCallService? where there is no direct method for endCall() third party apps cannot do this without becoming a default caller app. If so then how I will get the call details and how to keep my service running in the background for Chinese rom

YLS
  • 1,475
  • 2
  • 15
  • 35
  • 2
    What is your question? [Docs](https://developer.android.com/reference/android/telecom/TelecomManager#endCall()) explain what you should use instead – Pawel Oct 06 '19 at 10:26

1 Answers1

0

Yes, you have to create a CallScreeningService and users have to choose your app as an default app for Call Screening service....