From 0d70573193d7ef4fd05d6e9607089371c40042cc Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 6 Feb 2023 14:26:05 -0700 Subject: [PATCH] Add dropbox entries as files to dumpstate ZIP. Since each dropbox entry is already stored as a file on disk, include them as-is into the dumpstate ZIP file. The dumpsys output has already included truncated versions of all dropbox entries for many years, and adding them as separate files inside the dumpstate ZIP will speed up debugging and issue triage. Bug: 267673062 Test: manual Change-Id: I5a45e39012cebc5fea1e2d0be3146519de7cafd8 --- .../com/android/server/DropBoxManagerService.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/services/core/java/com/android/server/DropBoxManagerService.java b/services/core/java/com/android/server/DropBoxManagerService.java index 1d457aa933d77..2fa18af82fc39 100644 --- a/services/core/java/com/android/server/DropBoxManagerService.java +++ b/services/core/java/com/android/server/DropBoxManagerService.java @@ -693,7 +693,7 @@ public final class DropBoxManagerService extends SystemService { out.append(file.getPath()).append("\n"); } - if ((entry.flags & DropBoxManager.IS_TEXT) != 0 && (doPrint || !doFile)) { + if ((entry.flags & DropBoxManager.IS_TEXT) != 0 && doPrint) { DropBoxManager.Entry dbe = null; InputStreamReader isr = null; try { @@ -717,17 +717,6 @@ public final class DropBoxManagerService extends SystemService { } } if (!newline) out.append("\n"); - } else { - String text = dbe.getText(70); - out.append(" "); - if (text == null) { - out.append("[null]"); - } else { - boolean truncated = (text.length() == 70); - out.append(text.trim().replace('\n', '/')); - if (truncated) out.append(" ..."); - } - out.append("\n"); } } catch (IOException e) { out.append("*** ").append(e.toString()).append("\n");