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

# OnExpirationUpdateListener

*** ** * ** ***

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

```
interface OnExpirationUpdateListener
```

|---|
| [android.media.MediaDrm.OnExpirationUpdateListener](https://developer.android.com/reference/kotlin/android/media/MediaDrm.OnExpirationUpdateListener#) |

Interface definition for a callback to be invoked when a drm session expiration update occurs

## Summary

| Public methods ||
|---|---|
| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaDrm.OnExpirationUpdateListener#onExpirationUpdate(android.media.MediaDrm,%20kotlin.ByteArray,%20kotlin.Long)(md: https://developer.android.com/reference/kotlin/android/media/MediaDrm, sessionId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html, expirationTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Called when a session expiration update occurs, to inform the app about the change in expiration time |

## Public methods

### onExpirationUpdate

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

```
abstract fun onExpirationUpdate(
    md: MediaDrm, 
    sessionId: ByteArray, 
    expirationTime: Long
): Unit
```

Called when a session expiration update occurs, to inform the app about the change in expiration time

| Parameters ||
|---|---|
| `md` | [MediaDrm](https://developer.android.com/reference/kotlin/android/media/MediaDrm): the MediaDrm object on which the event occurred. This value cannot be `null`. |
| `sessionId` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html): the DRM session ID on which the event occurred. This value cannot be `null`. |
| `expirationTime` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the new expiration time for the keys in the session. The time is in milliseconds, relative to the Unix epoch. A time of 0 indicates that the keys never expire. |