MediaSession.ControllerInfo

Added in 1.0.0
Deprecated in 1.3.0

public final class MediaSession.ControllerInfo


Information of a controller.

Summary

Public methods

boolean
@NonNull Bundle

Gets the connection hints sent from controller, or EMPTY if none.

@NonNull String

Gets the package name.

int

Gets the UID of the controller.

int
String

Public methods

equals

public boolean equals(Object obj)

getConnectionHints

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull Bundle getConnectionHints()

Gets the connection hints sent from controller, or EMPTY if none.

getPackageName

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull String getPackageName()

Gets 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.

SDK version when package name isn't precise for legacy controller
SDK_VERSION<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.
21SDK_VERSION<24 LEGACY_CONTROLLER
Returns
@NonNull String

package name of the controller. Can be LEGACY_CONTROLLER if the package name cannot be obtained.

getUid

Added in 1.0.0
Deprecated in 1.3.0
public int getUid()

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

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

Returns
int

uid of the controller. Can be a negative value if the uid cannot be obtained.

hashCode

public int hashCode()

toString

public String toString()