diff options
| author | 2023-02-21 14:18:10 +0000 | |
|---|---|---|
| committer | 2023-02-27 10:04:49 +0000 | |
| commit | e39fa8274eb78b022e87a894466f786491e64a8d (patch) | |
| tree | 3edc31a3d8a382d3b3002dd01e1dd34858291a21 | |
| parent | c8d683a04029e4cbd0ba678263086bdaa46895ff (diff) | |
Disable wtf dropbox entries by default.
Create a list of dropbox tags that are disabled by default. Currently
all tags were enabled by default, so this allows the other way too. We
can then easily turn wtf event collection back on for dogfood.
Bug: 270132337
Test: N/A
Change-Id: Ia678215c34df6ba9a354b3011a90f8f445c493b2
Merged-In: Ia678215c34df6ba9a354b3011a90f8f445c493b2
(cherry picked from commit e70680ebc55ab4ce1a8d9917e9a3540915a60839)
| -rw-r--r-- | services/core/java/com/android/server/DropBoxManagerService.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/DropBoxManagerService.java b/services/core/java/com/android/server/DropBoxManagerService.java index 725ea5c1b3dd..19e5cb142cfd 100644 --- a/services/core/java/com/android/server/DropBoxManagerService.java +++ b/services/core/java/com/android/server/DropBoxManagerService.java @@ -79,6 +79,7 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.SortedSet; import java.util.TreeSet; import java.util.zip.GZIPOutputStream; @@ -105,6 +106,10 @@ public final class DropBoxManagerService extends SystemService { // Size beyond which to force-compress newly added entries. private static final long COMPRESS_THRESHOLD_BYTES = 16_384; + // Tags that we should drop by default. + private static final List<String> DISABLED_BY_DEFAULT_TAGS = + List.of("data_app_wtf", "system_app_wtf", "system_server_wtf"); + // TODO: This implementation currently uses one file per entry, which is // inefficient for smallish entries -- consider using a single queue file // per tag (or even globally) instead. @@ -549,8 +554,13 @@ public final class DropBoxManagerService extends SystemService { public boolean isTagEnabled(String tag) { final long token = Binder.clearCallingIdentity(); try { - return !"disabled".equals(Settings.Global.getString( + if (DISABLED_BY_DEFAULT_TAGS.contains(tag)) { + return "enabled".equals(Settings.Global.getString( + mContentResolver, Settings.Global.DROPBOX_TAG_PREFIX + tag)); + } else { + return !"disabled".equals(Settings.Global.getString( mContentResolver, Settings.Global.DROPBOX_TAG_PREFIX + tag)); + } } finally { Binder.restoreCallingIdentity(token); } |