通过ADB命令查询电话 [英] Query a phone call via ADB commands

查看:526
本文介绍了通过ADB命令查询电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用ADB命令查询电话状态?

Is there a way to query a phone call status with ADB commands?

例如,我想查看在通话过程中电话是否仍然处于活动状态,或者是否不存在(已掉线)

For instance, I want to see if a phone call is still active while in a phone call or if it is not there (has dropped)

推荐答案

您可以使用 dumpsys 命令。

$ adb shell dumpsys telephony.registry

该字段 mCallState 给出呼叫状态:

$ adb shell dumpsys telephony.registry | grep "mCallState"




  1. 空闲模式:

$ adb shell dumpsys telephony.registry | grep "mCallState"         
mCallState=0


  • 当通话已连接时

    $ adb shell dumpsys telephony.registry | grep "mCallState"         
    mCallState=2
    


  • 传入呼叫(电话处于响铃模式):

  • When an incoming call (Phone in ringing mode):

    $ adb shell dumpsys telephony.registry | grep "mCallState\|mCallIncomingNumber"
    mCallState=1
    mCallIncomingNumber=+9191XXXXXXXX
    


  • 此处提供更多信息:


    1. Android TelephonyManager

    2. TelephonyManager 通话状态

    1. Android TelephonyManager.
    2. TelephonyManager Call States.

    Android v4.4.4

    其他

    您可以使用 dumpsys 获取很多信息。 >
    要查看dumpsys支持哪些参数,请使用 adb shell dumpsys | grep服务提供者

    Misc:
    You can get a lot of information using dumpsys.
    To see what parameters dumpsys support use adb shell dumpsys | grep "DUMP OF SERVICE".

    这篇关于通过ADB命令查询电话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆