Snap for 8748207 from 68a8587b394438001d810632abea27cec8880f38 to mainline-uwb-release

Change-Id: I981fc2d3d5188993ce9a044fbf5ccff39127b109
diff --git a/stats/atoms.proto b/stats/atoms.proto
index 989a390..67f5e43 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -705,6 +705,12 @@
         SafetySourceStateCollected safety_source_state_collected = 471 [(module) = "permissioncontroller"];
         SafetyCenterSystemEventReported safety_center_system_event_reported = 472 [(module) = "permissioncontroller"];
         SafetyCenterInteractionReported safety_center_interaction_reported = 473 [(module) = "permissioncontroller"];
+        BroadcastDeliveryEventReported broadcast_delivery_event_reported =
+                475 [(module) = "framework"];
+        ServiceRequestEventReported service_request_event_reported = 476 [(module) = "framework"];
+        ProviderAcquisitionEventReported provider_acquisition_event_reported =
+                477 [(module) = "framework"];
+        BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
         // StatsdStats tracks platform atoms with ids upto 750.
         // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
     }
@@ -3164,6 +3170,16 @@
     // session for the same remote device.
     // Default: 0 if the device's metric id is unknown.
     optional int32 metric_id = 8;
+    // A flag indicating if the MAC address of the remote device is public or
+    // random.
+    optional android.bluetooth.AddressTypeEnum address_type = 9;
+    // The first byte of MAC address
+    optional int32 byte1 = 10;
+    // The second byte of MAC address
+    optional int32 byte2 = 11;
+    // The third byte of MAC address
+    optional int32 byte3 = 12;
+
 }
 
 /**
@@ -3229,6 +3245,29 @@
 }
 
 /**
+* Logs the user created Bluetooth device's name.
+* It is pushed at Bluetooth pairing and connection.
+* The metric will only be collected from dogfooders.
+*
+* Logged from:
+*     packages/modules/Bluetooth
+*/
+message BluetoothDeviceNameReported {
+   // An identifier that can be used to match events for this device.
+   // The incremental identifier is locally generated and guaranteed not derived
+   // from any globally unique hardware id.
+   // For paired devices, it stays consistent between Bluetooth toggling for the
+   // same remote device.
+   // For unpaired devices, it stays consistent within the same Bluetooth adapter
+   // session for the same remote device.
+   // Default: 0 if the device's metric id is unknown.
+   optional int32 metric_id = 1;
+
+   // Name of the Bluetooth device. It is created by the user.
+   optional string device_name = 2;
+}
+
+/**
  * Logs when bond state of a Bluetooth device changes
  *
  * Logged from:
@@ -5029,6 +5068,23 @@
     optional int32 short_name_hash = 14;
     // Whether this FGS package had permission to notify the user.
     optional bool fgs_has_notification_permission = 15;
+
+    // Keep in sync with frameworks/base/core/java/android/content/pm/ServiceInfo.java
+    enum ForegroundServiceType {
+        FOREGROUND_SERVICE_TYPE_NONE = 0;
+        FOREGROUND_SERVICE_TYPE_DATA_SYNC = 0x0001; // 1 << 0
+        FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 0x0002; // 1 << 1
+        FOREGROUND_SERVICE_TYPE_PHONE_CALL = 0x0004; //1 << 2
+        FOREGROUND_SERVICE_TYPE_LOCATION = 0x0008; // 1 << 3
+        FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 0x0010; // 1 << 4
+        FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 0x0020; // 1 << 5
+        FOREGROUND_SERVICE_TYPE_CAMERA = 0x0040; // 1 << 6
+        FOREGROUND_SERVICE_TYPE_MICROPHONE = 0x0080; // 1 << 7
+    }
+
+    // The foreground service types, must be one or a combination of the types
+    // in the ForegroundServiceType above.
+    optional int32 fgs_types = 16;
 }
 
 /**
@@ -5953,6 +6009,102 @@
 }
 
 /**
+ * The type of process start. It's the same as ProcessStartTime.StartType but we
+ * can't re-type that for background compatibility.
+ */
+enum ProcessStartType {
+    PROCESS_START_TYPE_UNKNOWN = 0;
+    PROCESS_START_TYPE_WARM = 1;
+    PROCESS_START_TYPE_HOT = 2;
+    PROCESS_START_TYPE_COLD = 3;
+}
+
+/**
+ * Logs when a service request is made.
+ * Logged from:
+ *   services/core/java/com/android/server/am/ActiveServices.java
+ */
+message ServiceRequestEventReported {
+    /** The package uid of the service host. */
+    optional int32 uid = 1 [(is_uid) = true];
+
+    /** The package uid of the service launch request. */
+    optional int32 requester_uid = 2 [(is_uid) = true];
+
+    /** The action name of the service request. */
+    optional string action_name = 3;
+
+    /**
+     * The types of the requests to the service.
+     */
+    enum RequestType {
+        UNKNOWN = 0;
+        START = 1;
+        BIND = 2;
+    }
+
+    /** The type of the current request to the service.*/
+    optional RequestType request_type = 4;
+
+    /** Whether or not it's requested to start as a foreground service. */
+    optional bool fg_required = 5;
+
+    /** The start type of the host process. */
+    optional ProcessStartType proc_start_type = 6;
+}
+
+/**
+ * Logs indicating a broadcast is being delivered to a receiver.
+ *
+ * Logged from:
+ *     frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
+ */
+message BroadcastDeliveryEventReported {
+    /** The package uid of the broadcast receiver. */
+    optional int32 uid = 1 [(is_uid) = true];
+
+    /** The package uid of the broadcast sender. */
+    optional int32 sender_uid = 2 [(is_uid) = true];
+
+    /** The action name of the broadcast. */
+    optional string action_name = 3;
+
+    /**
+     * The types of the broadcast receivers.
+     */
+    enum ReceiverType {
+        UNKNOWN = 0;
+        RUNTIME = 1;
+        MANIFEST = 2;
+    }
+
+    /** The type of the current broadcast receiver. */
+    optional ReceiverType receiver_type = 4;
+
+    /** The start type of the host process. */
+    optional ProcessStartType proc_start_type = 5;
+}
+
+/**
+ * Logs indicating a client is requesting to acquire a provider,
+ * this doesn't include the case where the provider has been installed in the
+ * client's process space and it's just increasing a ref count.
+ *
+ * Logged from:
+ *      frameworks/base/services/core/java/com/android/server/am/ContentProviderHelper.java
+ */
+message ProviderAcquisitionEventReported {
+    /** The package uid of the content provider host. */
+    optional int32 uid = 1 [(is_uid) = true];
+
+    /** The package uid of the content provider client who makes the request. */
+    optional int32 client_uid = 2 [(is_uid) = true];
+
+    /** The start type of the host process. */
+    optional ProcessStartType proc_start_type = 3;
+}
+
+/**
  * Logs when a hidden API is used.
  *
  * Logged from:
diff --git a/stats/enums/bluetooth/enums.proto b/stats/enums/bluetooth/enums.proto
index 183a029..66b4371 100644
--- a/stats/enums/bluetooth/enums.proto
+++ b/stats/enums/bluetooth/enums.proto
@@ -196,3 +196,10 @@
         A2DP_CONNECTION_TIMEOUT = 102009;
 
 }
+
+enum AddressTypeEnum {
+    ADDRESS_TYPE_PUBLIC = 0;
+    ADDRESS_TYPE_RANDOM = 1;
+    ADDRESS_TYPE_UNKNOWN = 0xFFFF;
+}
+