MediaSession.ControllerInfo


class MediaSession.ControllerInfo


Information of a MediaController or a MediaBrowser.

Summary

Constants

const Int

The getInterfaceVersion interface version} of a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat.

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

The getPackageName of a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat if a more precise package cannot be obtained.

const Int

The controller version of a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat.

Public functions

java-static MediaSession.ControllerInfo!
@VisibleForTesting(otherwise = 2)
createTestOnlyControllerInfo(
    packageName: String!,
    pid: Int,
    uid: Int,
    libraryVersion: Int,
    interfaceVersion: Int,
    trusted: Boolean,
    connectionHints: Bundle!,
    isPackageNameVerified: Boolean
)

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 a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat.

LEGACY_CONTROLLER_PACKAGE_NAME

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

The getPackageName of a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat if a more precise package cannot be obtained.

LEGACY_CONTROLLER_VERSION

const val LEGACY_CONTROLLER_VERSION = 0: Int

The controller version of a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat.

Public functions

createTestOnlyControllerInfo

@VisibleForTesting(otherwise = 2)
java-static fun createTestOnlyControllerInfo(
    packageName: String!,
    pid: Int,
    uid: Int,
    libraryVersion: Int,
    interfaceVersion: Int,
    trusted: Boolean,
    connectionHints: Bundle!,
    isPackageNameVerified: Boolean
): 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 LEGACY_CONTROLLER_VERSION if the controller is a platform android.media.session.MediaController or legacy android.support.v4.media.session.MediaControllerCompat.

getPackageName

fun getPackageName(): String!

Returns the package name, or LEGACY_CONTROLLER_PACKAGE_NAME on API ≤ 24.

In some cases the correctness of the package name cannot be verified, for example when a controller from another app connects directly with a SessionToken and the app's package is not visible from this app. Refer to the package visibility guidelines for more details and how to ensure specific packages are visible if required.

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

isPackageNameVerified

val isPackageNameVerifiedBoolean

isTrusted

val isTrustedBoolean

maxCommandsForMediaItems

val maxCommandsForMediaItemsInt