GenericLogcatEventParser

public class GenericLogcatEventParser
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.GenericLogcatEventParser<LogcatEventType>


イベントの logcat 入力を解析します。

このクラスは logcat メッセージを解釈し、ブロッキングとポーリングの両方の方法でリスナーにイベントを通知できます。

概要

ネストされたクラス

class GenericLogcatEventParser.LogcatEvent

イベントタイプとトリガーする logcat メッセージを含む logcat イベントを保持する構造体

パブリック コンストラクタ

GenericLogcatEventParser(ITestDevice device)

新しい LogcatEventParser をインスタンス化します。

パブリック メソッド

void close()

Logcat のリッスンを停止します。

void parseEvents(String[] lines)

logcat 行を解析し、キャプチャされたイベント(registerEventTrigger(String, String, LogcatEventType) で登録されたイベント)をイベントキューに追加します。

GenericLogcatEventParser.LogcatEvent pollForEvent()

イベントキューをポーリングします。

void registerEventTrigger(String tag, String msg, LogcatEventType response)

指定された logcat タグとメッセージのイベントを、目的のレスポンスとともに登録します。

void registerEventTrigger(Log.LogLevel logLevel, String tag, String msg, LogcatEventType response)

指定された Logcat レベル、タグ、メッセージのイベントを、目的のレスポンスとともに登録します。

void start()

logcat のリッスンとイベントの解析を開始します。

GenericLogcatEventParser.LogcatEvent waitForEvent(long timeoutMs)

イベントを受信するまでブロックします。

パブリック コンストラクタ

GenericLogcatEventParser

public GenericLogcatEventParser (ITestDevice device)

新しい LogcatEventParser をインスタンス化します。

パラメータ
device ITestDevice: logcat の読み取り元

パブリック メソッド

閉じる

public void close ()

logcat のリッスンを停止します。

parseEvents

public void parseEvents (String[] lines)

logcat 行を解析し、キャプチャされたイベント(registerEventTrigger(String, String, LogcatEventType) で登録されたイベント)をイベントキューに追加します。

パラメータ
lines String

pollForEvent

public GenericLogcatEventParser.LogcatEvent pollForEvent ()

イベントキューをポーリングします。すぐに返されます。

戻り値
GenericLogcatEventParser.LogcatEvent イベント、または一致するイベントが見つからない場合は null

registerEventTrigger

public void registerEventTrigger (String tag, 
                String msg, 
                LogcatEventType response)

指定された logcat タグとメッセージのイベントを、目的のレスポンスとともに登録します。メッセージが部分的に表示される場合があります。

パラメータ
tag String

msg String

response LogcatEventType

registerEventTrigger

public void registerEventTrigger (Log.LogLevel logLevel, 
                String tag, 
                String msg, 
                LogcatEventType response)

指定された Logcat レベル、タグ、メッセージのイベントを、目的のレスポンスとともに登録します。メッセージは部分的な場合があります。

パラメータ
logLevel Log.LogLevel

tag String

msg String

response LogcatEventType

start

public void start ()

logcat のリッスンとイベントの解析を開始します。

waitForEvent

public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)

イベントを受信するまでブロックします。

パラメータ
timeoutMs long: 待機時間(ミリ秒単位)

戻り値
GenericLogcatEventParser.LogcatEvent イベント、またはタイムアウトに達した場合は null