import typing

import android.app
import android.content
import android.content.pm
import android.os
import android.view
import java
import java.lang
import java.util
import java.util.concurrent

class AppOwnedSdkSandboxInterface(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[AppOwnedSdkSandboxInterface]] = ...
    def __init__(self, name: str | java.lang.String, version: int | java.jlong | java.lang.Long, binder: android.os.IBinder, /) -> None: ...
    def describeContents(self) -> int: ...
    def getInterface(self) -> android.os.IBinder: ...
    def getName(self) -> str: ...
    def getVersion(self) -> int: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class LoadSdkException(android.os.Parcelable, java.lang.Exception):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[LoadSdkException]] = ...
    def __init__(self, cause: java.lang.Throwable, extraInfo: android.os.Bundle, /) -> None: ...
    def describeContents(self) -> int: ...
    def getExtraInformation(self) -> android.os.Bundle: ...
    def getLoadSdkErrorCode(self) -> int: ...
    def writeToParcel(self, destination: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class RequestSurfacePackageException(java.lang.Exception):
    @typing.overload
    def __init__(self, requestSurfacePackageErrorCode: int | java.jint | java.lang.Integer, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, requestSurfacePackageErrorCode: int | java.jint | java.lang.Integer, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, requestSurfacePackageErrorCode: int | java.jint | java.lang.Integer, message: str | java.lang.String, cause: java.lang.Throwable, extraInfo: android.os.Bundle, /) -> None: ...
    def getExtraErrorInformation(self) -> android.os.Bundle: ...
    def getRequestSurfacePackageErrorCode(self) -> int: ...

class SandboxedSdk(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[SandboxedSdk]] = ...
    def __init__(self, sdkInterface: android.os.IBinder, /) -> None: ...
    def describeContents(self) -> int: ...
    def getInterface(self) -> android.os.IBinder | None: ...
    def getSharedLibraryInfo(self) -> android.content.pm.SharedLibraryInfo: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class SandboxedSdkProvider(java.lang.Object):
    def __init__(self) -> None: ...
    def attachContext(self, context: android.content.Context, /) -> None: ...
    def beforeUnloadSdk(self) -> None: ...
    def getContext(self) -> android.content.Context | None: ...
    def getView(self, arg1: android.content.Context, arg2: android.os.Bundle, arg3: int | java.jint | java.lang.Integer, arg4: int | java.jint | java.lang.Integer, /) -> android.view.View: ...
    def onLoadSdk(self, arg1: android.os.Bundle, /) -> SandboxedSdk: ...

class SdkSandboxManager(java.lang.Object):
    EXTRA_DISPLAY_ID: typing.ClassVar[str] = ...
    EXTRA_HEIGHT_IN_PIXELS: typing.ClassVar[str] = ...
    EXTRA_HOST_TOKEN: typing.ClassVar[str] = ...
    EXTRA_SURFACE_PACKAGE: typing.ClassVar[str] = ...
    EXTRA_WIDTH_IN_PIXELS: typing.ClassVar[str] = ...
    LOAD_SDK_ALREADY_LOADED: typing.ClassVar[int] = ...
    LOAD_SDK_INTERNAL_ERROR: typing.ClassVar[int] = ...
    LOAD_SDK_NOT_FOUND: typing.ClassVar[int] = ...
    LOAD_SDK_SDK_DEFINED_ERROR: typing.ClassVar[int] = ...
    LOAD_SDK_SDK_SANDBOX_DISABLED: typing.ClassVar[int] = ...
    REQUEST_SURFACE_PACKAGE_INTERNAL_ERROR: typing.ClassVar[int] = ...
    REQUEST_SURFACE_PACKAGE_SDK_NOT_LOADED: typing.ClassVar[int] = ...
    SDK_SANDBOX_PROCESS_NOT_AVAILABLE: typing.ClassVar[int] = ...
    SDK_SANDBOX_SERVICE: typing.ClassVar[str] = ...
    SDK_SANDBOX_STATE_DISABLED: typing.ClassVar[int] = ...
    SDK_SANDBOX_STATE_ENABLED_PROCESS_ISOLATION: typing.ClassVar[int] = ...
    def addSdkSandboxProcessDeathCallback(self, callbackExecutor: java.util.concurrent.Executor, callback: SdkSandboxManager.SdkSandboxProcessDeathCallback, /) -> None: ...
    def addSyncedSharedPreferencesKeys(self, keys: java.util.Set[java.lang.String], /) -> None: ...
    def getAppOwnedSdkSandboxInterfaces(self) -> java.util.List[AppOwnedSdkSandboxInterface]: ...
    def getSandboxedSdks(self) -> java.util.List[SandboxedSdk]: ...
    @staticmethod
    def getSdkSandboxState() -> int: ...
    def getSyncedSharedPreferencesKeys(self) -> java.util.Set[java.lang.String]: ...
    def loadSdk(self, sdkName: str | java.lang.String, params: android.os.Bundle, executor: java.util.concurrent.Executor, receiver: android.os.OutcomeReceiver[SandboxedSdk, LoadSdkException], /) -> None: ...
    def registerAppOwnedSdkSandboxInterface(self, appOwnedSdkSandboxInterface: AppOwnedSdkSandboxInterface, /) -> None: ...
    def removeSdkSandboxProcessDeathCallback(self, callback: SdkSandboxManager.SdkSandboxProcessDeathCallback, /) -> None: ...
    def removeSyncedSharedPreferencesKeys(self, keys: java.util.Set[java.lang.String], /) -> None: ...
    def requestSurfacePackage(self, sdkName: str | java.lang.String, params: android.os.Bundle, callbackExecutor: java.util.concurrent.Executor, receiver: android.os.OutcomeReceiver[android.os.Bundle, RequestSurfacePackageException], /) -> None: ...
    def startSdkSandboxActivity(self, fromActivity: android.app.Activity, sdkActivityToken: android.os.IBinder, /) -> None: ...
    def unloadSdk(self, sdkName: str | java.lang.String, /) -> None: ...
    def unregisterAppOwnedSdkSandboxInterface(self, name: str | java.lang.String, /) -> None: ...

    class SdkSandboxProcessDeathCallback(java.lang.Object):
        def onSdkSandboxDied(self) -> None: ...
