# MediaSessionManager.RemoteUserInfo

Artifact: [androidx.media:media](https://developer.android.com/jetpack/androidx/releases/media) [View Source](https://cs.android.com/search?q=file:androidx/media/MediaSessionManager.java+class:androidx.media.MediaSessionManager.RemoteUserInfo) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

*** ** * ** ***


```
class MediaSessionManager.RemoteUserInfo
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> androidx.media is deprecated. Please migrate to [androidx.media3](https://developer.android.com/media/media3).

Information of a remote user of `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat` or `https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat`. This can be used to decide whether the remote user is trusted app, and also differentiate caller of `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat` and `https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat` callbacks.

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager#isTrustedForMediaControl(androidx.media.MediaSessionManager.RemoteUserInfo)` |   |

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#LEGACY_CONTROLLER() = "android.media.session.MediaController"` **This property is deprecated.** Deprecated in Java |

| ### Public constructors |
|---|
| `[RemoteUserInfo](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#RemoteUserInfo(java.lang.String,int,int))(packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[equals](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#equals(java.lang.Object))(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `[getPackageName](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getPackageName())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getPid](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getPid())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getUid](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getUid())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[hashCode](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#hashCode())()` **This function is deprecated.** Deprecated in Java |

## Constants

### LEGACY_CONTROLLER

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
const val LEGACY_CONTROLLER = "android.media.session.MediaController": String!
```

> [!CAUTION]
> **This property is deprecated.**   
> Deprecated in Java

Used by `https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getPackageName()` when the session is connected to the legacy controller whose exact package name cannot be obtained.

## Public constructors

### RemoteUserInfo

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
[RemoteUserInfo](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#RemoteUserInfo(java.lang.String,int,int))(packageName: String, pid: Int, uid: Int)
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Public constructor.

Can be used for `https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager#isTrustedForMediaControl(androidx.media.MediaSessionManager.RemoteUserInfo)`}.

| Parameters |
|---|---|
| `packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | package name of the remote user |
| `pid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | pid of the remote user |
| `uid: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | uid of the remote user |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if package name is empty |

## Public functions

### equals

```
fun [equals](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#equals(java.lang.Object))(obj: Any?): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns equality of two RemoteUserInfo by comparing their package name, UID, and PID.

On P and before (API \<= 28), two RemoteUserInfo objects equal if following conditions are met:

1. UID and package name are the same
2. One of the RemoteUserInfo's PID is UNKNOWN_PID or both of RemoteUserInfo's PID are the same

| Parameters |
|---|---|
| `obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | the reference object with which to compare. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if equals, `false` otherwise |

### getPackageName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getPackageName](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getPackageName())(): String
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | package name of the controller. Can be `https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#LEGACY_CONTROLLER()` if the package name cannot be obtained. |

### getPid

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getPid](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getPid())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | pid of the controller. Can be a negative value if the pid cannot be obtained. |

### getUid

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
fun [getUid](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#getUid())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | uid of the controller. Can be a negative value if the uid cannot be obtained. |

### hashCode

```
fun [hashCode](https://developer.android.com/reference/kotlin/androidx/media/MediaSessionManager.RemoteUserInfo#hashCode())(): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java