Make onFinished(String) a SystemApi

Since this callback is only used by retrieveBugreport
which is a SystemApi, the callback itself should also be
a SystemApi.

Test: atest CtsRootBugreportTestCases
Bug: 267620533
Change-Id: I6c11a86acbf6485a86e5a7baf76031f8c2bce264
diff --git a/core/api/current.txt b/core/api/current.txt
index 338d10c..724747f 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -32149,7 +32149,6 @@
     method public void onEarlyReportFinished();
     method public void onError(int);
     method public void onFinished();
-    method public void onFinished(@NonNull String);
     method public void onProgress(@FloatRange(from=0.0f, to=100.0f) float);
     field public static final int BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS = 5; // 0x5
     field public static final int BUGREPORT_ERROR_INVALID_INPUT = 1; // 0x1
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 0476d79..d95bd46 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -9943,6 +9943,10 @@
     method @RequiresPermission(android.Manifest.permission.DUMP) @WorkerThread public void startBugreport(@NonNull android.os.ParcelFileDescriptor, @Nullable android.os.ParcelFileDescriptor, @NonNull android.os.BugreportParams, @NonNull java.util.concurrent.Executor, @NonNull android.os.BugreportManager.BugreportCallback);
   }
 
+  public abstract static class BugreportManager.BugreportCallback {
+    method public void onFinished(@NonNull String);
+  }
+
   public final class BugreportParams {
     ctor public BugreportParams(int);
     ctor public BugreportParams(int, int);
diff --git a/core/java/android/os/BugreportManager.java b/core/java/android/os/BugreportManager.java
index 2d2b0fc..086b0e5 100644
--- a/core/java/android/os/BugreportManager.java
+++ b/core/java/android/os/BugreportManager.java
@@ -70,10 +70,7 @@
      * An interface describing the callback for bugreport progress and status.
      *
      * <p>Callers will receive {@link #onProgress} calls as the bugreport progresses, followed by a
-     * terminal call to either {@link #onFinished} or {@link #onError}. Note that
-     * {@link #onFinished(String)} will only be invoked when calling {@code startBugreport} with the
-     * {@link BugreportParams#BUGREPORT_FLAG_DEFER_CONSENT} flag set. Otherwise,
-     * {@link #onFinished()} will be invoked.
+     * terminal call to either {@link #onFinished} or {@link #onError}.
      *
      * <p>If an issue is encountered while starting the bugreport asynchronously, callers will
      * receive an {@link #onError} call without any {@link #onProgress} callbacks.
@@ -149,8 +146,7 @@
         /** Called when taking bugreport finishes successfully.
          *
          * <p>This callback will be invoked if the
-         * {@link BugreportParams#BUGREPORT_FLAG_DEFER_CONSENT} flag is not set. Otherwise, the
-         * {@link #onFinished(String)} callback will be invoked.
+         * {@link BugreportParams#BUGREPORT_FLAG_DEFER_CONSENT} flag is not set.
          */
         public void onFinished() {}
 
@@ -161,8 +157,10 @@
          * {@link #onFinished()} callback will be invoked.
          *
          * @param bugreportFile the absolute path of the generated bugreport file.
+         * @hide
 
          */
+        @SystemApi
         public void onFinished(@NonNull String bugreportFile) {}
 
         /**