Stay organized with collections
Save and categorize content based on your preferences.
RemoteUserInfo
class RemoteUserInfo
Information of a remote user of MediaSession
or MediaBrowserService
. This can be used to decide whether the remote user is trusted app, and also differentiate caller of MediaSession
and MediaBrowserService
callbacks.
See equals(java.lang.Object)
to take a look at how it differentiate media controller.
Summary
Public constructors |
Create a new remote user information.
|
Public constructors
RemoteUserInfo
RemoteUserInfo(
packageName: String,
pid: Int,
uid: Int)
Create a new remote user information.
Parameters |
packageName |
String: The package name of the remote user This value cannot be null . |
pid |
Int: The pid of the remote user |
uid |
Int: The uid of the remote user |
Public methods
equals
fun equals(other: Any?): Boolean
Returns equality of two RemoteUserInfo. Two RemoteUserInfo objects are equal if and only if they have the same package name, same pid, and same uid.
Parameters |
obj |
the reference object with which to compare. This value may be null . |
Return |
Boolean |
true if equals, false otherwise |
getPackageName
fun getPackageName(): String!
Return |
String! |
package name of the controller |
getPid
fun getPid(): Int
Return |
Int |
pid of the controller |
getUid
fun getUid(): Int
Return |
Int |
uid of the controller |
hashCode
fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaSessionManager.RemoteUserInfo\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRemoteUserInfo\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/session/MediaSessionManager.RemoteUserInfo \"View this page in Java\") \n\n```\nclass RemoteUserInfo\n```\n\n|---|---------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.session.MediaSessionManager.RemoteUserInfo](#) |\n\nInformation of a remote user of [MediaSession](/reference/kotlin/android/media/session/MediaSession) or [MediaBrowserService](../../service/media/MediaBrowserService.html#). This can be used to decide whether the remote user is trusted app, and also differentiate caller of [MediaSession](/reference/kotlin/android/media/session/MediaSession) and [MediaBrowserService](../../service/media/MediaBrowserService.html#) callbacks.\n\nSee [equals(java.lang.Object)](#equals(kotlin.Any)) to take a look at how it differentiate media controller.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [RemoteUserInfo](#RemoteUserInfo(kotlin.String,%20kotlin.Int,%20kotlin.Int))`(`packageName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `pid:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `uid:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Create a new remote user information. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Returns equality of two RemoteUserInfo. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getPackageName](#getPackageName())`()` \u003cbr /\u003e |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getPid](#getPid())`()` \u003cbr /\u003e |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getUid](#getUid())`()` \u003cbr /\u003e |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### RemoteUserInfo\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nRemoteUserInfo(\n packageName: String, \n pid: Int, \n uid: Int)\n```\n\nCreate a new remote user information.\n\n| Parameters ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The package name of the remote user This value cannot be `null`. |\n| `pid` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The pid of the remote user |\n| `uid` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The uid of the remote user |\n\nPublic methods\n--------------\n\n### equals\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun equals(other: Any?): Boolean\n```\n\nReturns equality of two RemoteUserInfo. Two RemoteUserInfo objects are equal if and only if they have the same package name, same pid, and same uid.\n\n| Parameters ||\n|-------|-----------------------------------------------------------------------|\n| `obj` | the reference object with which to compare. This value may be `null`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if equals, `false` otherwise |\n\n### getPackageName\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPackageName(): String!\n```\n\n| Return ||\n|-----------------------------------------------------------------------------------|--------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | package name of the controller |\n\n### getPid\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPid(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | pid of the controller |\n\n### getUid\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getUid(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | uid of the controller |\n\n### hashCode\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hashCode(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |"]]