[framework] Expose constructor of ApduServiceInfo.

Bug: 380892385
Test: compile
Change-Id: Ic0f196c2bd382f5875645a8bd9917c8dc0f8167f
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index b91f5e2..a1c18eb 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -10505,6 +10505,7 @@
   }
 
   @FlaggedApi("android.nfc.enable_nfc_mainline") public final class ApduServiceInfo implements android.os.Parcelable {
+    ctor @FlaggedApi("android.nfc.nfc_apdu_service_info_constructor") public ApduServiceInfo(@NonNull android.content.pm.ResolveInfo, boolean, @NonNull String, @NonNull java.util.List<android.nfc.cardemulation.AidGroup>, @NonNull java.util.List<android.nfc.cardemulation.AidGroup>, boolean, int, int, @NonNull String, @NonNull String, @NonNull String);
     ctor @FlaggedApi("android.nfc.enable_nfc_mainline") public ApduServiceInfo(@NonNull android.content.pm.PackageManager, @NonNull android.content.pm.ResolveInfo, boolean) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method @FlaggedApi("android.nfc.nfc_read_polling_loop") public void addPollingLoopFilter(@NonNull String, boolean);
     method @FlaggedApi("android.nfc.nfc_read_polling_loop") public void addPollingLoopPatternFilter(@NonNull String, boolean);
diff --git a/nfc-non-updatable/flags/flags.aconfig b/nfc-non-updatable/flags/flags.aconfig
index ee287ab..6b14a1e 100644
--- a/nfc-non-updatable/flags/flags.aconfig
+++ b/nfc-non-updatable/flags/flags.aconfig
@@ -189,3 +189,11 @@
     description: "App can check its tag intent preference status"
     bug: "335916336"
 }
+
+flag {
+    name: "nfc_apdu_service_info_constructor"
+    is_exported: true
+    namespace: "nfc"
+    description: "Expose constructor for ApduServiceInfo"
+    bug: "380892385"
+}
diff --git a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
index 7f64dbe..93d6eb7 100644
--- a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -177,13 +177,30 @@
     private boolean mWantsRoleHolderPriority;
 
     /**
+     * Constructor of {@link ApduServiceInfo}.
+     * @param info App component info
+     * @param onHost whether service is on host or not (secure element)
+     * @param description The description of service
+     * @param staticAidGroups static AID groups
+     * @param dynamicAidGroups dynamic AID groups
+     * @param requiresUnlock whether this service should only be started
+     *                       when the device is unlocked
+     * @param bannerResource The id of the service banner specified in XML
+     * @param uid The uid of the package the service belongs to
+     * @param settingsActivityName Settings Activity for this service
+     * @param offHost Off-host reader name
+     * @param staticOffHost Off-host reader name from manifest file
+     *
      * @hide
      */
     @UnsupportedAppUsage
-    public ApduServiceInfo(ResolveInfo info, boolean onHost, String description,
-            ArrayList<AidGroup> staticAidGroups, ArrayList<AidGroup> dynamicAidGroups,
+    @SystemApi
+    @FlaggedApi(Flags.FLAG_NFC_APDU_SERVICE_INFO_CONSTRUCTOR)
+    public ApduServiceInfo(@NonNull ResolveInfo info, boolean onHost, @NonNull String description,
+            @NonNull List<AidGroup> staticAidGroups, @NonNull List<AidGroup> dynamicAidGroups,
             boolean requiresUnlock, int bannerResource, int uid,
-            String settingsActivityName, String offHost, String staticOffHost) {
+            @NonNull String settingsActivityName, @NonNull String offHost,
+            @NonNull String staticOffHost) {
         this(info, onHost, description, staticAidGroups, dynamicAidGroups,
                 requiresUnlock, bannerResource, uid, settingsActivityName,
                 offHost, staticOffHost, false);
@@ -193,7 +210,7 @@
      * @hide
      */
     public ApduServiceInfo(ResolveInfo info, boolean onHost, String description,
-            ArrayList<AidGroup> staticAidGroups, ArrayList<AidGroup> dynamicAidGroups,
+            List<AidGroup> staticAidGroups, List<AidGroup> dynamicAidGroups,
             boolean requiresUnlock, int bannerResource, int uid,
             String settingsActivityName, String offHost, String staticOffHost,
             boolean isEnabled) {