diff options
author | 2024-12-02 21:43:56 +0000 | |
---|---|---|
committer | 2024-12-16 18:06:30 +0000 | |
commit | d80e672eb045e8d786aeed2711a920a0b7fe6231 (patch) | |
tree | 5a706165afcb7fc9b5832a05856dd36fd084f753 | |
parent | f153bc11f9819a362505ba270adbf1a41d698d95 (diff) |
[framework] Expose constructor of ApduServiceInfo.
Bug: 380892385
Test: compile
Change-Id: Ic0f196c2bd382f5875645a8bd9917c8dc0f8167f
-rw-r--r-- | core/api/system-current.txt | 1 | ||||
-rw-r--r-- | nfc-non-updatable/flags/flags.aconfig | 8 | ||||
-rw-r--r-- | nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java | 25 |
3 files changed, 30 insertions, 4 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index b91f5e26d47a..a1c18eb20820 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10505,6 +10505,7 @@ package android.nfc.cardemulation { } @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 ee287aba709f..6b14a1ed3990 100644 --- a/nfc-non-updatable/flags/flags.aconfig +++ b/nfc-non-updatable/flags/flags.aconfig @@ -189,3 +189,11 @@ flag { 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 7f64dbea0be3..93d6eb73dcae 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 @@ public final class ApduServiceInfo implements Parcelable { 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 @@ public final class ApduServiceInfo implements Parcelable { * @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) { |