Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dafada72 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Do not report native memory metrics for instrumentation" into main

parents 180b9670 9ee9bd26
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -7831,9 +7831,10 @@ public final class ActivityThread extends ClientTransactionHandler


        // Register callback to report native memory metrics post GC cleanup
        // Register callback to report native memory metrics post GC cleanup
        // Note: we do not report memory metrics of isolated processes unless
        // Note: we do not report memory metrics of isolated processes unless
        // their native allocations become more significant
        // their native allocations become more significant. Instrumentation is
        if (!Process.isIsolated() && Flags.reportPostgcMemoryMetrics() &&
        // also excluded because the metrics from test cases are not meaningful.
            com.android.libcore.readonly.Flags.postCleanupApis()) {
        if (!Process.isIsolated() && ii == null && Flags.reportPostgcMemoryMetrics()
                && com.android.libcore.readonly.Flags.postCleanupApis()) {
            VMRuntime.addPostCleanupCallback(new Runnable() {
            VMRuntime.addPostCleanupCallback(new Runnable() {
                @Override public void run() {
                @Override public void run() {
                    MetricsLoggerWrapper.logPostGcMemorySnapshot();
                    MetricsLoggerWrapper.logPostGcMemorySnapshot();