Add In-call services to Analytics

Add a repeated field to the analytics proto containing the name of the
in-call service and the type, and adds code to populate the field from
InCallController.

Fix: 29228080
Change-Id: Ic57cd220e7f5ce1409516e520380f635c54d3013
diff --git a/proto/telecom.proto b/proto/telecom.proto
index f0b3d02..9786934 100644
--- a/proto/telecom.proto
+++ b/proto/telecom.proto
@@ -149,6 +149,23 @@
   optional int64 time_millis = 2;
 }
 
+message InCallServiceInfo {
+  // Keep this up-to-date with com.android.server.telecom.InCallController.
+  enum InCallServiceType {
+    IN_CALL_SERVICE_TYPE_INVALID = 0;
+    IN_CALL_SERVICE_TYPE_DIALER_UI = 1;
+    IN_CALL_SERVICE_TYPE_SYSTEM_UI = 2;
+    IN_CALL_SERVICE_TYPE_CAR_MODE_UI = 3;
+    IN_CALL_SERVICE_TYPE_NON_UI = 4;
+  }
+
+  // The shortened component name of the in-call service.
+  optional string in_call_service_name = 1;
+
+  // The type of the in-call service
+  optional InCallServiceType in_call_service_type = 2;
+}
+
 // Information about each call.
 message CallLog {
 
@@ -227,7 +244,7 @@
   // A bitmask with bits corresponding to call technologies that were used
   // during the call. The ones that we will record are CDMA, GSM, IMS, SIP,
   // and third-party.
-  // https://googleplex-android-review.git.corp.google.com/#/c/816516/6/src/com/android/server/telecom/Analytics.java
+  // See the com.android.server.telecom.Analytics.*_PHONE constants.
   optional int32 call_technologies = 6;
 
   // Indicates the call termination code.
@@ -253,4 +270,7 @@
 
   // A list of the video events during the call.
   repeated VideoEvent video_events = 15;
+
+  // A list of the in-call services bound during the call.
+  repeated InCallServiceInfo in_call_services = 16;
 }