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