public class TraceVehicleDataSource extends ContextualVehicleDataSource implements java.lang.Runnable
BaseVehicleDataSource.setCallback(SourceCallback)
function.| Constructor and Description |
|---|
TraceVehicleDataSource(android.content.Context context,
java.lang.String filename) |
TraceVehicleDataSource(android.content.Context context,
java.net.URI filename) |
TraceVehicleDataSource(android.content.Context context,
java.net.URI filename,
boolean loop) |
TraceVehicleDataSource(SourceCallback callback,
android.content.Context context,
java.net.URI filename)
Construct a trace data source with the given context, callback and
trace file resource URI.
|
TraceVehicleDataSource(SourceCallback callback,
android.content.Context context,
java.net.URI filename,
boolean loop) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getTag()
Return a string suitable as a tag for logging.
|
boolean |
isConnected()
Consider the trace source "connected" if it's running and at least 1
measurement was parsed successfully from the file.
|
void |
run()
While running, continuously read from the trace file and send messages
to the callback.
|
boolean |
sameFilename(java.lang.String filename) |
void |
start() |
void |
startThread(SourceCallback userCallback,
android.content.Context context) |
void |
stop()
Stop trace file playback and the playback thread.
|
java.lang.String |
toString() |
static boolean |
validatePath(java.lang.String path) |
getContextconnected, disconnected, getCallback, handleMessage, onPipelineActivated, onPipelineDeactivated, setCallback, waitForCallbackpublic TraceVehicleDataSource(SourceCallback callback, android.content.Context context, java.net.URI filename) throws DataSourceException
context - the Activity or Service context, used to access the raw
trace file resource via Android.callback - An object implementing the SourceCallback interface that
should receive data as it is received and parsed.filename - a raw file resource URI of the format
"resource://resource_id"DataSourceException - if no filename is specifiedpublic TraceVehicleDataSource(SourceCallback callback, android.content.Context context, java.net.URI filename, boolean loop) throws DataSourceException
DataSourceExceptionpublic TraceVehicleDataSource(android.content.Context context,
java.net.URI filename)
throws DataSourceException
DataSourceExceptionpublic TraceVehicleDataSource(android.content.Context context,
java.lang.String filename)
throws DataSourceException
DataSourceExceptionpublic TraceVehicleDataSource(android.content.Context context,
java.net.URI filename,
boolean loop)
throws DataSourceException
DataSourceExceptionpublic boolean isConnected()
isConnected in interface VehicleDataSourceisConnected in class BaseVehicleDataSourcepublic void stop()
stop in interface VehicleDataSourcestop in class BaseVehicleDataSourcepublic void start()
public void startThread(SourceCallback userCallback, android.content.Context context)
public void run()
run in interface java.lang.Runnablepublic static boolean validatePath(java.lang.String path)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean sameFilename(java.lang.String filename)
protected java.lang.String getTag()
BaseVehicleDataSourcegetTag in class BaseVehicleDataSource