Make android.os.BugreportParams.BUGREPORT_MODE_MAX_VALUE flagged

Although BUGREPORT_MODE_MAX_VALUE is a constant @TestApi, it should
not be exempted to be flagged. This is necessary to properly
generate SDK.

There is no change needed in caller side (the CTS BugreportManagerTest) because the flag protect the constant value which is the same no matter the flag is on or off.

Bug: 305067125
Test: atest BugreportManagerTest
Change-Id: I00047c5579c23a072b4300561c975debea8fe200
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index acac4c20..fa4fdb8 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -2148,7 +2148,7 @@
   }
 
   public final class BugreportParams {
-    field public static final int BUGREPORT_MODE_MAX_VALUE = 7; // 0x7
+    field @FlaggedApi("android.os.bugreport_mode_max_value") public static final int BUGREPORT_MODE_MAX_VALUE = 7; // 0x7
   }
 
   public class Build {
diff --git a/core/java/android/os/BugreportParams.java b/core/java/android/os/BugreportParams.java
index 47ad72f..e8ad303 100644
--- a/core/java/android/os/BugreportParams.java
+++ b/core/java/android/os/BugreportParams.java
@@ -16,6 +16,7 @@
 
 package android.os;
 
+import android.annotation.FlaggedApi;
 import android.annotation.IntDef;
 import android.annotation.SystemApi;
 import android.annotation.TestApi;
@@ -133,6 +134,7 @@
      * The maximum value of supported bugreport mode.
      * @hide
      */
+    @FlaggedApi(android.os.Flags.FLAG_BUGREPORT_MODE_MAX_VALUE)
     @TestApi
     public static final int BUGREPORT_MODE_MAX_VALUE = BUGREPORT_MODE_ONBOARDING;
 
diff --git a/core/java/android/os/flags.aconfig b/core/java/android/os/flags.aconfig
index 7fceda4..77357dc 100644
--- a/core/java/android/os/flags.aconfig
+++ b/core/java/android/os/flags.aconfig
@@ -27,3 +27,10 @@
     description: "Guards a new Private Profile type in UserManager - everything from its setup to config to deletion."
     bug: "299069460"
 }
+
+flag {
+    name: "bugreport_mode_max_value"
+    namespace: "telephony"
+    description: "Introduce a constant as maximum value of bugreport mode."
+    bug: "305067125"
+}