MediaSession.ControllerInfo


class MediaSession.ControllerInfo


Information of a MediaController or a MediaBrowser.

Summary

Constants

const Int

The getInterfaceVersion interface version} of legacy controllers.

const Int

The controller version of legacy controllers.

Public functions

java-static MediaSession.ControllerInfo!
@VisibleForTesting(otherwise = 2)
createTestOnlyControllerInfo(
    remoteUserInfo: MediaSessionManager.RemoteUserInfo!,
    libraryVersion: Int,
    interfaceVersion: Int,
    trusted: Boolean,
    connectionHints: Bundle!
)

Returns a ControllerInfo suitable for use when testing client code.

Boolean
equals(obj: Any?)
Int

Returns the library version of the controller.

String!

Returns the package name.

Int

Returns the UID of the controller.

Int
String!

Constants

LEGACY_CONTROLLER_INTERFACE_VERSION

@UnstableApi
const val LEGACY_CONTROLLER_INTERFACE_VERSION = 0: Int

The getInterfaceVersion interface version} of legacy controllers.

LEGACY_CONTROLLER_VERSION

const val LEGACY_CONTROLLER_VERSION = 0: Int

The controller version of legacy controllers.

Public functions

createTestOnlyControllerInfo

@VisibleForTesting(otherwise = 2)
java-static fun createTestOnlyControllerInfo(
    remoteUserInfo: MediaSessionManager.RemoteUserInfo!,
    libraryVersion: Int,
    interfaceVersion: Int,
    trusted: Boolean,
    connectionHints: Bundle!
): MediaSession.ControllerInfo!

Returns a ControllerInfo suitable for use when testing client code.

equals

fun equals(obj: Any?): Boolean

getControllerVersion

fun getControllerVersion(): Int

Returns the library version of the controller.

It will be the same as VERSION_INT of the controller, or less than 1000000 if the controller is a legacy controller.

getPackageName

fun getPackageName(): String!

Returns the package name. Can be LEGACY_CONTROLLER for interoperability.

Interoperability: Package name may not be precisely obtained for legacy controller API on older device. Here are details.

Summary when package name isn't precise
SDK version when package name isn't precise for legacy controller
SDK_INT < 21 Actual package name via getNameForUid with UID. It's sufficient for most cases, but doesn't precisely distinguish caller if it uses shared user ID.
21 <= SDK_INT < 24 LEGACY_CONTROLLER

getUid

fun getUid(): Int

Returns the UID of the controller. Can be a negative value for interoperability.

Interoperability: If 21 <= SDK_INT < 28, then UID would be a negative value because it cannot be obtained.

hashCode

fun hashCode(): Int

toString

fun toString(): String!

Public properties

connectionHints

val connectionHintsBundle!

interfaceVersion

val interfaceVersionInt

isTrusted

val isTrustedBoolean