import typing

import android.app
import android.content
import android.nfc
import android.os
import java
import java.chaquopy
import java.lang
import java.util
import java.util.concurrent

class CardEmulation(java.lang.Object):
    ACTION_CHANGE_DEFAULT: typing.ClassVar[str] = ...
    CATEGORY_OTHER: typing.ClassVar[str] = ...
    CATEGORY_PAYMENT: typing.ClassVar[str] = ...
    EXTRA_CATEGORY: typing.ClassVar[str] = ...
    EXTRA_SERVICE_COMPONENT: typing.ClassVar[str] = ...
    NFC_INTERNAL_ERROR_COMMAND_TIMEOUT: typing.ClassVar[int] = ...
    NFC_INTERNAL_ERROR_NFC_CRASH_RESTART: typing.ClassVar[int] = ...
    NFC_INTERNAL_ERROR_NFC_HARDWARE_ERROR: typing.ClassVar[int] = ...
    NFC_INTERNAL_ERROR_UNKNOWN: typing.ClassVar[int] = ...
    PROPERTY_ALLOW_SHARED_ROLE_PRIORITY: typing.ClassVar[str] = ...
    PROTOCOL_AND_TECHNOLOGY_ROUTE_DEFAULT: typing.ClassVar[int] = ...
    PROTOCOL_AND_TECHNOLOGY_ROUTE_DH: typing.ClassVar[int] = ...
    PROTOCOL_AND_TECHNOLOGY_ROUTE_ESE: typing.ClassVar[int] = ...
    PROTOCOL_AND_TECHNOLOGY_ROUTE_UICC: typing.ClassVar[int] = ...
    PROTOCOL_AND_TECHNOLOGY_ROUTE_UNSET: typing.ClassVar[int] = ...
    SELECTION_MODE_ALWAYS_ASK: typing.ClassVar[int] = ...
    SELECTION_MODE_ASK_IF_CONFLICT: typing.ClassVar[int] = ...
    SELECTION_MODE_PREFER_DEFAULT: typing.ClassVar[int] = ...
    def categoryAllowsForegroundPreference(self, category: str | java.lang.String, /) -> bool: ...
    def getAidsForPreferredPaymentService(self) -> java.util.List[java.lang.String] | None: ...
    def getAidsForService(self, service: android.content.ComponentName, category: str | java.lang.String, /) -> java.util.List[java.lang.String] | None: ...
    def getDefaultNfcSubscriptionId(self) -> int: ...
    def getDescriptionForPreferredPaymentService(self) -> java.lang.CharSequence | None: ...
    @staticmethod
    def getInstance(adapter: android.nfc.NfcAdapter, /) -> CardEmulation: ...
    def getRouteDestinationForPreferredPaymentService(self) -> str | None: ...
    def getSelectionModeForCategory(self, category: str | java.lang.String, /) -> int: ...
    def isDefaultServiceForAid(self, service: android.content.ComponentName, aid: str | java.lang.String, /) -> bool: ...
    def isDefaultServiceForCategory(self, service: android.content.ComponentName, category: str | java.lang.String, /) -> bool: ...
    def isEuiccSupported(self) -> bool: ...
    def registerAidsForService(self, service: android.content.ComponentName, category: str | java.lang.String, aids: java.util.List[java.lang.String], /) -> bool: ...
    def registerNfcEventCallback(self, executor: java.util.concurrent.Executor, callback: CardEmulation.NfcEventCallback, /) -> None: ...
    def registerPollingLoopFilterForService(self, service: android.content.ComponentName, pollingLoopFilter: str | java.lang.String, autoTransact: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    def registerPollingLoopPatternFilterForService(self, service: android.content.ComponentName, pollingLoopPatternFilter: str | java.lang.String, autoTransact: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    def removeAidsForService(self, service: android.content.ComponentName, category: str | java.lang.String, /) -> bool: ...
    def removePollingLoopFilterForService(self, service: android.content.ComponentName, pollingLoopFilter: str | java.lang.String, /) -> bool: ...
    def removePollingLoopPatternFilterForService(self, service: android.content.ComponentName, pollingLoopPatternFilter: str | java.lang.String, /) -> bool: ...
    def setOffHostForService(self, service: android.content.ComponentName, offHostSecureElement: str | java.lang.String, /) -> bool: ...
    def setPreferredService(self, activity: android.app.Activity, service: android.content.ComponentName, /) -> bool: ...
    def setShouldDefaultToObserveModeForService(self, service: android.content.ComponentName, enable: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    def supportsAidPrefixRegistration(self) -> bool: ...
    def unregisterNfcEventCallback(self, callback: CardEmulation.NfcEventCallback, /) -> None: ...
    def unsetOffHostForService(self, service: android.content.ComponentName, /) -> bool: ...
    def unsetPreferredService(self, activity: android.app.Activity, /) -> bool: ...

    class NfcEventCallback(java.lang.Object):
        def onAidConflictOccurred(self, aid: str | java.lang.String, /) -> None: ...
        def onAidNotRouted(self, aid: str | java.lang.String, /) -> None: ...
        def onInternalErrorReported(self, errorType: int | java.jint | java.lang.Integer, /) -> None: ...
        def onNfcStateChanged(self, state: int | java.jint | java.lang.Integer, /) -> None: ...
        def onObserveModeStateChanged(self, isEnabled: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
        def onPreferredServiceChanged(self, isPreferred: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
        def onRemoteFieldChanged(self, isDetected: bool | java.jboolean | java.lang.Boolean, /) -> None: ...

class HostApduService(android.app.Service):
    DEACTIVATION_DESELECTED: typing.ClassVar[int] = ...
    DEACTIVATION_LINK_LOSS: typing.ClassVar[int] = ...
    SERVICE_INTERFACE: typing.ClassVar[str] = ...
    SERVICE_META_DATA: typing.ClassVar[str] = ...
    def __init__(self) -> None: ...
    def notifyUnhandled(self) -> None: ...
    def onBind(self, intent: android.content.Intent, /) -> android.os.IBinder: ...
    def onDeactivated(self, arg1: int | java.jint | java.lang.Integer, /) -> None: ...
    def processCommandApdu(self, arg1: java.chaquopy.JavaArrayJByte, arg2: android.os.Bundle, /) -> java.chaquopy.JavaArrayJByte | None: ...
    def processPollingFrames(self, frames: java.util.List[PollingFrame], /) -> None: ...
    def sendResponseApdu(self, responseApdu: java.chaquopy.JavaArrayJByte, /) -> None: ...

class HostNfcFService(android.app.Service):
    DEACTIVATION_LINK_LOSS: typing.ClassVar[int] = ...
    SERVICE_INTERFACE: typing.ClassVar[str] = ...
    SERVICE_META_DATA: typing.ClassVar[str] = ...
    def __init__(self) -> None: ...
    def onBind(self, intent: android.content.Intent, /) -> android.os.IBinder: ...
    def onDeactivated(self, arg1: int | java.jint | java.lang.Integer, /) -> None: ...
    def processNfcFPacket(self, arg1: java.chaquopy.JavaArrayJByte, arg2: android.os.Bundle, /) -> java.chaquopy.JavaArrayJByte | None: ...
    def sendResponsePacket(self, responsePacket: java.chaquopy.JavaArrayJByte, /) -> None: ...

class NfcFCardEmulation(java.lang.Object):
    def disableService(self, activity: android.app.Activity, /) -> bool: ...
    def enableService(self, activity: android.app.Activity, service: android.content.ComponentName, /) -> bool: ...
    @staticmethod
    def getInstance(adapter: android.nfc.NfcAdapter, /) -> NfcFCardEmulation: ...
    def getNfcid2ForService(self, service: android.content.ComponentName, /) -> str: ...
    def getSystemCodeForService(self, service: android.content.ComponentName, /) -> str: ...
    def registerSystemCodeForService(self, service: android.content.ComponentName, systemCode: str | java.lang.String, /) -> bool: ...
    def setNfcid2ForService(self, service: android.content.ComponentName, nfcid2: str | java.lang.String, /) -> bool: ...
    def unregisterSystemCodeForService(self, service: android.content.ComponentName, /) -> bool: ...

class OffHostApduService(android.app.Service):
    SERVICE_INTERFACE: typing.ClassVar[str] = ...
    SERVICE_META_DATA: typing.ClassVar[str] = ...
    def __init__(self) -> None: ...
    def onBind(self, arg1: android.content.Intent, /) -> android.os.IBinder: ...

class PollingFrame(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[PollingFrame]] = ...
    POLLING_LOOP_TYPE_A: typing.ClassVar[int] = ...
    POLLING_LOOP_TYPE_B: typing.ClassVar[int] = ...
    POLLING_LOOP_TYPE_F: typing.ClassVar[int] = ...
    POLLING_LOOP_TYPE_OFF: typing.ClassVar[int] = ...
    POLLING_LOOP_TYPE_ON: typing.ClassVar[int] = ...
    POLLING_LOOP_TYPE_UNKNOWN: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def getData(self) -> java.chaquopy.JavaArrayJByte: ...
    def getTimestamp(self) -> int: ...
    def getTriggeredAutoTransact(self) -> bool: ...
    def getType(self) -> int: ...
    def getVendorSpecificGain(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...
