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

# MediaDrm.OnSessionLostStateListener

*** ** * ** ***

` public static interface MediaDrm.OnSessionLostStateListener `   
` `

|---|
| android.media.MediaDrm.OnSessionLostStateListener |

<br />

*** ** * ** ***

Interface definition for a callback to be invoked when the session state has been lost and is now invalid

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/media/MediaDrm.OnSessionLostStateListener#onSessionLostState(android.media.MediaDrm,%20byte[])(https://developer.android.com/reference/android/media/MediaDrm md, byte[] sessionId) ` Called when session state has lost state, to inform the app about the condition so it can close the session and open a new one to resume operation. |

## Public methods

### onSessionLostState

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

```
public abstract void onSessionLostState (MediaDrm md, 
                byte[] sessionId)
```

Called when session state has lost state, to inform the app about the condition so it can close the session and open a new one to resume operation.

<br />

| Parameters ||
|---|---|
| `md` | `MediaDrm`: the MediaDrm object on which the event occurred. This value cannot be `null`. <br /> |
| `sessionId` | `byte`: the DRM session ID on which the event occurred. This value cannot be `null`. <br /> |