LogcatUpdaterEventParser

public class LogcatUpdaterEventParser
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.LogcatUpdaterEventParser


Parse logcat input for system updater related events. In any system with A/B updates, the updater will log its progress to logcat. This class interprets updater-related logcat messages and can inform listeners of events in both a blocking and non-blocking fashion.

Summary

Nested classes

class LogcatUpdaterEventParser.AsyncUpdaterEvent

A monitor object which allows callers to receive events asynchronously. 

Public constructors

LogcatUpdaterEventParser(ILogcatReceiver logcatReceiver)

Public methods

UpdaterEventType waitForEvent(UpdaterEventType expectedEvent, long timeout)

Block until the specified event is encountered or the timeout is reached, then return.

void waitForEvent()

Block until any event is encountered, then return.

void waitForEvent(UpdaterEventType expectedEvent)
LogcatUpdaterEventParser.AsyncUpdaterEvent waitForEventAsync(UpdaterEventType expectedEvent)

Wait for an event but do not block.

Protected methods

UpdaterEventType parseEventType(String lastLine)
void registerEventTrigger(String tag, String msg, UpdaterEventType response)

Public constructors

LogcatUpdaterEventParser

LogcatUpdaterEventParser (ILogcatReceiver logcatReceiver)

Parameters
logcatReceiver ILogcatReceiver

Public methods

waitForEvent

UpdaterEventType waitForEvent (UpdaterEventType expectedEvent, 
                long timeout)

Block until the specified event is encountered or the timeout is reached, then return.

Parameters
expectedEvent UpdaterEventType: the event to wait for
timeout long: the maximum time in milliseconds to wait
Returns
UpdaterEventType

waitForEvent

void waitForEvent ()

Block until any event is encountered, then return.

waitForEvent

void waitForEvent (UpdaterEventType expectedEvent)

Parameters
expectedEvent UpdaterEventType

waitForEventAsync

LogcatUpdaterEventParser.AsyncUpdaterEvent waitForEventAsync (UpdaterEventType expectedEvent)

Wait for an event but do not block.

Parameters
expectedEvent UpdaterEventType: the event type which will trigger a message sent to the caller
Returns
LogcatUpdaterEventParser.AsyncUpdaterEvent an LogcatUpdaterEventParser.AsyncUpdaterEvent monitor which the caller may wait on

Protected methods

parseEventType

UpdaterEventType parseEventType (String lastLine)

Parameters
lastLine String
Returns
UpdaterEventType

registerEventTrigger

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

Parameters
tag String
msg String
response UpdaterEventType