【发布时间】:2019-10-06 10:06:10
【问题描述】:
在我使用下面的代码结束通话之前
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)
}
}
但现在在 API 29 中,telecomManager.endCall() 显示已弃用。 我是否必须创建在后台运行的服务 CallScreeningService 或 InCallService?在没有 endCall() 第三方应用程序的直接方法的情况下,如果不成为默认调用者应用程序,则无法执行此操作。 如果是这样,那么我将如何获取通话详细信息以及如何让我的服务在中文 rom 的后台运行
【问题讨论】:
-
您的问题是什么? Docs 解释你应该改用什么
标签: android deprecated phone-call telecom-manager