GenericLogcatEventParser
public class GenericLogcatEventParser
extends Object
java.lang.オブジェクト | |
↳ | 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 行を解析し、キャプチャされたイベント ( |
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 を聞くのをやめてください。
イベントの解析
public void parseEvents (String[] lines)
logcat 行を解析し、キャプチャされたイベント ( registerEventTrigger(String, String, LogcatEventType)
で登録されたもの) をイベント キューに追加します。
パラメーター | |
---|---|
lines | String |
イベントの投票
public GenericLogcatEventParser.LogcatEvent pollForEvent ()
イベントキューをポーリングします。すぐに戻ります。
戻り値 | |
---|---|
GenericLogcatEventParser.LogcatEvent | イベント、または一致するイベントが見つからない場合はnull |
登録イベントトリガー
public void registerEventTrigger (String tag, String msg, LogcatEventType response)
指定された logcat タグのイベントと、必要な応答を含むメッセージを登録します。メッセージは部分的である可能性があります。
パラメーター | |
---|---|
tag | String |
msg | String |
response | LogcatEventType |
登録イベントトリガー
public void registerEventTrigger (Log.LogLevel logLevel, String tag, String msg, LogcatEventType response)
指定された logcat レベル、タグ、およびメッセージのイベントを、必要な応答とともに登録します。メッセージは部分的である可能性があります。
パラメーター | |
---|---|
logLevel | Log.LogLevel |
tag | String |
msg | String |
response | LogcatEventType |
始める
public void start ()
logcat のリッスンとイベントの解析を開始します。
イベント待ち
public GenericLogcatEventParser.LogcatEvent waitForEvent (long timeoutMs)
イベントを受信するまでブロックします。
パラメーター | |
---|---|
timeoutMs | long : ミリ秒単位の待機時間 |
戻り値 | |
---|---|
GenericLogcatEventParser.LogcatEvent | イベント、またはタイムアウトに達した場合はnull |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2023-12-01 UTC。