Create the Atom for external TV input logging

eldar: https://eldar.corp.google.com/assessments/995127561/drafts/204381959?jsmode=o#sections/999006000

Bug: 279185950
Change-Id: Ib6933cfa8b1b305d913241090b10c91cd46087c4
diff --git a/stats/atoms.proto b/stats/atoms.proto
index da87809..cac5c71 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -1062,6 +1062,7 @@
     extensions 714; // AdServicesEnrollmentFailed ad_services_enrollment_failed
     extensions 715; // WearModeStateChanged wear_mode_state_changed
     extensions 716; // LauncherImpressionEventV2 launcher_impression_event_v2
+    extensions 717; // ExternalTvInputEvent external_tv_input_event
     extensions 9999; // Atom9999 atom_9999
     // StatsdStats tracks platform atoms with ids up to 900.
     // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
diff --git a/stats/atoms/tv/tv_extension_atoms.proto b/stats/atoms/tv/tv_extension_atoms.proto
index 8482e32..4004582 100644
--- a/stats/atoms/tv/tv_extension_atoms.proto
+++ b/stats/atoms/tv/tv_extension_atoms.proto
@@ -26,6 +26,7 @@
 
 extend Atom {
   optional TvLowPowerStandbyPolicy tv_low_power_standby_policy = 679 [(module) = "tv_settings"];
+  optional ExternalTvInputEvent external_tv_input_event = 717 [(module) = "framework"];
 }
 
 /**
@@ -38,3 +39,55 @@
    repeated string allowed_features = 4;
    optional bool is_selected = 5;
 }
+
+/**
+ * Logs external TV input events.
+ */
+message ExternalTvInputEvent {
+    enum EventType {
+        UNKNOWN = 0;
+        // a specific input is selected by user/TV App to be displayed on the screen.
+        TUNED = 1;
+        // the currently tuned input is released from the screen by selecting a
+        // new input, TV powering off, going to Home screen, etc.
+        RELEASED = 2;
+        // connection state of the current input is changed,
+        // e.g. connecting/disconnecting the cable.
+        CONNECTION_STATE_CHANGED = 3;
+        // device info is updated for the currently selected HDMI-CEC input.
+        DEVICE_INFO_UPDATED = 4;
+    }
+    enum InputState {
+        // keep in sync with TvInputManager.InputState.
+        CONNECTED = 0;
+        CONNECTED_STANDBY = 1;
+        DISCONNECTED = 2;
+    }
+    enum InputType {
+        // keep in sync with TvinputInfo.Type.
+        TUNER = 0;
+        OTHER = 1000;
+        COMPOSITE = 1001;
+        SVIDEO = 1002;
+        SCART = 1003;
+        COMPONENT = 1004;
+        VGA = 1005;
+        DVI = 1006;
+        HDMI = 1007;
+        DISPLAY_PORT = 1008;
+    }
+    // Type of the event.
+    optional EventType event_type = 1;
+    // Connection state of this input.
+    optional InputState input_state = 2;
+    // type of the input.
+    optional InputType input_type = 3;
+    // timestamp of the event.
+    optional int64 timestamp_in_millis = 4;
+    // Vendor id of the external device for HDMI-CEC input. For non-CEC input, the value is 0.
+    optional int32 device_vendor_id = 5;
+    // HDMI port number on TV for HDMI input. For non-HDMI input, the value is 0.
+    optional int32 hdmi_port = 6;
+    // ID of this TIF (TV Input Framework) session.
+    optional string tif_session_id = 7;
+}