import typing

import android.os
import android.ranging
import android.util
import java
import java.chaquopy
import java.lang
import java.time
import java.util
import java.util.concurrent

class DeviceHandle(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[DeviceHandle]] = ...
    def describeContents(self) -> int: ...
    def getRangingDevice(self) -> android.ranging.RangingDevice: ...
    def getTransportHandle(self) -> TransportHandle: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self, rangingDevice: android.ranging.RangingDevice, transportHandle: TransportHandle, /) -> None: ...
        def build(self) -> DeviceHandle: ...

class OobInitiatorRangingConfig(android.os.Parcelable, android.ranging.RangingConfig):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[OobInitiatorRangingConfig]] = ...
    RANGING_MODE_AUTO: typing.ClassVar[int] = ...
    RANGING_MODE_FUSED: typing.ClassVar[int] = ...
    RANGING_MODE_HIGH_ACCURACY: typing.ClassVar[int] = ...
    RANGING_MODE_HIGH_ACCURACY_PREFERRED: typing.ClassVar[int] = ...
    SECURITY_LEVEL_BASIC: typing.ClassVar[int] = ...
    SECURITY_LEVEL_SECURE: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def getDeviceHandles(self) -> java.util.List[DeviceHandle]: ...
    def getFastestRangingInterval(self) -> java.time.Duration: ...
    def getRangingIntervalRange(self) -> android.util.Range[java.time.Duration]: ...
    def getRangingMode(self) -> int: ...
    def getSecurityLevel(self) -> int: ...
    def getSlowestRangingInterval(self) -> java.time.Duration: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def addDeviceHandle(self, deviceHandle: DeviceHandle, /) -> OobInitiatorRangingConfig.Builder: ...
        def addDeviceHandles(self, deviceHandles: java.util.List[DeviceHandle], /) -> OobInitiatorRangingConfig.Builder: ...
        def build(self) -> OobInitiatorRangingConfig: ...
        def setFastestRangingInterval(self, intervalMs: java.time.Duration, /) -> OobInitiatorRangingConfig.Builder: ...
        def setRangingMode(self, rangingMode: int | java.jint | java.lang.Integer, /) -> OobInitiatorRangingConfig.Builder: ...
        def setSecurityLevel(self, securityLevel: int | java.jint | java.lang.Integer, /) -> OobInitiatorRangingConfig.Builder: ...
        def setSlowestRangingInterval(self, intervalMs: java.time.Duration, /) -> OobInitiatorRangingConfig.Builder: ...

class OobResponderRangingConfig(android.os.Parcelable, android.ranging.RangingConfig):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[OobResponderRangingConfig]] = ...
    def describeContents(self) -> int: ...
    def getDeviceHandle(self) -> DeviceHandle: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self, deviceHandle: DeviceHandle, /) -> None: ...
        def build(self) -> OobResponderRangingConfig: ...

class TransportHandle(java.lang.AutoCloseable):
    def registerReceiveCallback(self, arg1: java.util.concurrent.Executor, arg2: TransportHandle.ReceiveCallback, /) -> None: ...
    def sendData(self, arg1: java.chaquopy.JavaArrayJByte, /) -> None: ...

    class ReceiveCallback(java.lang.Object):
        def onClose(self) -> None: ...
        def onDisconnect(self) -> None: ...
        def onReceiveData(self, arg1: java.chaquopy.JavaArrayJByte, /) -> None: ...
        def onReconnect(self) -> None: ...
        def onSendFailed(self) -> None: ...
