import typing

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

class AbstractAccountAuthenticator(java.lang.Object):
    KEY_CUSTOM_TOKEN_EXPIRY: typing.ClassVar[str] = ...
    def __init__(self, context: android.content.Context, /) -> None: ...
    def addAccount(self, arg1: AccountAuthenticatorResponse, arg2: str | java.lang.String, arg3: str | java.lang.String, arg4: java.chaquopy.JavaArray[java.lang.String], arg5: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def addAccountFromCredentials(self, response: AccountAuthenticatorResponse, account: Account, accountCredentials: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def confirmCredentials(self, arg1: AccountAuthenticatorResponse, arg2: Account, arg3: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def editProperties(self, arg1: AccountAuthenticatorResponse, arg2: str | java.lang.String, /) -> android.os.Bundle: ...
    def finishSession(self, response: AccountAuthenticatorResponse, accountType: str | java.lang.String, sessionBundle: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def getAccountCredentialsForCloning(self, response: AccountAuthenticatorResponse, account: Account, /) -> android.os.Bundle | None: ...
    def getAccountRemovalAllowed(self, response: AccountAuthenticatorResponse, account: Account, /) -> android.os.Bundle | None: ...
    def getAuthToken(self, arg1: AccountAuthenticatorResponse, arg2: Account, arg3: str | java.lang.String, arg4: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def getAuthTokenLabel(self, arg1: str | java.lang.String, /) -> str | None: ...
    def getIBinder(self) -> android.os.IBinder: ...
    def hasFeatures(self, arg1: AccountAuthenticatorResponse, arg2: Account, arg3: java.chaquopy.JavaArray[java.lang.String], /) -> android.os.Bundle | None: ...
    def isCredentialsUpdateSuggested(self, response: AccountAuthenticatorResponse, account: Account, statusToken: str | java.lang.String, /) -> android.os.Bundle | None: ...
    def startAddAccountSession(self, response: AccountAuthenticatorResponse, accountType: str | java.lang.String, authTokenType: str | java.lang.String, requiredFeatures: java.chaquopy.JavaArray[java.lang.String], options: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def startUpdateCredentialsSession(self, response: AccountAuthenticatorResponse, account: Account, authTokenType: str | java.lang.String, options: android.os.Bundle, /) -> android.os.Bundle | None: ...
    def updateCredentials(self, arg1: AccountAuthenticatorResponse, arg2: Account, arg3: str | java.lang.String, arg4: android.os.Bundle, /) -> android.os.Bundle | None: ...

class Account(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[Account]] = ...
    name: str = ...
    type: str = ...
    @typing.overload
    def __init__(self, in_: android.os.Parcel, /) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, type: str | java.lang.String, /) -> None: ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class AccountAuthenticatorActivity(android.app.Activity):
    def __init__(self) -> None: ...
    def finish(self) -> None: ...
    def onCreate(self, icicle: android.os.Bundle, /) -> None: ...
    def setAccountAuthenticatorResult(self, result: android.os.Bundle, /) -> None: ...

class AccountAuthenticatorResponse(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[AccountAuthenticatorResponse]] = ...
    def __init__(self, parcel: android.os.Parcel, /) -> None: ...
    def describeContents(self) -> int: ...
    def onError(self, errorCode: int | java.jint | java.lang.Integer, errorMessage: str | java.lang.String, /) -> None: ...
    def onRequestContinued(self) -> None: ...
    def onResult(self, result: android.os.Bundle, /) -> None: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class AccountManager(java.lang.Object):
    ACTION_ACCOUNT_REMOVED: typing.ClassVar[str] = ...
    ACTION_AUTHENTICATOR_INTENT: typing.ClassVar[str] = ...
    AUTHENTICATOR_ATTRIBUTES_NAME: typing.ClassVar[str] = ...
    AUTHENTICATOR_META_DATA_NAME: typing.ClassVar[str] = ...
    ERROR_CODE_BAD_ARGUMENTS: typing.ClassVar[int] = ...
    ERROR_CODE_BAD_AUTHENTICATION: typing.ClassVar[int] = ...
    ERROR_CODE_BAD_REQUEST: typing.ClassVar[int] = ...
    ERROR_CODE_CANCELED: typing.ClassVar[int] = ...
    ERROR_CODE_INVALID_RESPONSE: typing.ClassVar[int] = ...
    ERROR_CODE_NETWORK_ERROR: typing.ClassVar[int] = ...
    ERROR_CODE_REMOTE_EXCEPTION: typing.ClassVar[int] = ...
    ERROR_CODE_UNSUPPORTED_OPERATION: typing.ClassVar[int] = ...
    KEY_ACCOUNTS: typing.ClassVar[str] = ...
    KEY_ACCOUNT_AUTHENTICATOR_RESPONSE: typing.ClassVar[str] = ...
    KEY_ACCOUNT_MANAGER_RESPONSE: typing.ClassVar[str] = ...
    KEY_ACCOUNT_NAME: typing.ClassVar[str] = ...
    KEY_ACCOUNT_SESSION_BUNDLE: typing.ClassVar[str] = ...
    KEY_ACCOUNT_STATUS_TOKEN: typing.ClassVar[str] = ...
    KEY_ACCOUNT_TYPE: typing.ClassVar[str] = ...
    KEY_ANDROID_PACKAGE_NAME: typing.ClassVar[str] = ...
    KEY_AUTHENTICATOR_TYPES: typing.ClassVar[str] = ...
    KEY_AUTHTOKEN: typing.ClassVar[str] = ...
    KEY_AUTH_FAILED_MESSAGE: typing.ClassVar[str] = ...
    KEY_AUTH_TOKEN_LABEL: typing.ClassVar[str] = ...
    KEY_BOOLEAN_RESULT: typing.ClassVar[str] = ...
    KEY_CALLER_PID: typing.ClassVar[str] = ...
    KEY_CALLER_UID: typing.ClassVar[str] = ...
    KEY_ERROR_CODE: typing.ClassVar[str] = ...
    KEY_ERROR_MESSAGE: typing.ClassVar[str] = ...
    KEY_INTENT: typing.ClassVar[str] = ...
    KEY_LAST_AUTHENTICATED_TIME: typing.ClassVar[str] = ...
    KEY_PASSWORD: typing.ClassVar[str] = ...
    KEY_USERDATA: typing.ClassVar[str] = ...
    LOGIN_ACCOUNTS_CHANGED_ACTION: typing.ClassVar[str] = ...
    PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE: typing.ClassVar[str] = ...
    PACKAGE_NAME_KEY_LEGACY_VISIBLE: typing.ClassVar[str] = ...
    VISIBILITY_NOT_VISIBLE: typing.ClassVar[int] = ...
    VISIBILITY_UNDEFINED: typing.ClassVar[int] = ...
    VISIBILITY_USER_MANAGED_NOT_VISIBLE: typing.ClassVar[int] = ...
    VISIBILITY_USER_MANAGED_VISIBLE: typing.ClassVar[int] = ...
    VISIBILITY_VISIBLE: typing.ClassVar[int] = ...
    def addAccount(self, accountType: str | java.lang.String, authTokenType: str | java.lang.String, requiredFeatures: java.chaquopy.JavaArray[java.lang.String], addAccountOptions: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    @typing.overload
    def addAccountExplicitly(self, account: Account, password: str | java.lang.String, userdata: android.os.Bundle, /) -> bool: ...
    @typing.overload
    def addAccountExplicitly(self, account: Account, password: str | java.lang.String, extras: android.os.Bundle, visibility: java.util.Map[java.lang.String, java.lang.Integer], /) -> bool: ...
    @typing.overload
    def addOnAccountsUpdatedListener(self, listener: OnAccountsUpdateListener, handler: android.os.Handler, updateImmediately: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    @typing.overload
    def addOnAccountsUpdatedListener(self, listener: OnAccountsUpdateListener, handler: android.os.Handler, updateImmediately: bool | java.jboolean | java.lang.Boolean, accountTypes: java.chaquopy.JavaArray[java.lang.String], /) -> None: ...
    def blockingGetAuthToken(self, account: Account, authTokenType: str | java.lang.String, notifyAuthFailure: bool | java.jboolean | java.lang.Boolean, /) -> str | None: ...
    def clearPassword(self, account: Account, /) -> None: ...
    def confirmCredentials(self, account: Account, options: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def editProperties(self, accountType: str | java.lang.String, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def finishSession(self, sessionBundle: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    @staticmethod
    def get(context: android.content.Context, /) -> AccountManager: ...
    def getAccountVisibility(self, account: Account, packageName: str | java.lang.String, /) -> int: ...
    def getAccounts(self) -> java.chaquopy.JavaArray[Account]: ...
    def getAccountsAndVisibilityForPackage(self, packageName: str | java.lang.String, accountType: str | java.lang.String, /) -> java.util.Map[Account, java.lang.Integer]: ...
    def getAccountsByType(self, type: str | java.lang.String, /) -> java.chaquopy.JavaArray[Account]: ...
    def getAccountsByTypeAndFeatures(self, type: str | java.lang.String, features: java.chaquopy.JavaArray[java.lang.String], callback: AccountManagerCallback[java.chaquopy.JavaArray[Account]], handler: android.os.Handler, /) -> AccountManagerFuture[java.chaquopy.JavaArray[Account]]: ...
    def getAccountsByTypeForPackage(self, type: str | java.lang.String, packageName: str | java.lang.String, /) -> java.chaquopy.JavaArray[Account]: ...
    @typing.overload
    def getAuthToken(self, account: Account, authTokenType: str | java.lang.String, notifyAuthFailure: bool | java.jboolean | java.lang.Boolean, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    @typing.overload
    def getAuthToken(self, account: Account, authTokenType: str | java.lang.String, options: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    @typing.overload
    def getAuthToken(self, account: Account, authTokenType: str | java.lang.String, options: android.os.Bundle, notifyAuthFailure: bool | java.jboolean | java.lang.Boolean, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def getAuthTokenByFeatures(self, accountType: str | java.lang.String, authTokenType: str | java.lang.String, features: java.chaquopy.JavaArray[java.lang.String], activity: android.app.Activity, addAccountOptions: android.os.Bundle, getAuthTokenOptions: android.os.Bundle, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def getAuthenticatorTypes(self) -> java.chaquopy.JavaArray[AuthenticatorDescription]: ...
    def getPackagesAndVisibilityForAccount(self, account: Account, /) -> java.util.Map[java.lang.String, java.lang.Integer]: ...
    def getPassword(self, account: Account, /) -> str | None: ...
    def getPreviousName(self, account: Account, /) -> str | None: ...
    def getUserData(self, account: Account, key: str | java.lang.String, /) -> str | None: ...
    def hasFeatures(self, account: Account, features: java.chaquopy.JavaArray[java.lang.String], callback: AccountManagerCallback[java.lang.Boolean], handler: android.os.Handler, /) -> AccountManagerFuture[java.lang.Boolean]: ...
    def invalidateAuthToken(self, accountType: str | java.lang.String, authToken: str | java.lang.String, /) -> None: ...
    def isCredentialsUpdateSuggested(self, account: Account, statusToken: str | java.lang.String, callback: AccountManagerCallback[java.lang.Boolean], handler: android.os.Handler, /) -> AccountManagerFuture[java.lang.Boolean]: ...
    @typing.overload
    @staticmethod
    def newChooseAccountIntent(selectedAccount: Account, allowableAccounts: java.util.List[Account], allowableAccountTypes: java.chaquopy.JavaArray[java.lang.String], descriptionOverrideText: str | java.lang.String, addAccountAuthTokenType: str | java.lang.String, addAccountRequiredFeatures: java.chaquopy.JavaArray[java.lang.String], addAccountOptions: android.os.Bundle, /) -> android.content.Intent: ...
    @typing.overload
    @staticmethod
    def newChooseAccountIntent(selectedAccount: Account, allowableAccounts: java.util.ArrayList[Account], allowableAccountTypes: java.chaquopy.JavaArray[java.lang.String], alwaysPromptForAccount: bool | java.jboolean | java.lang.Boolean, descriptionOverrideText: str | java.lang.String, addAccountAuthTokenType: str | java.lang.String, addAccountRequiredFeatures: java.chaquopy.JavaArray[java.lang.String], addAccountOptions: android.os.Bundle, /) -> android.content.Intent: ...
    def notifyAccountAuthenticated(self, account: Account, /) -> bool: ...
    def peekAuthToken(self, account: Account, authTokenType: str | java.lang.String, /) -> str | None: ...
    @typing.overload
    def removeAccount(self, account: Account, callback: AccountManagerCallback[java.lang.Boolean], handler: android.os.Handler, /) -> AccountManagerFuture[java.lang.Boolean]: ...
    @typing.overload
    def removeAccount(self, account: Account, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def removeAccountExplicitly(self, account: Account, /) -> bool: ...
    def removeOnAccountsUpdatedListener(self, listener: OnAccountsUpdateListener, /) -> None: ...
    def renameAccount(self, account: Account, newName: str | java.lang.String, callback: AccountManagerCallback[Account], handler: android.os.Handler, /) -> AccountManagerFuture[Account]: ...
    def setAccountVisibility(self, account: Account, packageName: str | java.lang.String, visibility: int | java.jint | java.lang.Integer, /) -> bool: ...
    def setAuthToken(self, account: Account, authTokenType: str | java.lang.String, authToken: str | java.lang.String, /) -> None: ...
    def setPassword(self, account: Account, password: str | java.lang.String, /) -> None: ...
    def setUserData(self, account: Account, key: str | java.lang.String, value: str | java.lang.String, /) -> None: ...
    def startAddAccountSession(self, accountType: str | java.lang.String, authTokenType: str | java.lang.String, requiredFeatures: java.chaquopy.JavaArray[java.lang.String], options: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def startUpdateCredentialsSession(self, account: Account, authTokenType: str | java.lang.String, options: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...
    def updateCredentials(self, account: Account, authTokenType: str | java.lang.String, options: android.os.Bundle, activity: android.app.Activity, callback: AccountManagerCallback[android.os.Bundle], handler: android.os.Handler, /) -> AccountManagerFuture[android.os.Bundle]: ...

_AccountManagerCallback__V = typing.TypeVar('_AccountManagerCallback__V')  # <V>
class AccountManagerCallback(java.lang.Object, typing.Generic[_AccountManagerCallback__V]):
    def run(self, arg1: AccountManagerFuture[_AccountManagerCallback__V], /) -> None: ...

_AccountManagerFuture__V = typing.TypeVar('_AccountManagerFuture__V')  # <V>
class AccountManagerFuture(java.lang.Object, typing.Generic[_AccountManagerFuture__V]):
    def cancel(self, arg1: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    @typing.overload
    def getResult(self) -> _AccountManagerFuture__V: ...
    @typing.overload
    def getResult(self, arg1: int | java.jlong | java.lang.Long, arg2: java.util.concurrent.TimeUnit, /) -> _AccountManagerFuture__V: ...
    def isCancelled(self) -> bool: ...
    def isDone(self) -> bool: ...

class AccountsException(java.lang.Exception):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class AuthenticatorDescription(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[AuthenticatorDescription]] = ...
    accountPreferencesId: int = ...
    customTokens: bool = ...
    iconId: int = ...
    labelId: int = ...
    packageName: str = ...
    smallIconId: int = ...
    type: str = ...
    @typing.overload
    def __init__(self, type: str | java.lang.String, packageName: str | java.lang.String, labelId: int | java.jint | java.lang.Integer, iconId: int | java.jint | java.lang.Integer, smallIconId: int | java.jint | java.lang.Integer, prefId: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def __init__(self, type: str | java.lang.String, packageName: str | java.lang.String, labelId: int | java.jint | java.lang.Integer, iconId: int | java.jint | java.lang.Integer, smallIconId: int | java.jint | java.lang.Integer, prefId: int | java.jint | java.lang.Integer, customTokens: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...
    @staticmethod
    def newKey(type: str | java.lang.String, /) -> AuthenticatorDescription: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class AuthenticatorException(AccountsException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class NetworkErrorException(AccountsException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class OnAccountsUpdateListener(java.lang.Object):
    def onAccountsUpdated(self, arg1: java.chaquopy.JavaArray[Account], /) -> None: ...

class OperationCanceledException(AccountsException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...
