【问题标题】:Deprecated telecomManager.endCall() in android API 29 android在 android API 29 android 中弃用了 telemanager.endCall()
【发布时间】: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


【解决方案1】:

是的,您必须创建一个 CallScreeningService 并且用户必须选择您的应用作为 Call Screening 服务的默认应用......

【讨论】:

    猜你喜欢
    • 2020-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-29
    • 2020-08-14
    • 2019-06-28
    • 2019-03-09
    相关资源
    最近更新 更多