Atom change for telecom metrics stage 2

Flag: EXEMPT atoms change
Bug: 397554282
Test: make
Change-Id: I5196d04f3baef59ee90fb7a2e22c5e2f6ce0369b
diff --git a/stats/atoms.proto b/stats/atoms.proto
index fa8d746..42b585f 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -1631,6 +1631,7 @@
     extensions 10232; // ZramMmStatMmd zram_mm_stat_mmd
     extensions 10233; // ZramBdStatMmd zram_bd_stat_mmd
     extensions 10234; // WidgetMemoryStats
+    extensions 10235; // TelecomEventStats telecom_event_stats
     extensions 99999; // Atom99999 atom_99999
 
     // DO NOT USE field numbers above 100,000 in AOSP.
diff --git a/stats/atoms/telecomm/telecom_extension_atom.proto b/stats/atoms/telecomm/telecom_extension_atom.proto
index 6a4673a..7e70674 100644
--- a/stats/atoms/telecomm/telecom_extension_atom.proto
+++ b/stats/atoms/telecomm/telecom_extension_atom.proto
@@ -31,6 +31,7 @@
     optional CallAudioRouteStats call_audio_route_stats = 10222 [(module) = "telecom"];
     optional TelecomApiStats telecom_api_stats = 10223 [(module) = "telecom"];
     optional TelecomErrorStats telecom_error_stats = 10224 [(module) = "telecom"];
+    optional TelecomEventStats telecom_event_stats = 10235 [(module) = "telecom"];
 }
 
 /**
@@ -72,7 +73,6 @@
     // From frameworks/proto_logging/stats/enums/telecomm/enums.proto
     optional android.telecom.AccountTypeEnum account_type = 5;
 
-
     // UID of the package to init the call. This should always be -1/unknown for
     // the private space calls
     optional int32 uid = 6 [(is_uid) = true];
@@ -82,6 +82,15 @@
 
     // Average elapsed time between CALL_STATE_ACTIVE to CALL_STATE_DISCONNECTED.
     optional int32 average_duration_ms = 8;
+
+    // The disconnect cause of the call. Eg. ERROR, LOCAL, REMOTE, etc.
+    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto
+    optional android.telecom.DisconnectCauseEnum disconnect_cause = 9;
+
+    // The type of simultaneous call type. Eg. SINGLE, DUAL_SAME_ACCOUNT,
+    // DUAL_DIFF_ACCOUNT, etc.
+    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto
+    optional android.telecom.SimultaneousTypeEnum simultaneous_type = 10;
 }
 
 /**
@@ -146,3 +155,22 @@
     // The number of times this error occurs
     optional int32 count = 3;
 }
+
+/**
+ * Pulled atom to capture stats of Telecom critical events
+ */
+message TelecomEventStats {
+    // The event name
+    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto
+    optional android.telecom.EventEnum event = 1;
+
+    // UID of the caller. This is always -1/unknown for the private space.
+    optional int32 uid = 2 [(is_uid) = true];
+
+    // The cause related to the event
+    // From frameworks/proto_logging/stats/enums/telecomm/enums.proto
+    optional android.telecom.EventCauseEnum event_cause = 3;
+
+    // The number of times this event occurs
+    optional int32 count = 4;
+}
diff --git a/stats/enums/telecomm/enums.proto b/stats/enums/telecomm/enums.proto
index 7ed21a8..1955c37 100644
--- a/stats/enums/telecomm/enums.proto
+++ b/stats/enums/telecomm/enums.proto
@@ -416,3 +416,40 @@
     ERROR_STUCK_CONNECTING_EMERGENCY = 23;
     ERROR_STUCK_CONNECTING = 24;
 }
+
+/**
+ * Indicating the simultaneous call type
+ */
+enum SimultaneousTypeEnum {
+    TYPE_UNKNOWN = 0;
+    TYPE_SINGLE = 1;
+    TYPE_DUAL_SAME_ACCOUNT = 2;
+    TYPE_DUAL_DIFF_ACCOUNT = 3;
+}
+
+/**
+ * Indicating telecom key event name
+ */
+enum EventEnum {
+    EVENT_UNKNOWN = 0;
+    EVENT_INIT = 1;
+    EVENT_DEFAULT_DIALER_CHANGED = 2;
+    EVENT_ADD_CALL = 3;
+}
+
+/**
+ * Indicating the cause of telecom key event
+ */
+enum EventCauseEnum {
+    CAUSE_UNKNOWN = 0;
+    CAUSE_GENERIC_SUCCESS = 1;
+    CAUSE_GENERIC_FAILURE = 2;
+    // [1,000 - 1,100) Call transaction result
+    CALL_TRANSACTION_SUCCESS = 1000;
+    CALL_TRANSACTION_ERROR_UNKNOWN = 1001;
+    CALL_TRANSACTION_CANNOT_HOLD_CURRENT_ACTIVE_CALL = 1002;
+    CALL_TRANSACTION_CALL_IS_NOT_BEING_TRACKED = 1003;
+    CALL_TRANSACTION_CALL_CANNOT_BE_SET_TO_ACTIVE = 1004;
+    CALL_TRANSACTION_CALL_NOT_PERMITTED_AT_PRESENT_TIME = 1005;
+    CALL_TRANSACTION_CODE_OPERATION_TIMED_OUT = 1006;
+}