Adds Assistant invocation logging to statsd

This is the first step in migrating the logging from the old framework.
Once the data has been verified, the old logging code will be removed.

Test: Tested locally
BUG: 147508374
BUG: 155745843
Change-Id: I738278c0a3e1ab42b53300792bfd80ae778d6be1
diff --git a/atoms.proto b/atoms.proto
index e8e2af2..36f82ec 100644
--- a/atoms.proto
+++ b/atoms.proto
@@ -449,6 +449,7 @@
         TvTunerDvrStatus tv_tuner_dvr_status = 279 [(module) = "framework"];
         TvCasSessionOpenStatus tv_cas_session_open_status =
             280 [(module) = "framework"];
+        AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
 
         // StatsdStats tracks platform atoms with ids upto 500.
         // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
@@ -10008,3 +10009,42 @@
     // The amount of applied devices within a remote dynamic group after a switching is done.
     optional int32 applied_device_count_within_remote_group = 9;
 }
+
+/**
+ * Logs when the Assistant is invoked.
+ *
+ * Logged from:
+ *   frameworks/base/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
+ */
+message AssistantInvocationReported {
+
+    // The event_id (as for UiEventReported).
+    optional int32 event_id = 1;
+
+    // The registered Assistant's uid and package (as for UiEventReported).
+    optional int32 uid = 2 [(is_uid) = true];
+    optional string package_name = 3;
+
+    // An identifier used to disambiguate which logs refer to a particular invocation of the
+    // Assistant  (as for UiEventReported).
+    optional int32 instance_id = 4;
+
+    // The state of the device at the time of invocation.
+    enum DeviceState {
+        UNKNOWN_DEVICE_STATE = 0;
+        AOD1 = 1;
+        AOD2 = 2;
+        BOUNCER = 3;
+        UNLOCKED_LOCKSCREEN = 4;
+        LAUNCHER_HOME = 5;
+        LAUNCHER_OVERVIEW = 6;
+        LAUNCHER_ALL_APPS = 7;
+        APP_DEFAULT = 8;
+        APP_IMMERSIVE = 9;
+        APP_FULLSCREEN = 10;
+    }
+    optional DeviceState device_state = 5;
+
+    // Whether the Assistant handles were showing at the time of invocation.
+    optional bool assistant_handles_showing = 6;
+}