Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/drm/DrmRights#pubctors) \| [Methods](https://developer.android.com/reference/android/drm/DrmRights#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/drm/DrmRights#inhmethods)

# DrmRights

*** ** * ** ***

` public class DrmRights `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.drm.DrmRights |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 30.**   

Please use `https://developer.android.com/reference/android/media/MediaDrm`

An entity class that wraps the license information retrieved from the online DRM server.

A caller can instantiate a `https://developer.android.com/reference/android/drm/DrmRights` object by first invoking the `https://developer.android.com/reference/android/drm/DrmManagerClient#processDrmInfo(android.drm.DrmInfo)` method and then using the resulting `https://developer.android.com/reference/android/drm/ProcessedData` object to invoke the `https://developer.android.com/reference/android/drm/DrmRights#DrmRights(android.drm.ProcessedData,%20java.lang.String)` constructor.

A caller can also instantiate a `https://developer.android.com/reference/android/drm/DrmRights` object by using the `https://developer.android.com/reference/android/drm/DrmRights#DrmRights(java.lang.String,%20java.lang.String)` constructor, which takes a path to a file containing rights information instead of a `ProcessedData`.

Please note that the account id and subscription id is not mandatory by all DRM agents or plugins. When account id or subscription id is not required by the specific DRM agent or plugin, they can be either null, or an empty string, or any other don't-care string value.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/drm/DrmRights#DrmRights(android.drm.ProcessedData,%20java.lang.String)(https://developer.android.com/reference/android/drm/ProcessedData data, https://developer.android.com/reference/java/lang/String mimeType) ` Creates a `DrmRights` object with the given parameters. |
| ` https://developer.android.com/reference/android/drm/DrmRights#DrmRights(java.io.File,%20java.lang.String)(https://developer.android.com/reference/java/io/File rightsFile, https://developer.android.com/reference/java/lang/String mimeType) ` Creates a `DrmRights` object with the given parameters. |
| ` https://developer.android.com/reference/android/drm/DrmRights#DrmRights(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String rightsFilePath, https://developer.android.com/reference/java/lang/String mimeType) ` Creates a `DrmRights` object with the given parameters. |
| ` https://developer.android.com/reference/android/drm/DrmRights#DrmRights(java.lang.String,%20java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String rightsFilePath, https://developer.android.com/reference/java/lang/String mimeType, https://developer.android.com/reference/java/lang/String accountId) ` Creates a `DrmRights` object with the given parameters. |
| ` https://developer.android.com/reference/android/drm/DrmRights#DrmRights(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String rightsFilePath, https://developer.android.com/reference/java/lang/String mimeType, https://developer.android.com/reference/java/lang/String accountId, https://developer.android.com/reference/java/lang/String subscriptionId) ` Creates a `DrmRights` object with the given parameters. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/drm/DrmRights#getAccountId()() ` Retrieves the account ID associated with this `DrmRights` object. |
| ` byte[]` | ` https://developer.android.com/reference/android/drm/DrmRights#getData()() ` Retrieves the rights data associated with this `DrmRights` object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/drm/DrmRights#getMimeType()() ` Retrieves the MIME type associated with this `DrmRights` object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/drm/DrmRights#getSubscriptionId()() ` Retrieves the subscription ID associated with this `DrmRights` object. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### DrmRights

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

```
public DrmRights (ProcessedData data, 
                String mimeType)
```

Creates a `DrmRights` object with the given parameters.

<br />

| Parameters ||
|---|---|
| `data` | `ProcessedData`: A `https://developer.android.com/reference/android/drm/ProcessedData` object containing rights information. Must not be null. <br /> |
| `mimeType` | `String`: The MIME type. It must not be null or an empty string. <br /> |

### DrmRights

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

```
public DrmRights (File rightsFile, 
                String mimeType)
```

Creates a `DrmRights` object with the given parameters.

<br />

| Parameters ||
|---|---|
| `rightsFile` | `File`: File containing rights information. <br /> |
| `mimeType` | `String`: MIME type. Must not be null or an empty string. <br /> |

### DrmRights

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

```
public DrmRights (String rightsFilePath, 
                String mimeType)
```

Creates a `DrmRights` object with the given parameters.

<br />

| Parameters ||
|---|---|
| `rightsFilePath` | `String`: Path to the file containing rights information. <br /> |
| `mimeType` | `String`: MIME type. Must not be null or an empty string. <br /> |

### DrmRights

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

```
public DrmRights (String rightsFilePath, 
                String mimeType, 
                String accountId)
```

Creates a `DrmRights` object with the given parameters.

<br />

| Parameters ||
|---|---|
| `rightsFilePath` | `String`: Path to the file containing rights information. <br /> |
| `mimeType` | `String`: MIME type. Must not be null or an empty string. <br /> |
| `accountId` | `String`: Account ID of the user. <br /> |

### DrmRights

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

```
public DrmRights (String rightsFilePath, 
                String mimeType, 
                String accountId, 
                String subscriptionId)
```

Creates a `DrmRights` object with the given parameters.

<br />

| Parameters ||
|---|---|
| `rightsFilePath` | `String`: Path to the file containing rights information. <br /> |
| `mimeType` | `String`: MIME type. Must not be null or an empty string. <br /> |
| `accountId` | `String`: Account ID of the user. <br /> |
| `subscriptionId` | `String`: Subscription ID of the user. <br /> |

## Public methods

### getAccountId

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

```
public String getAccountId ()
```

Retrieves the account ID associated with this `DrmRights` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The account ID. <br /> |

### getData

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

```
public byte[] getData ()
```

Retrieves the rights data associated with this `DrmRights` object.

<br />

| Returns ||
|---|---|
| `byte[]` | A `byte` array representing the rights data. <br /> |

### getMimeType

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

```
public String getMimeType ()
```

Retrieves the MIME type associated with this `DrmRights` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The MIME type. <br /> |

### getSubscriptionId

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

```
public String getSubscriptionId ()
```

Retrieves the subscription ID associated with this `DrmRights` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The subscription ID. <br /> |