import typing

import android.app
import android.content
import android.net
import android.os
import java
import java.io
import java.lang
import java.util
import java.util.concurrent

class OnObbStateChangeListener(java.lang.Object):
    ERROR_ALREADY_MOUNTED: typing.ClassVar[int] = ...
    ERROR_COULD_NOT_MOUNT: typing.ClassVar[int] = ...
    ERROR_COULD_NOT_UNMOUNT: typing.ClassVar[int] = ...
    ERROR_INTERNAL: typing.ClassVar[int] = ...
    ERROR_NOT_MOUNTED: typing.ClassVar[int] = ...
    ERROR_PERMISSION_DENIED: typing.ClassVar[int] = ...
    MOUNTED: typing.ClassVar[int] = ...
    UNMOUNTED: typing.ClassVar[int] = ...
    def __init__(self) -> None: ...
    def onObbStateChange(self, path: str | java.lang.String, state: int | java.jint | java.lang.Integer, /) -> None: ...

class StorageManager(java.lang.Object):
    ACTION_CLEAR_APP_CACHE: typing.ClassVar[str] = ...
    ACTION_MANAGE_STORAGE: typing.ClassVar[str] = ...
    EXTRA_REQUESTED_BYTES: typing.ClassVar[str] = ...
    EXTRA_UUID: typing.ClassVar[str] = ...
    UUID_DEFAULT: typing.ClassVar[java.util.UUID] = ...
    @typing.overload
    def allocateBytes(self, fd: java.io.FileDescriptor, bytes: int | java.jlong | java.lang.Long, /) -> None: ...
    @typing.overload
    def allocateBytes(self, storageUuid: java.util.UUID, bytes: int | java.jlong | java.lang.Long, /) -> None: ...
    def getAllocatableBytes(self, storageUuid: java.util.UUID, /) -> int: ...
    def getCacheQuotaBytes(self, storageUuid: java.util.UUID, /) -> int: ...
    def getCacheSizeBytes(self, storageUuid: java.util.UUID, /) -> int: ...
    def getManageSpaceActivityIntent(self, packageName: str | java.lang.String, requestCode: int | java.jint | java.lang.Integer, /) -> android.app.PendingIntent | None: ...
    def getMountedObbPath(self, rawPath: str | java.lang.String, /) -> str: ...
    def getPrimaryStorageVolume(self) -> StorageVolume: ...
    def getRecentStorageVolumes(self) -> java.util.List[StorageVolume]: ...
    @typing.overload
    def getStorageVolume(self, uri: android.net.Uri, /) -> StorageVolume | None: ...
    @typing.overload
    def getStorageVolume(self, file: java.io.File, /) -> StorageVolume | None: ...
    def getStorageVolumes(self) -> java.util.List[StorageVolume]: ...
    def getStorageVolumesIncludingSharedProfiles(self) -> java.util.List[StorageVolume]: ...
    def getUuidForPath(self, path: java.io.File, /) -> java.util.UUID: ...
    def isAllocationSupported(self, fd: java.io.FileDescriptor, /) -> bool: ...
    def isCacheBehaviorGroup(self, path: java.io.File, /) -> bool: ...
    def isCacheBehaviorTombstone(self, path: java.io.File, /) -> bool: ...
    def isCheckpointSupported(self) -> bool: ...
    def isEncrypted(self, file: java.io.File, /) -> bool: ...
    def isObbMounted(self, rawPath: str | java.lang.String, /) -> bool: ...
    def mountObb(self, rawPath: str | java.lang.String, key: str | java.lang.String, listener: OnObbStateChangeListener, /) -> bool: ...
    def openProxyFileDescriptor(self, mode: int | java.jint | java.lang.Integer, callback: android.os.ProxyFileDescriptorCallback, handler: android.os.Handler, /) -> android.os.ParcelFileDescriptor: ...
    def registerStorageVolumeCallback(self, executor: java.util.concurrent.Executor, callback: StorageManager.StorageVolumeCallback, /) -> None: ...
    def setCacheBehaviorGroup(self, path: java.io.File, group: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def setCacheBehaviorTombstone(self, path: java.io.File, tombstone: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def unmountObb(self, rawPath: str | java.lang.String, force: bool | java.jboolean | java.lang.Boolean, listener: OnObbStateChangeListener, /) -> bool: ...
    def unregisterStorageVolumeCallback(self, callback: StorageManager.StorageVolumeCallback, /) -> None: ...

    class StorageVolumeCallback(java.lang.Object):
        def __init__(self) -> None: ...
        def onStateChanged(self, volume: StorageVolume, /) -> None: ...

class StorageVolume(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[StorageVolume]] = ...
    EXTRA_STORAGE_VOLUME: typing.ClassVar[str] = ...
    def createAccessIntent(self, directoryName: str | java.lang.String, /) -> android.content.Intent | None: ...
    def createOpenDocumentTreeIntent(self) -> android.content.Intent: ...
    def describeContents(self) -> int: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getDescription(self, context: android.content.Context, /) -> str: ...
    def getDirectory(self) -> java.io.File | None: ...
    def getMediaStoreVolumeName(self) -> str | None: ...
    def getOwner(self) -> android.os.UserHandle: ...
    def getState(self) -> str: ...
    def getStorageUuid(self) -> java.util.UUID | None: ...
    def getUuid(self) -> str | None: ...
    def hashCode(self) -> int: ...
    def isEmulated(self) -> bool: ...
    def isPrimary(self) -> bool: ...
    def isRemovable(self) -> bool: ...
    def toString(self) -> str: ...
    def writeToParcel(self, parcel: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...
