Log USB contaminant status

01-14 21:15:26.223   895  1046 I statsd  : { uid(1000) 1547529326000000000 235342687348 (117)0x10000->port0[S] 0x20000->2[I]  }
01-14 21:15:51.719   895  1046 I statsd  : { uid(1000) 1547529351000000000 260838630045 (117)0x10000->port0[S] 0x20000->3[I]  }
01-14 21:16:51.729   895  1046 I statsd  : { uid(1000) 1547529411000000000 320847794877 (117)0x10000->port0[S] 0x20000->2[I]  }
01-14 21:17:00.552   895  1046 I statsd  : { uid(1000) 1547529420000000000 329671167943 (117)0x10000->port0[S] 0x20000->3[I]  }
01-14 21:18:00.560   895  1046 I statsd  : { uid(1000) 1547529480000000000 389679730223 (117)0x10000->port0[S] 0x20000->2[I]  }

Bug: 119642987
Bug: 122595032
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(117\)

Change-Id: Idf98e4e5dfc44133112c48999eff7cccfd14550d
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 5a6c08d..21b03c4 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -34,6 +34,7 @@
 import "frameworks/base/core/proto/android/server/enums.proto";
 import "frameworks/base/core/proto/android/server/location/enums.proto";
 import "frameworks/base/core/proto/android/service/procstats_enum.proto";
+import "frameworks/base/core/proto/android/service/usb.proto";
 import "frameworks/base/core/proto/android/stats/enums.proto";
 import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
 import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
@@ -207,6 +208,7 @@
         AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
         AdbConnectionChanged adb_connection_changed = 144;
         SpeechDspStatReported speech_dsp_stat_reported = 145;
+        UsbContaminantReported usb_contaminant_reported = 146;
     }
 
     // Pulled events will start at field 10000.
@@ -4537,3 +4539,13 @@
     optional int32 total_crash_count = 3;
     optional int32 total_recover_count = 4;
 }
+
+/**
+ * Logs USB connector contaminant status.
+ *
+ * Logged from: USB Service.
+ */
+message UsbContaminantReported {
+    optional string id = 1;
+    optional android.service.usb.ContaminantPresenceStatus status = 2;
+}