AOSP Expert & Production Engineering
2 min read

DropBox

The DropBoxManager Service

The DropBoxManager is a core Android system service designed to securely store and manage large blobs of diagnostic data. Unlike logcat, which is a continuous stream of small messages, DropBox is built for discrete, heavy events like application crashes, Application Not Responding (ANR) traces, and strict mode violations.

Data stored in the DropBox persists across reboots and is eventually gathered by the bugreport mechanism.

Common DropBox Entries

When a critical error occurs, the system generates a specific type of entry in the DropBox:

  • system_app_crash: A Java-level crash (Unhandled Exception) in a system app.
  • data_app_crash: A crash in a user-installed app.
  • system_app_anr: Traces collected when an app blocks the main thread for too long.
  • system_server_wtf: "What a Terrible Failure." These are conditions that should theoretically never happen, logged by the Log.wtf() API. It generates a stack trace but usually does not crash the process.
  • system_app_strictmode: Violations of StrictMode policies (e.g., performing disk I/O on the main thread).

Reading DropBox Entries via ADB

You can interact with the DropBoxManager service using the dumpsys dropbox command.

To list all available DropBox entries with their timestamps:

adb shell dumpsys dropbox

To view the contents of a specific entry (or the latest entry of a specific type), you specify the tag:

# Print the latest system server crash
adb shell dumpsys dropbox system_server_crash --print

Java API Example

System applications with the correct permissions can read from the DropBoxprogrammatically:

DropBoxManager dbm = (DropBoxManager) context.getSystemService(Context.DROPBOX_SERVICE);
DropBoxManager.Entry entry = dbm.getNextEntry("system_app_crash", 0);
if (entry != null) {
    String crashData = entry.getText(8192); // Read up to 8KB
    entry.close();
}

DropBox Retention Policy

The DropBox is not infinite. It writes files to /data/system/dropbox/. The DropBoxManagerService enforces a strict retention policy to prevent the /data partition from filling up.

  • Age Limit: By default, entries older than 3 days are purged.
  • Size Limits: The total size of the DropBox directory is capped (usually around 10MB to 20MB, depending on device configuration). Once the limit is reached, the oldest entries are deleted to make room for new ones.