ControllerInfo
class ControllerInfo
kotlin.Any | |
↳ | androidx.media2.session.MediaSession.ControllerInfo |
Information of a controller.
Summary
Public methods | |
---|---|
Boolean | |
Bundle |
Gets the connection hints sent from controller, or |
String |
Gets the package name. |
Int |
getUid() Gets the UID of the controller. |
Int |
hashCode() |
String |
toString() |
Public methods
getConnectionHints
@NonNull fun getConnectionHints(): Bundle
Gets the connection hints sent from controller, or Bundle#EMPTY
if none.
getPackageName
@NonNull fun getPackageName(): String
Gets the package name. Can be androidx.media.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 with UID.It's sufficient for most cases, but doesn't precisely distinguish caller if it uses shared user ID. |
21 ≤ SDK_VERSION < 24 |
LEGACY_CONTROLLER |
Return | |
---|---|
String |
package name of the controller. Can be LEGACY_CONTROLLER if the package name cannot be obtained. |
getUid
fun getUid(): Int
Gets the UID of the controller. Can be a negative value for interoperability.
Interoperability: If 21
≤ SDK_VERSION
< 28
, then UID would be a negative value because it cannot be obtained.
Return | |
---|---|
Int |
uid of the controller. Can be a negative value if the uid cannot be obtained. |
hashCode
fun hashCode(): Int
toString
fun toString(): String