# MediaSessionManager.RemoteUserInfo

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RemoteUserInfo

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/session/MediaSessionManager.RemoteUserInfo "View this page in Java")  

```
class RemoteUserInfo
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                       ||
| ↳ | [android.media.session.MediaSessionManager.RemoteUserInfo](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#) |

Information of a remote user of[MediaSession](https://developer.android.com/reference/kotlin/android/media/session/MediaSession)or[MediaBrowserService](https://developer.android.com/reference/kotlin/android/service/media/MediaBrowserService.html#). This can be used to decide whether the remote user is trusted app, and also differentiate caller of[MediaSession](https://developer.android.com/reference/kotlin/android/media/session/MediaSession)and[MediaBrowserService](https://developer.android.com/reference/kotlin/android/service/media/MediaBrowserService.html#)callbacks.

See[equals(java.lang.Object)](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#equals(kotlin.Any))to take a look at how it differentiate media controller.

## Summary

|                                                                                                                                                                                                                                             Public constructors                                                                                                                                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [RemoteUserInfo](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.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. |

|                                                                                                                                                                       Public methods                                                                                                                                                                       ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Returns equality of two RemoteUserInfo. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!  | [getPackageName](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#getPackageName())`()` <br />                                                                                                                  |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getPid](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#getPid())`()` <br />                                                                                                                                  |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getUid](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#getUid())`()` <br />                                                                                                                                  |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [hashCode](https://developer.android.com/reference/kotlin/android/media/session/MediaSessionManager.RemoteUserInfo#hashCode())`()` <br />                                                                                                                              |

## Public constructors

### RemoteUserInfo

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
RemoteUserInfo(
    packageName: String, 
    pid: Int, 
    uid: Int)
```

Create a new remote user information.

|                                                                           Parameters                                                                            ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `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`. |
| `pid`         | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The pid of the remote user                                            |
| `uid`         | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The uid of the remote user                                            |

## Public methods

### equals

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if equals,`false`otherwise |

### getPackageName

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getPackageName(): String!
```

|                                                      Return                                                       ||
|-----------------------------------------------------------------------------------|--------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | package name of the controller |

### getPid

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getPid(): Int
```

|                                              Return                                               ||
|----------------------------------------------------------------------------|-----------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | pid of the controller |

### getUid

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getUid(): Int
```

|                                              Return                                               ||
|----------------------------------------------------------------------------|-----------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | uid of the controller |

### hashCode

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hashCode(): Int
```

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |