[metrics] Always enable background thread

Having the thread enabled in some cases and not in others was causing
issues this tests. To avoid needing to handle multiple configurations,
this CL enables the background reporting thread always. In general,
metrics reporting will be enabled, so this better reflects the default
state of things.

Test: ./test.py --run-test --host
Bug: 170149255
Change-Id: I5100e0da1a7d264ebdd1bfe60f08171ffa5b73b1
diff --git a/runtime/metrics/reporter.cc b/runtime/metrics/reporter.cc
index 92ae7ab..5148b20 100644
--- a/runtime/metrics/reporter.cc
+++ b/runtime/metrics/reporter.cc
@@ -49,9 +49,6 @@
 }
 
 bool MetricsReporter::MaybeStartBackgroundThread(SessionData session_data) {
-  if (!config_.ReportingEnabled()) {
-    return false;
-  }
   CHECK(!thread_.has_value());
   thread_.emplace(&MetricsReporter::BackgroundThreadRun, this);
   messages_.SendMessage(BeginSessionMessage{session_data});
diff --git a/runtime/metrics/reporter.h b/runtime/metrics/reporter.h
index f2f7af5..eff6e47 100644
--- a/runtime/metrics/reporter.h
+++ b/runtime/metrics/reporter.h
@@ -46,11 +46,6 @@
 
   // If set, metrics will be reported every time this many seconds elapses.
   std::optional<unsigned int> periodic_report_seconds;
-
-  // Returns whether any options are set that enables metrics reporting.
-  constexpr bool ReportingEnabled() const {
-    return dump_to_logcat || dump_to_file.has_value() || dump_to_statsd;
-  }
 };
 
 // MetricsReporter handles periodically reporting ART metrics.
diff --git a/test/911-get-stack-trace/src/art/PrintThread.java b/test/911-get-stack-trace/src/art/PrintThread.java
index 94f3a33..f843cc3 100644
--- a/test/911-get-stack-trace/src/art/PrintThread.java
+++ b/test/911-get-stack-trace/src/art/PrintThread.java
@@ -42,7 +42,8 @@
   // may not exist depending on the environment.
   public final static String IGNORE_THREAD_NAME_REGEX =
       "Binder:|RenderThread|hwuiTask|Jit thread pool worker|Instr:|JDWP|Profile Saver|main|" +
-      "queued-work-looper|InstrumentationConnectionThread|intel_svc_streamer_thread|ForkJoinPool";
+      "queued-work-looper|InstrumentationConnectionThread|intel_svc_streamer_thread|" +
+      "ForkJoinPool|Metrics Background Reporting Thread";
   public final static Matcher IGNORE_THREADS =
       Pattern.compile(IGNORE_THREAD_NAME_REGEX).matcher("");
 
diff --git a/test/925-threadgroups/expected-stdout.txt b/test/925-threadgroups/expected-stdout.txt
index 9dfa37d..3cc36f2 100644
--- a/test/925-threadgroups/expected-stdout.txt
+++ b/test/925-threadgroups/expected-stdout.txt
@@ -12,7 +12,7 @@
   [Thread[main,5,main]]
   []
 system:
-  [Thread[FinalizerDaemon,5,system], Thread[FinalizerWatchdogDaemon,5,system], Thread[HeapTaskDaemon,5,system], Thread[ReferenceQueueDaemon,5,system], Thread[Signal Catcher,5,system]]
+  [Thread[FinalizerDaemon,5,system], Thread[FinalizerWatchdogDaemon,5,system], Thread[HeapTaskDaemon,5,system], Thread[Metrics Background Reporting Thread,5,system], Thread[ReferenceQueueDaemon,5,system], Thread[Signal Catcher,5,system]]
   [java.lang.ThreadGroup[name=main,maxpri=10]]
 art.Test925$CustomThreadGroup[name=TEST GROUP,maxpri=10]
   java.lang.ThreadGroup[name=main,maxpri=10]
diff --git a/test/925-threadgroups/src/art/Test925.java b/test/925-threadgroups/src/art/Test925.java
index a63f4ce..78068ae 100644
--- a/test/925-threadgroups/src/art/Test925.java
+++ b/test/925-threadgroups/src/art/Test925.java
@@ -47,7 +47,7 @@
     printThreadGroupInfo(curGroup);
     printThreadGroupInfo(rootGroup);
 
-    waitGroupChildren(rootGroup, 5 /* # daemons */, 30 /* timeout in seconds */);
+    waitGroupChildren(rootGroup, 6 /* # daemons */, 30 /* timeout in seconds */);
 
     checkChildren(curGroup);