import typing

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

class AppFunctionException(android.os.Parcelable, java.lang.Exception):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[AppFunctionException]] = ...
    ERROR_APP_UNKNOWN_ERROR: typing.ClassVar[int] = ...
    ERROR_CANCELLED: typing.ClassVar[int] = ...
    ERROR_CATEGORY_APP: typing.ClassVar[int] = ...
    ERROR_CATEGORY_REQUEST_ERROR: typing.ClassVar[int] = ...
    ERROR_CATEGORY_SYSTEM: typing.ClassVar[int] = ...
    ERROR_CATEGORY_UNKNOWN: typing.ClassVar[int] = ...
    ERROR_DENIED: typing.ClassVar[int] = ...
    ERROR_DISABLED: typing.ClassVar[int] = ...
    ERROR_ENTERPRISE_POLICY_DISALLOWED: typing.ClassVar[int] = ...
    ERROR_FUNCTION_NOT_FOUND: typing.ClassVar[int] = ...
    ERROR_INVALID_ARGUMENT: typing.ClassVar[int] = ...
    ERROR_SYSTEM_ERROR: typing.ClassVar[int] = ...
    @typing.overload
    def __init__(self, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, extras: android.os.Bundle, /) -> None: ...
    def describeContents(self) -> int: ...
    def getErrorCategory(self) -> int: ...
    def getErrorCode(self) -> int: ...
    def getErrorMessage(self) -> str: ...
    def getExtras(self) -> android.os.Bundle: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class AppFunctionManager(java.lang.Object):
    APP_FUNCTION_STATE_DEFAULT: typing.ClassVar[int] = ...
    APP_FUNCTION_STATE_DISABLED: typing.ClassVar[int] = ...
    APP_FUNCTION_STATE_ENABLED: typing.ClassVar[int] = ...
    def executeAppFunction(self, request: ExecuteAppFunctionRequest, executor: java.util.concurrent.Executor, cancellationSignal: android.os.CancellationSignal, callback: android.os.OutcomeReceiver[ExecuteAppFunctionResponse, AppFunctionException], /) -> None: ...
    @typing.overload
    def isAppFunctionEnabled(self, functionIdentifier: str | java.lang.String, executor: java.util.concurrent.Executor, callback: android.os.OutcomeReceiver[java.lang.Boolean, java.lang.Exception], /) -> None: ...
    @typing.overload
    def isAppFunctionEnabled(self, functionIdentifier: str | java.lang.String, targetPackage: str | java.lang.String, executor: java.util.concurrent.Executor, callback: android.os.OutcomeReceiver[java.lang.Boolean, java.lang.Exception], /) -> None: ...
    def setAppFunctionEnabled(self, functionIdentifier: str | java.lang.String, newEnabledState: int | java.jint | java.lang.Integer, executor: java.util.concurrent.Executor, callback: android.os.OutcomeReceiver[java.lang.Void, java.lang.Exception], /) -> None: ...

class AppFunctionService(android.app.Service):
    SERVICE_INTERFACE: typing.ClassVar[str] = ...
    def __init__(self) -> None: ...
    def onBind(self, intent: android.content.Intent, /) -> android.os.IBinder: ...
    def onExecuteFunction(self, arg1: ExecuteAppFunctionRequest, arg2: str | java.lang.String, arg3: android.content.pm.SigningInfo, arg4: android.os.CancellationSignal, arg5: android.os.OutcomeReceiver[ExecuteAppFunctionResponse, AppFunctionException], /) -> None: ...

class ExecuteAppFunctionRequest(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[ExecuteAppFunctionRequest]] = ...
    def describeContents(self) -> int: ...
    def getExtras(self) -> android.os.Bundle: ...
    def getFunctionIdentifier(self) -> str: ...
    def getParameters(self) -> android.app.appsearch.GenericDocument: ...
    def getTargetPackageName(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, targetPackageName: str | java.lang.String, functionIdentifier: str | java.lang.String, /) -> None: ...
        def build(self) -> ExecuteAppFunctionRequest: ...
        def setExtras(self, extras: android.os.Bundle, /) -> ExecuteAppFunctionRequest.Builder: ...
        def setParameters(self, parameters: android.app.appsearch.GenericDocument, /) -> ExecuteAppFunctionRequest.Builder: ...

class ExecuteAppFunctionResponse(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[ExecuteAppFunctionResponse]] = ...
    PROPERTY_RETURN_VALUE: typing.ClassVar[str] = ...
    @typing.overload
    def __init__(self, resultDocument: android.app.appsearch.GenericDocument, /) -> None: ...
    @typing.overload
    def __init__(self, resultDocument: android.app.appsearch.GenericDocument, extras: android.os.Bundle, /) -> None: ...
    def describeContents(self) -> int: ...
    def getExtras(self) -> android.os.Bundle: ...
    def getResultDocument(self) -> android.app.appsearch.GenericDocument: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...
