@Implements(android.os.DropBoxManager.class) public class ShadowDropBoxManager extends Object
Constructor | Description |
---|---|
ShadowDropBoxManager() |
Modifier and Type | Method | Description |
---|---|---|
void |
addData(String tag,
long wallTimestamp,
byte[] data) |
Adds entry to the DropboxManager with the flag indicating data is text.
|
protected void |
addText(String tag,
String data) |
Adds a text entry to dropbox with the current timestamp using UTF-8 encoding.
|
protected DropBoxManager.Entry |
getNextEntry(String tag,
long millis) |
|
void |
reset() |
Clears all entries.
|
public void addData(String tag, long wallTimestamp, byte[] data)
The existing DropBoxManager.addData(java.lang.String, byte[], int)
and DropBoxManager.addFile(java.lang.String, java.io.File, int)
methods in
DropBoxManager are not shadowed (and do not work), but DropBoxManager.addText(java.lang.String, java.lang.String)
is. This
method is a convenience for quickly adding multiple historical entries. The entries can be
added in any order since this shadow will sort the entries by the specified timestamp.
The flag will be set to DropBoxManager.IS_TEXT
so that DropBoxManager.Entry.getText(int)
can be used.
tag
- can be any arbitrary stringtimestamp
- a unique timestamp for the entry, relative to System.currentTimeMillis()
data
- must not be null@Implementation protected void addText(String tag, String data)
If adding multiple entries, it is required to ensure they have unique timestamps by bumping
the wall-clock time, using SystemClock
or similar.
public void reset()
@Implementation protected DropBoxManager.Entry getNextEntry(String tag, long millis)