import typing

import android.content
import android.media
import android.media.session
import android.os
import java
import java.lang
import java.util

class MediaBrowser(java.lang.Object):
    EXTRA_PAGE: typing.ClassVar[str] = ...
    EXTRA_PAGE_SIZE: typing.ClassVar[str] = ...
    def __init__(self, context: android.content.Context, serviceComponent: android.content.ComponentName, callback: MediaBrowser.ConnectionCallback, rootHints: android.os.Bundle, /) -> None: ...
    def connect(self) -> None: ...
    def disconnect(self) -> None: ...
    def getExtras(self) -> android.os.Bundle | None: ...
    def getItem(self, mediaId: str | java.lang.String, cb: MediaBrowser.ItemCallback, /) -> None: ...
    def getRoot(self) -> str: ...
    def getServiceComponent(self) -> android.content.ComponentName: ...
    def getSessionToken(self) -> android.media.session.MediaSession.Token: ...
    def isConnected(self) -> bool: ...
    @typing.overload
    def subscribe(self, parentId: str | java.lang.String, callback: MediaBrowser.SubscriptionCallback, /) -> None: ...
    @typing.overload
    def subscribe(self, parentId: str | java.lang.String, options: android.os.Bundle, callback: MediaBrowser.SubscriptionCallback, /) -> None: ...
    @typing.overload
    def unsubscribe(self, parentId: str | java.lang.String, /) -> None: ...
    @typing.overload
    def unsubscribe(self, parentId: str | java.lang.String, callback: MediaBrowser.SubscriptionCallback, /) -> None: ...

    class SubscriptionCallback(java.lang.Object):
        def __init__(self) -> None: ...
        @typing.overload
        def onChildrenLoaded(self, parentId: str | java.lang.String, children: java.util.List[MediaBrowser.MediaItem], /) -> None: ...
        @typing.overload
        def onChildrenLoaded(self, parentId: str | java.lang.String, children: java.util.List[MediaBrowser.MediaItem], options: android.os.Bundle, /) -> None: ...
        @typing.overload
        def onError(self, parentId: str | java.lang.String, /) -> None: ...
        @typing.overload
        def onError(self, parentId: str | java.lang.String, options: android.os.Bundle, /) -> None: ...

    class MediaItem(android.os.Parcelable):
        CREATOR: typing.ClassVar[android.os.Parcelable.Creator[MediaBrowser.MediaItem]] = ...
        FLAG_BROWSABLE: typing.ClassVar[int] = ...
        FLAG_PLAYABLE: typing.ClassVar[int] = ...
        def __init__(self, description: android.media.MediaDescription, flags: int | java.jint | java.lang.Integer, /) -> None: ...
        def describeContents(self) -> int: ...
        def getDescription(self) -> android.media.MediaDescription: ...
        def getFlags(self) -> int: ...
        def getMediaId(self) -> str: ...
        def isBrowsable(self) -> bool: ...
        def isPlayable(self) -> bool: ...
        def toString(self) -> str: ...
        def writeToParcel(self, out: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class ItemCallback(java.lang.Object):
        def __init__(self) -> None: ...
        def onError(self, mediaId: str | java.lang.String, /) -> None: ...
        def onItemLoaded(self, item: MediaBrowser.MediaItem, /) -> None: ...

    class ConnectionCallback(java.lang.Object):
        def __init__(self) -> None: ...
        def onConnected(self) -> None: ...
        def onConnectionFailed(self) -> None: ...
        def onConnectionSuspended(self) -> None: ...
