Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

MediaSession.ControllerInfo

public static final class MediaSession.ControllerInfo
extends Object

java.lang.Object
   ↳ androidx.media2.session.MediaSession.ControllerInfo


Information of a controller.

Summary

Public methods

boolean equals(Object obj)
Bundle getConnectionHints()

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

String getPackageName()

Gets the package name.

int getUid()

Gets the UID of the controller.

int hashCode()
String toString()

Inherited methods

Public methods

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

getConnectionHints

public Bundle getConnectionHints ()

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

Returns
Bundle

getPackageName

public String getPackageName ()

Gets the package name. Can be MediaSessionManager.RemoteUserInfo.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 ControllerInfo#getPackageName() for legacy controller
SDK_VERSION < 21 Actual package name via PackageManager.getNameForUid(int) 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
String package name of the controller. Can be LEGACY_CONTROLLER if the package name cannot be obtained.

getUid

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

Returns
int

toString

public String toString ()

Returns
String