adb命令用于呼叫状态详细信息

时间:2018-01-24 09:42:26

标签: android shell adb appium call

我想获得一个adb命令,其中包含映射到当前调用状态的代码的响应

呼叫状态我的意思是以下链接

https://developer.android.com/reference/android/telecom/Call.html#STATE_ACTIVE

这些值更具代表性,在执行adb命令时在命令shell中获取这些值对我很有帮助

我只是按照以下命令

设法让他们登录日志
adb logcat -d | findstr -i InCallFragment.setCallState

但是我无法将状态值作为任何adb命令的响应

任何帮助将不胜感激 感谢

了解更多插图 请将手机连接到电脑,拨打电话并结束电话 使用上面的命令来转储缓冲区 参考状态值

3 个答案:

答案 0 :(得分:0)

通过修改自定义ROM(LineageOS)并添加android.util.Log行以打印每个州,我已经实现了您想要做的事情。

在我的情况下,我修改了类:

拨打

  

框架/选择/电话/ SRC / JAVA / COM /机器人/内部/电话/ Call.java

我所做的是在getState(...)方法中,添加以下行:

person_id     address        team_id
10051        US. Idaho          1
10152        US. Connecticut    1
10053        CH. Aargau         1
10054        CH. Bern           1
10055        JP. Tokyo          2
10056        JP. Ginza          2
10057        Uneo of JP         2

有了这个我要做的就是在adb logcat中搜索myTAG。

我认为否则你无法做到......

答案 1 :(得分:0)

您可以使用adb shell service call telecom [code]命令。 getCallState()的代码将有所不同depending on the Android version

6.0.1: 26
7.0.0: 27
7.1.0: 27
7.1.2: 27
8.0.0: 29
8.1.0: 29

答案 2 :(得分:0)

您可以使用dumpsys telecomm服务:

adb shell dumpsys telecom
CallsManager: 
mCalls:
[TC@7, ACTIVE, com.android.phone/com.android.services.telephony.TelephonyConnectionService, tel:***, A, childs(0), has_parent(false), [Capabilities: CAPABILITY_HOLD CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:]]
mCallAudioManager:
All calls:
  TC@7
Active dialing, or connecting calls:
  TC@7
Ringing calls:
Holding calls:
Foreground call:
[TC@7, ACTIVE, com.android.phone/com.android.services.telephony.TelephonyConnectionService, tel:***, A, childs(0), has_parent(false), [Capabilities: CAPABILITY_HOLD CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:]]
mTtyManager:
mCurrentTtyMode: 0
mInCallController:
mInCallServices (InCalls registered):
.
.
Call TC@7 [2018-06-05 14:38:41.505](MO - outgoing)
  To address: tel:***
  14:38:41.508 - CREATED:PCR.oR@DMA
  14:38:41.511 - SET_CONNECTING (ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [8c3d1caa626a79d75b154221ea94852a62fee7b3], UserHandle{0}):PCR.oR@DMA
  14:38:41.847 - AUDIO_ROUTE (Leaving state QuiescentEarpieceRoute):PCR.oR->CAMSM.pM_2001->CARSM.pM_SWITCH_FOCUS@DMA_2_2
  14:38:41.847 - AUDIO_ROUTE (Entering state ActiveEarpieceRoute):PCR.oR->CAMSM.pM_2001->CARSM.pM_SWITCH_FOCUS@DMA_2_2
  14:38:43.442 - BIND_CS (ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}):NOCBIR.oR@DMU
  14:38:43.519 - CS_BOUND (ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}):SBC.oSC@DMY
  14:38:43.519 - START_CONNECTION (tel:***):SBC.oSC@DMY
  14:38:43.703 - CAPABILITY_CHANGE (Current: [[ sup_hld mut !v2a]], Removed [[]], Added [[ sup_hld mut !v2a]]):CSW.hCCC@DMg
  14:38:43.706 - SET_DIALING (successful outgoing call):CSW.hCCC@DMg
  14:38:47.560 - SET_ACTIVE (active set explicitly):CSW.sA@DNM
  14:38:47.639 - CAPABILITY_CHANGE (Current: [[ hld sup_hld mut !v2a]], Removed [[]], Added [[ hld]]):CSW.sCC@DNY
  Timings (average for this call, milliseconds):
    bind_cs: 77.00
    outgoing_time_to_dialing: 187.00