public class DropBoxManager extends Object
You can obtain an instance of this class by calling
Context.getSystemService(java.lang.String)
with Context.DROPBOX_SERVICE
.
DropBoxManager entries are not sent anywhere directly, but other system services and debugging tools may scan and upload entries for processing.
Modifier and Type | Class and Description |
---|---|
static class |
DropBoxManager.Entry
A single entry retrieved from the drop box.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_DROPBOX_ENTRY_ADDED
Broadcast Action: This is broadcast when a new entry is added in the dropbox.
|
static String |
EXTRA_TAG
Extra for
ACTION_DROPBOX_ENTRY_ADDED :
string containing the dropbox tag. |
static String |
EXTRA_TIME
Extra for
ACTION_DROPBOX_ENTRY_ADDED :
long integer value containing time (in milliseconds since January 1, 1970 00:00:00 UTC)
when the entry was created. |
static int |
IS_EMPTY
Flag value: Entry's content was deleted to save space.
|
static int |
IS_GZIPPED
Flag value: Content can be decompressed with
GZIPOutputStream . |
static int |
IS_TEXT
Flag value: Content is human-readable UTF-8 text (can be combined with IS_GZIPPED).
|
Modifier | Constructor and Description |
---|---|
protected |
DropBoxManager()
Create a dummy instance for testing.
|
|
DropBoxManager(IDropBoxManagerService service) |
Modifier and Type | Method and Description |
---|---|
void |
addData(String tag,
byte[] data,
int flags)
Stores binary data, which may be ignored or discarded as with
addText(java.lang.String, java.lang.String) . |
void |
addFile(String tag,
File file,
int flags)
Stores the contents of a file, which may be ignored or discarded as with
addText(java.lang.String, java.lang.String) . |
void |
addText(String tag,
String data)
Stores human-readable text.
|
DropBoxManager.Entry |
getNextEntry(String tag,
long msec)
Gets the next entry from the drop box after the specified time.
|
boolean |
isTagEnabled(String tag)
Checks any blacklists (set in system settings) to see whether a certain
tag is allowed.
|
public static final int IS_EMPTY
public static final int IS_TEXT
public static final int IS_GZIPPED
GZIPOutputStream
.public static final String ACTION_DROPBOX_ENTRY_ADDED
android.Manifest.permission#READ_LOGS
permission
in order to receive this broadcast.
This is a protected intent that can only be sent by the system.
public static final String EXTRA_TAG
ACTION_DROPBOX_ENTRY_ADDED
:
string containing the dropbox tag.public static final String EXTRA_TIME
ACTION_DROPBOX_ENTRY_ADDED
:
long integer value containing time (in milliseconds since January 1, 1970 00:00:00 UTC)
when the entry was created.public DropBoxManager(IDropBoxManagerService service)
protected DropBoxManager()
Context.getSystemService(java.lang.String)
.public void addText(String tag, String data)
isTagEnabled(java.lang.String)
).tag
- describing the type of entry being storeddata
- value to storepublic void addData(String tag, byte[] data, int flags)
addText(java.lang.String, java.lang.String)
.tag
- describing the type of entry being storeddata
- value to storeflags
- describing the datapublic void addFile(String tag, File file, int flags) throws IOException
addText(java.lang.String, java.lang.String)
.tag
- describing the type of entry being storedfile
- to read fromflags
- describing the dataIOException
- if the file can't be openedpublic boolean isTagEnabled(String tag)
tag
- that would be used in addText(java.lang.String, java.lang.String)
or addFile(java.lang.String, java.io.File, int)
public DropBoxManager.Entry getNextEntry(String tag, long msec)
android.permission.READ_LOGS
. You must always call
Entry#close()
on the return value!tag
- of entry to look for, null for all tagsmsec
- time of the last entry seen