Merge "Use readonly version of 'report_postgc_memory_metrics'" into main
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index b0a8b1b..5225174 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -7681,7 +7681,7 @@
         });
 
         // Register callback to report native memory metrics post GC cleanup
-        if (Flags.reportPostgcMemoryMetrics() &&
+        if (Flags.reportPostgcMemoryMetricsReadonly() &&
             com.android.libcore.readonly.Flags.postCleanupApis()) {
             VMRuntime.addPostCleanupCallback(new Runnable() {
                 @Override public void run() {
diff --git a/core/java/android/app/metrics.aconfig b/core/java/android/app/metrics.aconfig
index 488f1c7..55d9c2d 100644
--- a/core/java/android/app/metrics.aconfig
+++ b/core/java/android/app/metrics.aconfig
@@ -8,3 +8,12 @@
      description: "Controls whether to report memory metrics post GC cleanup"
      bug: "331243037"
 }
+
+flag {
+     namespace: "system_performance"
+     name: "report_postgc_memory_metrics_readonly"
+     is_exported: false
+     description: "Controls whether to report memory metrics post GC cleanup (readonly)"
+     bug: "331243037"
+     is_fixed_read_only: true
+}