Custom ResultReporter for STS

Currently, the retry of a pi sts build will have a suite_plan name of "sts-retry" instead of the original `suite_plan` of the test result being retried.

This is a regression from N, O behavior.

This has the potential to:
* Break APFE validation when we start approving based on variant/representative and suite-plan combination
* Break metrics

Bug: 126423649
Test: mm sts-harness-tradefed-tests && ./run_tests.sh
Test: Ran retry using tradefed and manually validated test_result.xml
Change-Id: Ieb2053e47b19097984ec16ec178add5a04f98e6f
diff --git a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/result/ResultReporter.java b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/result/ResultReporter.java
index 9d670df..220c9ac 100644
--- a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/result/ResultReporter.java
+++ b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/result/ResultReporter.java
@@ -772,7 +772,7 @@
     protected File generateResultXmlFile()
             throws IOException, XmlPullParserException {
         return ResultHandler.writeResults(mBuildHelper.getSuiteName(),
-                mBuildHelper.getSuiteVersion(), mBuildHelper.getSuitePlan(),
+                mBuildHelper.getSuiteVersion(), getSuitePlan(mBuildHelper),
                 mBuildHelper.getSuiteBuild(), mResult, mResultDir, mResult.getStartTime(),
                 mElapsedTime + mResult.getStartTime(), mReferenceUrl, getLogUrl(),
                 mBuildHelper.getCommandLineArgs());
@@ -844,6 +844,17 @@
     }
 
     /**
+     * Get the suite plan. This protected method was created for overrides.
+     * Extending classes can decide on the content of the output's suite_plan field.
+     *
+     * @param mBuildHelper Helper that contains build information.
+     * @return string Suite plan to use.
+     */
+    protected String getSuitePlan(CompatibilityBuildHelper mBuildHelper) {
+        return mBuildHelper.getSuitePlan();
+    }
+
+    /**
      * Return true if this instance is a shard ResultReporter and should propagate
      * certain events to the master.
      */