# DropBoxManager

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/os/DropBoxManager#nestedclasses)\|[Constants](https://developer.android.com/reference/android/os/DropBoxManager#constants)\|[Protected Ctors](https://developer.android.com/reference/android/os/DropBoxManager#proctors)\|[Methods](https://developer.android.com/reference/android/os/DropBoxManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/os/DropBoxManager#inhmethods)  

# DropBoxManager

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/os/DropBoxManager "View this page in Kotlin")\|Java

`
public


class
DropBoxManager
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.DropBoxManager |

<br />

*** ** * ** ***

Enqueues chunks of data (from various sources -- application crashes, kernel log records, etc.). The queue is size bounded and will drop old data if the enqueued data exceeds the maximum size. You can think of this as a persistent, system-wide, blob-oriented "logcat".

DropBoxManager entries are not sent anywhere directly, but other system services and debugging tools may scan and upload entries for processing.

## Summary

|                                                                  ### Nested classes                                                                   ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [DropBoxManager.Entry](https://developer.android.com/reference/android/os/DropBoxManager.Entry) A single entry retrieved from the drop box. |

|                                                                                                                                                                                                                                          ### Constants                                                                                                                                                                                                                                           ||
|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED) Broadcast Action: This is broadcast when a new entry is added in the dropbox.                                                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_DROPPED_COUNT](https://developer.android.com/reference/android/os/DropBoxManager#EXTRA_DROPPED_COUNT) Extra for[ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED): integer value containing number of broadcasts dropped due to rate limiting on this[EXTRA_TAG](https://developer.android.com/reference/android/os/DropBoxManager#EXTRA_TAG) |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_TAG](https://developer.android.com/reference/android/os/DropBoxManager#EXTRA_TAG) Extra for[ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED): string containing the dropbox tag.                                                                                                                                                             |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_TIME](https://developer.android.com/reference/android/os/DropBoxManager#EXTRA_TIME) Extra for[ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED): long integer value containing time (in milliseconds since January 1, 1970 00:00:00 UTC) when the entry was created.                                                                          |
| `int`                                                              | [IS_EMPTY](https://developer.android.com/reference/android/os/DropBoxManager#IS_EMPTY) Flag value: Entry's content was deleted to save space.                                                                                                                                                                                                                                                                                |
| `int`                                                              | [IS_GZIPPED](https://developer.android.com/reference/android/os/DropBoxManager#IS_GZIPPED) Flag value: Content can be decompressed with java.util.zip.GZIPOutputStream.                                                                                                                                                                                                                                                      |
| `int`                                                              | [IS_TEXT](https://developer.android.com/reference/android/os/DropBoxManager#IS_TEXT) Flag value: Content is human-readable UTF-8 text (can be combined with IS_GZIPPED).                                                                                                                                                                                                                                                     |

|                                                           ### Protected constructors                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[DropBoxManager](https://developer.android.com/reference/android/os/DropBoxManager#DropBoxManager())`() ` Create an instance for testing. |

|                                                                                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                            | ` `[addData](https://developer.android.com/reference/android/os/DropBoxManager#addData(java.lang.String,%20byte[],%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` tag, byte[] data, int flags) ` Stores binary data, which may be ignored or discarded as with[addText(String, String)](https://developer.android.com/reference/android/os/DropBoxManager#addText(java.lang.String,%20java.lang.String)).                                                                          |
| ` void`                                                                                            | ` `[addFile](https://developer.android.com/reference/android/os/DropBoxManager#addFile(java.lang.String,%20java.io.File,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` tag, `[File](https://developer.android.com/reference/java/io/File)` file, int flags) ` Stores the contents of a file, which may be ignored or discarded as with[addText(String, String)](https://developer.android.com/reference/android/os/DropBoxManager#addText(java.lang.String,%20java.lang.String)). |
| ` void`                                                                                            | ` `[addText](https://developer.android.com/reference/android/os/DropBoxManager#addText(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` tag, `[String](https://developer.android.com/reference/java/lang/String)` data) ` Stores human-readable text.                                                                                                                                                                                                 |
| ` `[DropBoxManager.Entry](https://developer.android.com/reference/android/os/DropBoxManager.Entry) | ` `[getNextEntry](https://developer.android.com/reference/android/os/DropBoxManager#getNextEntry(java.lang.String,%20long))`(`[String](https://developer.android.com/reference/java/lang/String)` tag, long msec) ` Gets the next entry from the drop box*after*the specified time.                                                                                                                                                                                                                               |
| ` boolean`                                                                                         | ` `[isTagEnabled](https://developer.android.com/reference/android/os/DropBoxManager#isTagEnabled(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` tag) ` Checks any denylists (set in system settings) to see whether a certain tag is allowed.                                                                                                                                                                                                                           |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### ACTION_DROPBOX_ENTRY_ADDED

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_DROPBOX_ENTRY_ADDED
```

Broadcast Action: This is broadcast when a new entry is added in the dropbox. For apps targeting 35 and later, For apps targeting Android versions lower than 35, you must hold[Manifest.permission.READ_LOGS](https://developer.android.com/reference/android/Manifest.permission#READ_LOGS). This broadcast can be rate limited for low priority entries

This is a protected intent that can only be sent by the system.

<br />

Constant Value: "android.intent.action.DROPBOX_ENTRY_ADDED"  

### EXTRA_DROPPED_COUNT

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_DROPPED_COUNT
```

Extra for[ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED): integer value containing number of broadcasts dropped due to rate limiting on this[EXTRA_TAG](https://developer.android.com/reference/android/os/DropBoxManager#EXTRA_TAG)

<br />

Constant Value: "android.os.extra.DROPPED_COUNT"  

### EXTRA_TAG

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_TAG
```

Extra for[ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED): string containing the dropbox tag.

<br />

Constant Value: "tag"  

### EXTRA_TIME

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_TIME
```

Extra for[ACTION_DROPBOX_ENTRY_ADDED](https://developer.android.com/reference/android/os/DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED): long integer value containing time (in milliseconds since January 1, 1970 00:00:00 UTC) when the entry was created.

<br />

Constant Value: "time"  

### IS_EMPTY

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int IS_EMPTY
```

Flag value: Entry's content was deleted to save space.

<br />

Constant Value: 1 (0x00000001)  

### IS_GZIPPED

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int IS_GZIPPED
```

Flag value: Content can be decompressed with java.util.zip.GZIPOutputStream.

<br />

Constant Value: 4 (0x00000004)  

### IS_TEXT

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int IS_TEXT
```

Flag value: Content is human-readable UTF-8 text (can be combined with IS_GZIPPED).

<br />

Constant Value: 2 (0x00000002)

## Protected constructors

### DropBoxManager

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected DropBoxManager ()
```

Create an instance for testing. All methods will fail unless overridden with an appropriate mock implementation. To obtain a functional instance, use[Context.getSystemService(Class)](https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)).

<br />

## Public methods

### addData

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void addData (String tag, 
                byte[] data, 
                int flags)
```

Stores binary data, which may be ignored or discarded as with[addText(String, String)](https://developer.android.com/reference/android/os/DropBoxManager#addText(java.lang.String,%20java.lang.String)).

<br />

|                                                                                                                                                                         Parameters                                                                                                                                                                         ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tag`   | `String`: describing the type of entry being stored This value cannot be`null`. <br />                                                                                                                                                                                                                                                            |
| `data`  | `byte`: value to store This value may be`null`. <br />                                                                                                                                                                                                                                                                                            |
| `flags` | `int`: describing the data Value is either`0`or a combination of[IS_EMPTY](https://developer.android.com/reference/android/os/DropBoxManager#IS_EMPTY),[IS_TEXT](https://developer.android.com/reference/android/os/DropBoxManager#IS_TEXT), and[IS_GZIPPED](https://developer.android.com/reference/android/os/DropBoxManager#IS_GZIPPED) <br /> |

### addFile

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void addFile (String tag, 
                File file, 
                int flags)
```

Stores the contents of a file, which may be ignored or discarded as with[addText(String, String)](https://developer.android.com/reference/android/os/DropBoxManager#addText(java.lang.String,%20java.lang.String)).

<br />

|                                                                                                                                                                         Parameters                                                                                                                                                                         ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tag`   | `String`: describing the type of entry being stored This value cannot be`null`. <br />                                                                                                                                                                                                                                                            |
| `file`  | `File`: to read from This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                           |
| `flags` | `int`: describing the data Value is either`0`or a combination of[IS_EMPTY](https://developer.android.com/reference/android/os/DropBoxManager#IS_EMPTY),[IS_TEXT](https://developer.android.com/reference/android/os/DropBoxManager#IS_TEXT), and[IS_GZIPPED](https://developer.android.com/reference/android/os/DropBoxManager#IS_GZIPPED) <br /> |

|                                                 Throws                                                  ||
|----------------------------------------------------------------------------|-----------------------------|
| [IOException](https://developer.android.com/reference/java/io/IOException) | if the file can't be opened |

### addText

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void addText (String tag, 
                String data)
```

Stores human-readable text. The data may be discarded eventually (or even immediately) if space is limited, or ignored entirely if the tag has been blocked (see[isTagEnabled(String)](https://developer.android.com/reference/android/os/DropBoxManager#isTagEnabled(java.lang.String))).

<br />

|                                           Parameters                                           ||
|--------|----------------------------------------------------------------------------------------|
| `tag`  | `String`: describing the type of entry being stored This value cannot be`null`. <br /> |
| `data` | `String`: value to store This value cannot be`null`. <br />                            |

### getNextEntry

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DropBoxManager.Entry getNextEntry (String tag, 
                long msec)
```

Gets the next entry from the drop box*after* the specified time. You must always call[Entry.close()](https://developer.android.com/reference/android/os/DropBoxManager.Entry#close())on the return value![Manifest.permission.READ_LOGS](https://developer.android.com/reference/android/Manifest.permission#READ_LOGS)permission is required for apps targeting Android versions lower than 35.  
Requires[Manifest.permission.READ_DROPBOX_DATA](https://developer.android.com/reference/android/Manifest.permission#READ_DROPBOX_DATA)and[Manifest.permission.PACKAGE_USAGE_STATS](https://developer.android.com/reference/android/Manifest.permission#PACKAGE_USAGE_STATS)

<br />

|                            Parameters                            ||
|--------|----------------------------------------------------------|
| `tag`  | `String`: of entry to look for, null for all tags <br /> |
| `msec` | `long`: time of the last entry seen <br />               |

|                                                                           Returns                                                                            ||
|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| [DropBoxManager.Entry](https://developer.android.com/reference/android/os/DropBoxManager.Entry) | the next entry, or null if there are no more entries <br /> |

### isTagEnabled

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isTagEnabled (String tag)
```

Checks any denylists (set in system settings) to see whether a certain tag is allowed. Entries with disabled tags will be dropped immediately, so you can save the work of actually constructing and sending the data.

<br />

|                                                                                                                                                                Parameters                                                                                                                                                                 ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tag` | `String`: that would be used in[addText(String, String)](https://developer.android.com/reference/android/os/DropBoxManager#addText(java.lang.String,%20java.lang.String))or[addFile(String, File, int)](https://developer.android.com/reference/android/os/DropBoxManager#addFile(java.lang.String,%20java.io.File,%20int)) <br /> |

|                             Returns                              ||
|-----------|-------------------------------------------------------|
| `boolean` | whether events with that tag would be accepted <br /> |