从logcat Android-TV提取命令

问题描述

我试图提取在单击Android TV上的特定按钮时调用的命令,最终我想将其添加到应用程序中,但现在我只是希望通过ADB进行调用以进行测试。

10-14 10:18:16.654  5058  5058 D SourceElementCallback: onElementClick position:7
10-14 10:18:16.656  5058  5058 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1611 android.content.Contextwrapper.bindService:698 org.droidtv.channels.sources.sourcesUtils.bindToLoggingService:743 org.droidtv.channels.sources.sourcesUtils.switchTo:327 org.droidtv.channels.sources.sourceElementCallback.onElementClick:82
10-14 10:18:16.658  5058  5058 D SourcesUtils: PAsstHROUGH sourceUri:content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5
10-14 10:18:16.660  3878  3972 D org.droidtv.candeebug.Gateway: Returning successfully for event: {"event-type":"unkNown.28","boot-count":9,"standby-count":9,"kernel-time":4030979,"data":{"original-event-type":28,"InputName":"Computer","uiname":"HDMI 1","ver":1}}
10-14 10:18:16.661  3878  5242 D org.droidtv.candeebug.h.a: Updated total event size to: 6815
10-14 10:18:16.670  2325  5682 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://android.media.tv/passthrough/com.mediatek.tvinput/.hdmi.HDMIInputService/HW5 flg=0x10000000 cmp=org.droidtv.playtv/.PlayTvActivity (has extras)} from uid 1000
10-14 10:18:16.673  3540  3540 D PlayTvActivity: onNewIntent Action android.intent.action.VIEW data content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5
10-14 10:18:16.673  3540  3540 D PlayTvActivity: device ID =5
10-14 10:18:16.673  3540  3540 D PlayTvActivity: onNewIntent: ACTION_VIEW fav_list_id -1
10-14 10:18:16.685  3540  3540 D PlayTvActivity: onResume STATE_STARTED
10-14 10:18:16.686  3540  3540 D TvSessionManager: setStreamType value true

看起来是这样的动作?通过亚行怎么称呼它?

sourceUri:content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5

解决方法

您必须通过以下方式致电活动经理import { observable,action,makeObservable } from "mobx"; export class myStore { @observable name: string = "CHAN"; constructor() { makeObservable(this) } @action setName(newName: string) { this.name = newName; } }

am

考虑到该意图包含额外的内容(请参阅adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput/.hdmi.HDMIInputService/HW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000 ),则可以对上述命令进行一些扩展,以便也添加此附加信息。

棘手的部分是了解要传递给活动管理器的键名和类型(我指的是“设备ID”,它似乎是额外提供的数据)。

假设这是一个int值,则必须附加:

(has extras)

更多信息here

,
adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tvinput%2F.hdmi.HDMIInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

它与%2F:-)

一起使用