|
| 1 | +// Auto-generated by Java-to-Swift wrapper generator. |
| 2 | +import AndroidApp |
| 3 | +import AndroidContent |
| 4 | +import SwiftJava |
| 5 | +import SwiftJavaJNICore |
| 6 | + |
| 7 | +/// Manages NFC card emulation services, AID routing, and payment preferences. |
| 8 | +/// |
| 9 | +/// Card emulation allows Android devices to act as NFC cards. Obtain an instance via |
| 10 | +/// `CardEmulation.getInstance(_:)`. Requires the `FEATURE_NFC_HOST_CARD_EMULATION` feature. |
| 11 | +/// |
| 12 | +/// See also: [android.nfc.cardemulation.CardEmulation](https://developer.android.com/reference/android/nfc/cardemulation/CardEmulation) |
| 13 | +@available(Android 19, *) |
| 14 | +@JavaClass("android.nfc.cardemulation.CardEmulation") |
| 15 | +open class CardEmulation: JavaObject { |
| 16 | + /// Sets whether the given service should default to observe mode. |
| 17 | + /// |
| 18 | + /// - Parameter arg0: The component name of the card emulation service. |
| 19 | + /// - Parameter arg1: `true` to default to observe mode. |
| 20 | + /// - Returns: `true` if the setting was applied. |
| 21 | + @available(Android 35, *) |
| 22 | + @JavaMethod |
| 23 | + open func setShouldDefaultToObserveModeForService(_ arg0: ComponentName?, _ arg1: Bool) -> Bool |
| 24 | + |
| 25 | + /// Registers a polling loop filter for the given service. |
| 26 | + /// |
| 27 | + /// - Parameter arg0: The component name of the card emulation service. |
| 28 | + /// - Parameter arg1: A hex string filter for matching polling loop data. |
| 29 | + /// - Parameter arg2: `true` to auto-transact when the filter matches. |
| 30 | + /// - Returns: `true` if the filter was registered. |
| 31 | + @available(Android 35, *) |
| 32 | + @JavaMethod |
| 33 | + open func registerPollingLoopFilterForService(_ arg0: ComponentName?, _ arg1: String, _ arg2: Bool) -> Bool |
| 34 | + |
| 35 | + /// Registers a regex pattern filter for the given service's polling loop data. |
| 36 | + /// |
| 37 | + /// - Parameter arg0: The component name of the card emulation service. |
| 38 | + /// - Parameter arg1: A regex pattern to match against polling loop data. |
| 39 | + /// - Parameter arg2: `true` to auto-transact when the pattern matches. |
| 40 | + /// - Returns: `true` if the filter was registered. |
| 41 | + @available(Android 35, *) |
| 42 | + @JavaMethod |
| 43 | + open func registerPollingLoopPatternFilterForService(_ arg0: ComponentName?, _ arg1: String, _ arg2: Bool) -> Bool |
| 44 | + |
| 45 | + /// Removes a previously registered polling loop pattern filter. |
| 46 | + /// |
| 47 | + /// - Parameter arg0: The component name of the card emulation service. |
| 48 | + /// - Parameter arg1: The pattern string to remove. |
| 49 | + /// - Returns: `true` if the filter was removed. |
| 50 | + @available(Android 35, *) |
| 51 | + @JavaMethod |
| 52 | + open func removePollingLoopPatternFilterForService(_ arg0: ComponentName?, _ arg1: String) -> Bool |
| 53 | + |
| 54 | + /// Returns the route destination (e.g., `"HCE"`, `"OffHost"`) for the preferred payment service. |
| 55 | + @available(Android 35, *) |
| 56 | + @JavaMethod |
| 57 | + open func getRouteDestinationForPreferredPaymentService() -> String |
| 58 | + |
| 59 | + /// Returns `true` if the given service is the default for the specified category. |
| 60 | + /// |
| 61 | + /// - Parameter arg0: The component name of the card emulation service. |
| 62 | + /// - Parameter arg1: One of `CATEGORY_PAYMENT` or `CATEGORY_OTHER`. |
| 63 | + @JavaMethod |
| 64 | + open func isDefaultServiceForCategory(_ arg0: ComponentName?, _ arg1: String) -> Bool |
| 65 | + |
| 66 | + /// Returns `true` if the given service is the default handler for the specified AID. |
| 67 | + /// |
| 68 | + /// - Parameter arg0: The component name of the card emulation service. |
| 69 | + /// - Parameter arg1: The AID as a hex string. |
| 70 | + @JavaMethod |
| 71 | + open func isDefaultServiceForAid(_ arg0: ComponentName?, _ arg1: String) -> Bool |
| 72 | + |
| 73 | + /// Returns `true` if the given category allows foreground preference selection. |
| 74 | + /// |
| 75 | + /// - Parameter arg0: One of `CATEGORY_PAYMENT` or `CATEGORY_OTHER`. |
| 76 | + @JavaMethod |
| 77 | + open func categoryAllowsForegroundPreference(_ arg0: String) -> Bool |
| 78 | + |
| 79 | + /// Returns the selection mode for the given category (e.g., `SELECTION_MODE_PREFER_DEFAULT`). |
| 80 | + /// |
| 81 | + /// - Parameter arg0: One of `CATEGORY_PAYMENT` or `CATEGORY_OTHER`. |
| 82 | + @JavaMethod |
| 83 | + open func getSelectionModeForCategory(_ arg0: String) -> Int32 |
| 84 | + |
| 85 | + /// Removes a previously registered polling loop filter for the given service. |
| 86 | + /// |
| 87 | + /// - Parameter arg0: The component name of the card emulation service. |
| 88 | + /// - Parameter arg1: The hex string filter to remove. |
| 89 | + /// - Returns: `true` if the filter was removed. |
| 90 | + @available(Android 35, *) |
| 91 | + @JavaMethod |
| 92 | + open func removePollingLoopFilterForService(_ arg0: ComponentName?, _ arg1: String) -> Bool |
| 93 | + |
| 94 | + /// Clears the off-host secure element association for the given service. |
| 95 | + /// |
| 96 | + /// - Parameter arg0: The component name of the card emulation service. |
| 97 | + /// - Returns: `true` if the association was cleared. |
| 98 | + @available(Android 26, *) |
| 99 | + @JavaMethod |
| 100 | + open func unsetOffHostForService(_ arg0: ComponentName?) -> Bool |
| 101 | + |
| 102 | + /// Binds the given service to a specific off-host secure element. |
| 103 | + /// |
| 104 | + /// - Parameter arg0: The component name of the card emulation service. |
| 105 | + /// - Parameter arg1: The off-host secure element name (e.g., `"eSE"`, `"SIM"`). |
| 106 | + /// - Returns: `true` if the binding was applied. |
| 107 | + @available(Android 26, *) |
| 108 | + @JavaMethod |
| 109 | + open func setOffHostForService(_ arg0: ComponentName?, _ arg1: String) -> Bool |
| 110 | + |
| 111 | + /// Removes AIDs registered by the given service for the specified category. |
| 112 | + /// |
| 113 | + /// - Parameter arg0: The component name of the card emulation service. |
| 114 | + /// - Parameter arg1: One of `CATEGORY_PAYMENT` or `CATEGORY_OTHER`. |
| 115 | + /// - Returns: `true` if the AIDs were removed. |
| 116 | + @JavaMethod |
| 117 | + open func removeAidsForService(_ arg0: ComponentName?, _ arg1: String) -> Bool |
| 118 | + |
| 119 | + /// Sets the given service as the preferred card emulation service while the activity is foreground. |
| 120 | + /// |
| 121 | + /// - Parameter arg0: The foreground activity. |
| 122 | + /// - Parameter arg1: The component name of the service to prefer. |
| 123 | + /// - Returns: `true` if the preference was set. |
| 124 | + @available(Android 21, *) |
| 125 | + @JavaMethod |
| 126 | + open func setPreferredService(_ arg0: Activity?, _ arg1: ComponentName?) -> Bool |
| 127 | + |
| 128 | + /// Clears the preferred card emulation service set by `setPreferredService(_:_:)`. |
| 129 | + /// |
| 130 | + /// - Parameter arg0: The foreground activity. |
| 131 | + /// - Returns: `true` if the preference was cleared. |
| 132 | + @available(Android 21, *) |
| 133 | + @JavaMethod |
| 134 | + open func unsetPreferredService(_ arg0: Activity?) -> Bool |
| 135 | + |
| 136 | + /// Returns `true` if the device supports AID prefix and subset registration. |
| 137 | + @available(Android 23, *) |
| 138 | + @JavaMethod |
| 139 | + open func supportsAidPrefixRegistration() -> Bool |
| 140 | +} |
| 141 | +@available(Android 19, *) |
| 142 | +extension JavaClass<CardEmulation> { |
| 143 | + @available(*, deprecated) |
| 144 | + @JavaStaticField(isFinal: true) |
| 145 | + public var ACTION_CHANGE_DEFAULT: String |
| 146 | + |
| 147 | + @JavaStaticField(isFinal: true) |
| 148 | + public var CATEGORY_OTHER: String |
| 149 | + |
| 150 | + @JavaStaticField(isFinal: true) |
| 151 | + public var CATEGORY_PAYMENT: String |
| 152 | + |
| 153 | + @JavaStaticField(isFinal: true) |
| 154 | + public var EXTRA_CATEGORY: String |
| 155 | + |
| 156 | + @JavaStaticField(isFinal: true) |
| 157 | + public var EXTRA_SERVICE_COMPONENT: String |
| 158 | + |
| 159 | + @JavaStaticField(isFinal: true) |
| 160 | + public var SELECTION_MODE_ALWAYS_ASK: Int32 |
| 161 | + |
| 162 | + @JavaStaticField(isFinal: true) |
| 163 | + public var SELECTION_MODE_ASK_IF_CONFLICT: Int32 |
| 164 | + |
| 165 | + @JavaStaticField(isFinal: true) |
| 166 | + public var SELECTION_MODE_PREFER_DEFAULT: Int32 |
| 167 | + |
| 168 | + /// Returns a `CardEmulation` instance for the given NFC adapter. |
| 169 | + /// |
| 170 | + /// - Parameter arg0: The `NfcAdapter` for this device. |
| 171 | + /// - Returns: A `CardEmulation` instance. |
| 172 | + @JavaStaticMethod |
| 173 | + public func getInstance(_ arg0: NfcAdapter?) -> CardEmulation! |
| 174 | +} |
0 commit comments