Snap for 8892598 from 600c45d80ee0c28a17072cfcf8959efa0389b2ea to mainline-os-statsd-release

Change-Id: I00c745b07ca0633fe6f9c3d3880a5b4df4353631
diff --git a/stats/atoms.proto b/stats/atoms.proto
index e777266..2f04525 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -68,6 +68,7 @@
 import "frameworks/proto_logging/stats/enums/stats/location/location_enums.proto";
 import "frameworks/proto_logging/stats/enums/stats/mediametrics/mediametrics.proto";
 import "frameworks/proto_logging/stats/enums/stats/mediaprovider/mediaprovider_enums.proto";
+import "frameworks/proto_logging/stats/enums/stats/mobiledatadownload/enums.proto";
 import "frameworks/proto_logging/stats/enums/stats/privacysignals/enums.proto";
 import "frameworks/proto_logging/stats/enums/stats/safetycenter/enums.proto";
 import "frameworks/proto_logging/stats/enums/stats/storage/storage_enums.proto";
@@ -715,14 +716,15 @@
                 477 [(module) = "framework"];
         BluetoothDeviceNameReported bluetooth_device_name_reported = 478 [(module) = "bluetooth"];
         CellBroadcastConfigUpdated cb_config_updated = 479 [(module) = "cellbroadcast"];
-        CellBroadcastModuleError cb_module_error = 480 [(module) = "cellbroadcast"];
-        CellBroadcastServiceFeature cb_service_feature= 481 [(module) = "cellbroadcast"];
-        CellBroadcastReceiverFeature cb_receiver_feature= 482 [(module) = "cellbroadcast"];
+        CellBroadcastModuleErrorReported cb_module_error_reported = 480 [(module) = "cellbroadcast"];
+        CellBroadcastServiceFeatureChanged cb_service_feature_changed = 481 [(module) = "cellbroadcast"];
+        CellBroadcastReceiverFeatureChanged cb_receiver_feature_changed = 482 [(module) = "cellbroadcast"];
         JSScriptEngineLatencyReported jsscriptengine_latency_reported = 483 [(module) = "adservices"];
         PrivacySignalNotificationInteraction privacy_signal_notification_interaction = 484 [(module) = "permissioncontroller"];
         PrivacySignalIssueCardInteraction privacy_signal_issue_card_interaction = 485 [(module) = "permissioncontroller"];
         PrivacySignalsJobFailure privacy_signals_job_failure = 486 [(module) = "permissioncontroller"];
-        SandboxApiCalled sandbox_api_called = 488 [(module) = "adservices"];
+        SandboxApiCalled sandbox_api_called = 488 [(module) = "sdksandbox"];
+        MobileDataDownloadFileGroupDownloadStatusReported mobile_data_download_file_group_status_reported = 490 [(module) = "adservices"];
         // StatsdStats tracks platform atoms with ids upto 750.
         // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
     }
@@ -917,7 +919,7 @@
         DeviceTelephonyProperties device_telephony_properties = 10154 [(module) = "telephony"];
         RemoteKeyProvisioningErrorCounts remote_key_provisioning_error_counts = 10155 [(module) = "remoteprovisioner"];
         SafetyState safety_state = 10156 [(module) = "permissioncontroller"];
-        SandboxSdkStorage sandbox_sdk_storage = 10159 [(module) = "adservices"];
+        SandboxSdkStorage sandbox_sdk_storage = 10159 [(module) = "sdksandbox"];
     }
 
     // DO NOT USE field numbers above 100,000 in AOSP.
@@ -1200,6 +1202,12 @@
     optional bool is_cell_data_available = 3;
     // the Band bucket the connected network is on
     optional Band band = 4;
+    // the Signal strength in the range of [-126, 0)
+    optional int32 rssi = 5;
+    // estimated tx throughput in kbps
+    optional int32 tx_kbps = 6 [default = -1];
+    // estimated rx throughput in kbps
+    optional int32 rx_kbps = 7 [default = -1];
 }
 
 /**
@@ -12324,7 +12332,7 @@
     // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java
     optional int32 status_code = 5;
 
-    // Overall time used for query including estimated binder latency
+    // Overall time used for query which doesn't include estimated binder latency
     optional int32 total_latency_millis = 6;
 
     // Time used to rewrite the search spec.
@@ -13778,7 +13786,7 @@
  * Logged from Cell Broadcast module:
  *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice
  */
-message CellBroadcastServiceFeature {
+message CellBroadcastServiceFeatureChanged {
     // Not for mainline devices, but for android-go devices, OEM can register package names.
     // if there is a data then true otherwise false
     optional bool overlay_additional_cbr_packages = 1;
@@ -13796,7 +13804,7 @@
  * Logged from Cell Broadcast module:
  *   packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
  */
-message CellBroadcastReceiverFeature {
+message CellBroadcastReceiverFeatureChanged {
     // Whether to enable alert handling during active voice call
     optional bool alert_during_call = 1;
     // Play alert sound in full volume regardless DND is on
@@ -13821,7 +13829,7 @@
  *   packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
  *   packages/apps/CellBroadcastReceiver/
  */
-message CellBroadcastModuleError {
+message CellBroadcastModuleErrorReported {
     enum ErrorType {
         ERROR_UNKNOWN = 0;
         ERROR_BAD_CONFIG = 1;
@@ -20498,6 +20506,12 @@
     // Measurement - client side
     //   * register()
     //   * deleteRegistrations()
+    //
+    // AdId
+    //   * GetAdId()
+    //
+    // AppsetId
+    //   * GetAppsetId()
 
 
     enum AdServicesApiClassType {
@@ -20505,6 +20519,8 @@
         TARGETING = 1;
         FLEDGE = 2;
         MEASUREMENT = 3;
+        ADID = 4;
+        APPSETID = 5;
     }
 
     enum AdServicesApiName {
@@ -20522,6 +20538,8 @@
         OVERRIDE_AD_SELECTION_CONFIG_REMOTE_INFO = 11;
         REMOVE_AD_SELECTION_CONFIG_REMOTE_INFO_OVERRIDE = 12;
         RESET_ALL_AD_SELECTION_CONFIG_REMOTE_OVERRIDES = 13;
+        GET_ADID = 14;
+        GET_APPSETID = 15;
     }
 
     optional AdServicesApiClassType api_class = 1;
@@ -21417,22 +21435,39 @@
 }
 
 // Logs when an API call from app to sandbox process is made
+// Next ID: 5
 message SandboxApiCalled {
     enum Method {
         METHOD_UNSPECIFIED = 0;
         LOAD_SDK = 1;
         LOAD_SANDBOX_AND_SDK = 2;
         REQUEST_SURFACE_PACKAGE = 3;
+        SEND_DATA = 4;
+        GET_LOADED_SDK_LIBRARIES_INFO = 5;
     }
-
     // The method which was called.
     optional Method method = 1;
 
-    //Time taken from the initiation of the API till the callback was received
-    optional int32 latency_millis = 2;
+    enum Stage {
+        STAGE_UNSPECIFIED = 0;
+        APP_TO_SYSTEM_SERVER = 1;
+        SYSTEM_SERVER_APP_TO_SANDBOX = 2;
+        LOAD_SANDBOX = 3;
+        SYSTEM_SERVER_TO_SANDBOX = 4;
+        SANDBOX = 5;
+        SDK = 6;
+        SANDBOX_TO_SYSTEM_SERVER = 7;
+        SYSTEM_SERVER_SANDBOX_TO_APP = 8;
+        SYSTEM_SERVER_TO_APP = 9;
+    }
+    // The stage at which latency is being measured.
+    optional Stage stage = 4;
 
     // The success status of the callback
     optional bool success = 3;
+
+    //Time taken from the initiation of the API till the callback was received
+    optional int32 latency_millis = 2;
 }
 
 //Logs periodically the storage of SDKs used by the app
@@ -21444,3 +21479,41 @@
     // Storage
     optional int32 storage_kb = 2;
 }
+
+/**
+ * Logs stats on the download status of file groups. Provides information on
+ * download latency and download penetration.
+ */
+message MobileDataDownloadFileGroupDownloadStatusReported {
+  // The status of the file group on device: PENDING, DOWNLOADED, FAILED
+  optional android.stats.mobiledatadownload.DownloadStatus
+      file_group_download_status = 1;
+  // Timestamp of when this file group was added to the device.
+  optional int64 group_added_timestamp = 2;
+  // Timestamp of when MDD completed downloading the file group.
+  optional int64 group_downloaded_timestamp = 3;
+  // Stats specific to the file group
+  optional MobileDataDownloadFileGroupStats file_group_stats = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
+  // Number of days since the last time the device attempted to log file group download status for any file group.
+  optional int32 days_since_last_log = 5;
+}
+
+/** Shared data among MobileDataDownload statistics. Not meant to be a top level atom proto.*/
+message MobileDataDownloadFileGroupStats {
+  // The name of the file group. This a string set server side used to retrieve
+  // the files. Does not contain PII.
+  optional string file_group_name = 1;
+  // Allows the clients to identify a file group based on a given set of
+  // properties. This string is set server side and does not contain PII.
+  optional string variant_id = 2;
+  // Identifier for the data file group created to identify the version of the
+  // file group.
+  optional int64 build_id = 3;
+  // The number of files in the file group.
+  optional int32 file_count = 4;
+  // Whether the file group has an account associated with it.
+  optional bool has_account = 5;
+  // Inverse of the sampling rate used to sample this event.
+  optional int32 sampling_interval = 6;
+  // Note: we do not have owner_package since that's already transmitted.
+}
diff --git a/stats/enums/stats/connectivity/network_stack.proto b/stats/enums/stats/connectivity/network_stack.proto
index 0ad0efb..4b63bc3 100644
--- a/stats/enums/stats/connectivity/network_stack.proto
+++ b/stats/enums/stats/connectivity/network_stack.proto
@@ -38,6 +38,7 @@
     DC_INVALID_PROVISIONING = 7;
     DC_INTERFACE_NOT_FOUND = 8;
     DC_PROVISIONING_TIMEOUT = 9;
+    DC_DHCP_ROAM_FAIL = 10;
 }
 
 enum TransportType {
diff --git a/stats/enums/stats/mobiledatadownload/enums.proto b/stats/enums/stats/mobiledatadownload/enums.proto
new file mode 100644
index 0000000..4bc198e
--- /dev/null
+++ b/stats/enums/stats/mobiledatadownload/enums.proto
@@ -0,0 +1,12 @@
+syntax = "proto2";
+
+package android.stats.mobiledatadownload;
+
+option java_multiple_files = true;
+
+enum DownloadStatus {
+  UNKNOWN = 0;
+  PENDING = 1;
+  FAILED = 2;
+  DOWNLOADED = 3;
+}
\ No newline at end of file