LogcatEventParser
public class LogcatEventParser
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.LogcatEventParser |
イベントのlogcat入力を解析します。
このクラスはlogcatメッセージを解釈し、ブロッキングとポーリングの両方の方法でイベントをリスナーに通知できます。
概要
ネストされたクラス | |
---|---|
class | LogcatEventParser.LogcatEvent イベントタイプとトリガーlogcatメッセージでlogcatイベントを保持する構造体 |
パブリックコンストラクター | |
---|---|
LogcatEventParser (ITestDevice device) 新しいLogcatEventParserをインスタンス化します |
パブリックメソッド | |
---|---|
void | close () logcatのリッスンを停止します。 |
void | parseEvents (String[] lines) logcat行を解析し、キャプチャされたイベント( |
LogcatEventParser.LogcatEvent | pollForEvent () イベントキューをポーリングします。 |
void | registerEventTrigger (String tag, String msg, LogcatEventType response) 指定されたlogcatタグとメッセージのイベントを目的の応答に登録します。 |
void | start () logcatのリッスンとイベントの解析を開始します。 |
LogcatEventParser.LogcatEvent | waitForEvent (long timeoutMs) イベントを受信するまでブロックします。 |
パブリックコンストラクター
LogcatEventParser
public LogcatEventParser (ITestDevice device)
新しいLogcatEventParserをインスタンス化します
パラメーター | |
---|---|
device | ITestDevice :からITestDevice を読み取る |
パブリックメソッド
閉じる
public void close ()
logcatのリッスンを停止します。
parseEvents
public void parseEvents (String[] lines)
logcat行を解析し、キャプチャされたイベント( registerEventTrigger(String, String, com.android.tradefed.util.LogcatEventType)
)をイベントキューにregisterEventTrigger(String, String, com.android.tradefed.util.LogcatEventType)
ます。
パラメーター | |
---|---|
lines | String |
pollForEvent
public LogcatEventParser.LogcatEvent pollForEvent ()
イベントキューをポーリングします。すぐに戻ります。
戻り値 | |
---|---|
LogcatEventParser.LogcatEvent | イベント、または一致するイベントが見つからない場合はnull |
registerEventTrigger
public void registerEventTrigger (String tag, String msg, LogcatEventType response)
指定されたlogcatタグとメッセージのイベントを目的の応答に登録します。メッセージが部分的である可能性があります。
パラメーター | |
---|---|
tag | String |
msg | String |
response | LogcatEventType |
開始
public void start ()
logcatのリッスンとイベントの解析を開始します。
waitForEvent
public LogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)
イベントを受信するまでブロックします。
パラメーター | |
---|---|
timeoutMs | long :ミリ秒単位で待機する時間 |
戻り値 | |
---|---|
LogcatEventParser.LogcatEvent | イベントまたはタイムアウトに達した場合はnull |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2020-09-08 UTC。