MediaSession.ControllerInfo


class MediaSession.ControllerInfo


Information of a MediaController or a MediaBrowser.

Summary

Constants

const Int

The getInterfaceVersion interface version} of legacy controllers.

const String!
LEGACY_CONTROLLER_PACKAGE_NAME = "android.media.session.MediaController"

The getPackageName of legacy controllers if a more precise package cannot be obtained.

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!
)

This function is deprecated.

Use createTestOnlyControllerInfo instead.

java-static MediaSession.ControllerInfo!
@VisibleForTesting(otherwise = 2)
createTestOnlyControllerInfo(
    packageName: String!,
    pid: Int,
    uid: Int,
    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, or LEGACY_CONTROLLER_PACKAGE_NAME on API ≤ 24.

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_PACKAGE_NAME

const val LEGACY_CONTROLLER_PACKAGE_NAME = "android.media.session.MediaController": String!

The getPackageName of legacy controllers if a more precise package cannot be obtained.

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!

createTestOnlyControllerInfo

@VisibleForTesting(otherwise = 2)
java-static fun createTestOnlyControllerInfo(
    packageName: String!,
    pid: Int,
    uid: Int,
    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, or LEGACY_CONTROLLER_PACKAGE_NAME on API ≤ 24.

getUid

fun getUid(): Int

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

Interoperability: If 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