次の方法で共有


CardEmulation.SetOffHostForService(ComponentName, String) Method

Definition

Sets the off-host Secure Element for the given service.

[Android.Runtime.Register("setOffHostForService", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "", ApiSince=29)]
[Android.Runtime.RequiresPermission("android.permission.NFC")]
public bool SetOffHostForService (Android.Content.ComponentName service, string offHostSecureElement);
[<Android.Runtime.Register("setOffHostForService", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "", ApiSince=29)>]
[<Android.Runtime.RequiresPermission("android.permission.NFC")>]
member this.SetOffHostForService : Android.Content.ComponentName * string -> bool

Parameters

service
ComponentName

The component name of the service

offHostSecureElement
String

Secure Element to register the AID to. Only accept strings with prefix SIM or prefix eSE. Ref: GSMA TS.26 - NFC Handset Requirements TS26_NFC_REQ_069: For UICC, Secure Element Name SHALL be SIM[smartcard slot] (e.g. SIM/SIM1, SIM2… SIMn). TS26_NFC_REQ_070: For embedded SE, Secure Element Name SHALL be eSE[number] (e.g. eSE/eSE1, eSE2, etc.).

Returns

whether the registration was successful.

Attributes

Remarks

Sets the off-host Secure Element for the given service.

If off-host SE was initially set (either statically through the manifest, or dynamically by using this API), it will be replaced with this one. All AIDs registered by this service will be re-routed to this Secure Element if successful. AIDs that was statically assigned using manifest will re-route to off-host SE that stated in manifest after NFC toggle.

Note that you can only set off-host SE for a service that is running under the same UID as the caller of this API. Typically this means you need to call this from the same package as the service itself, though UIDs can also be shared between packages using shared UIDs.

Registeration will be successful only if the Secure Element exists on the device.

Java documentation for android.nfc.cardemulation.CardEmulation.setOffHostForService(android.content.ComponentName, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to