Merge Android 24Q1 Release (ab/11220357)

Bug: 319669529
Merged-In: I12e0fbad4cb34fa11eaf6e022ea61b59c4a0d7d3
Change-Id: If5c6f78ee9a08a1caae56c56426d329b0ec3b5ce
diff --git a/Android.bp b/Android.bp
index 6e02dcd..c869c27 100644
--- a/Android.bp
+++ b/Android.bp
@@ -520,7 +520,16 @@
 genrule {
     name: "chre_atoms_log.h",
     tools: ["stats-log-api-gen"],
-    cmd: "$(location stats-log-api-gen) --header $(genDir)/chre_atoms_log.h --module chre --namespace android,chre,Atoms --vendor-proto hardware/google/pixel/pixelstats/pixelatoms.proto",
+    srcs: [
+        "core/chre_metrics_with_atom.proto",
+        "core/chre_metrics.proto",
+        ":libstats_atom_options_protos",
+        ":libprotobuf-internal-descriptor-proto",
+    ],
+    cmd: "$(location stats-log-api-gen) --header $(out) " +
+        "--module chre " +
+        "--namespace android,chre,Atoms " +
+        "--vendor-proto $(location core/chre_metrics_with_atom.proto)",
     out: [
         "chre_atoms_log.h",
     ],
diff --git a/OWNERS b/OWNERS
index 77c4fde..af0b1d8 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,4 +1,7 @@
+# Bug component: 156070
 arthuri@google.com
+annaherrera@google.com
 bduddie@google.com
-berchet@google.com
-stange@google.com
+ccteng@google.com
+leiju@google.com
+matthewsedam@google.com
diff --git a/apps/OWNERS b/apps/OWNERS
deleted file mode 100644
index 1c82323..0000000
--- a/apps/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-annaherrera@google.com
\ No newline at end of file
diff --git a/apps/test/OWNERS b/apps/test/OWNERS
deleted file mode 100644
index a55f0ca..0000000
--- a/apps/test/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-matthewsedam@google.com
diff --git a/chre_api/OWNERS b/chre_api/OWNERS
new file mode 100644
index 0000000..f766941
--- /dev/null
+++ b/chre_api/OWNERS
@@ -0,0 +1,3 @@
+set noparent
+arthuri@google.com
+bduddie@google.com
diff --git a/core/OWNERS b/core/OWNERS
deleted file mode 100644
index 1c82323..0000000
--- a/core/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-annaherrera@google.com
\ No newline at end of file
diff --git a/core/chre_metrics_with_atom.proto b/core/chre_metrics_with_atom.proto
new file mode 100644
index 0000000..afd436d
--- /dev/null
+++ b/core/chre_metrics_with_atom.proto
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+
+// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! DISCLAIMER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+// The messages definition here must be in sync with atoms definitions in
+// hardware/google/pixel/pixelstats/pixelatoms.proto
+
+// C++ namespace: android.chre.metrics
+package android.chre.metrics;
+
+option optimize_for = LITE_RUNTIME;
+
+option java_package = "android.chre";
+option java_outer_classname = "Metrics";
+
+import "system/chre/core/chre_metrics.proto";
+import "frameworks/proto_logging/stats/atom_field_options.proto";
+
+message Atom {
+  oneof pushed {
+    // AOSP atom ID range starts at 105000
+    ChreHalNanoappLoadFailed chre_hal_nanoapp_load_failed = 105031
+        [(android.os.statsd.module) = "chre"];
+    ChrePalOpenFailed chre_pal_open_failed = 105032
+        [(android.os.statsd.module) = "chre"];
+    ChreApiErrorCodeDistributionTaken chre_api_error_code_distribution_taken =
+        105033 [(android.os.statsd.module) = "chre"];
+    ChreDynamicMemorySnapshotReported chre_dynamic_memory_snapshot_reported =
+        105034 [(android.os.statsd.module) = "chre"];
+    ChreEventQueueSnapshotReported chre_event_queue_snapshot_reported = 105035
+        [(android.os.statsd.module) = "chre"];
+    ChreApWakeUpOccurred chre_ap_wake_up_occurred = 105036
+        [(android.os.statsd.module) = "chre"];
+  }
+}
diff --git a/host/common/chre_aidl_hal_client.cc b/host/common/chre_aidl_hal_client.cc
index a6f377c..d4a60ea 100644
--- a/host/common/chre_aidl_hal_client.cc
+++ b/host/common/chre_aidl_hal_client.cc
@@ -166,7 +166,8 @@
       const std::vector<std::string> & /*msgContentPerms*/) override {
     std::cout << "Received a message!" << std::endl
               << "   From: 0x" << std::hex << message.nanoappId << std::endl
-              << "     To: 0x" << message.hostEndPoint << std::endl
+              << "     To: 0x" << static_cast<int>(message.hostEndPoint)
+              << std::endl
               << "   Body: (type " << message.messageType << " size "
               << message.messageBody.size() << ") 0x";
     for (const uint8_t &data : message.messageBody) {
diff --git a/java/test/OWNERS b/java/test/OWNERS
deleted file mode 100644
index a55f0ca..0000000
--- a/java/test/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-matthewsedam@google.com
diff --git a/pal/include/OWNERS b/pal/include/OWNERS
new file mode 100644
index 0000000..f766941
--- /dev/null
+++ b/pal/include/OWNERS
@@ -0,0 +1,3 @@
+set noparent
+arthuri@google.com
+bduddie@google.com
diff --git a/platform/OWNERS b/platform/OWNERS
deleted file mode 100644
index 1c82323..0000000
--- a/platform/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-annaherrera@google.com
\ No newline at end of file
diff --git a/platform/shared/mbedtls/mbedtls.mk b/platform/shared/mbedtls/mbedtls.mk
index 38e3dd2..d833de4 100644
--- a/platform/shared/mbedtls/mbedtls.mk
+++ b/platform/shared/mbedtls/mbedtls.mk
@@ -22,7 +22,6 @@
 
 MBEDTLS_SRCS += $(MBEDTLS_DIR)/library/asn1write.c
 MBEDTLS_SRCS += $(MBEDTLS_DIR)/library/oid.c
-MBEDTLS_SRCS += $(MBEDTLS_DIR)/library/hash_info.c
 MBEDTLS_SRCS += $(MBEDTLS_DIR)/library/ecp_curves.c
 MBEDTLS_SRCS += $(MBEDTLS_DIR)/library/ecp.c
 MBEDTLS_SRCS += $(MBEDTLS_DIR)/library/ecdsa.c
diff --git a/test/OWNERS b/test/OWNERS
deleted file mode 100644
index 1c82323..0000000
--- a/test/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-annaherrera@google.com
\ No newline at end of file
diff --git a/util/OWNERS b/util/OWNERS
deleted file mode 100644
index 1c82323..0000000
--- a/util/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-annaherrera@google.com
\ No newline at end of file