Added in API level 31

IkeSessionCallback

interface IkeSessionCallback
android.net.ipsec.ike.IkeSessionCallback

Callback interface for receiving state changes of an IkeSession.

IkeSessionCallback MUST be unique to each IkeSession. It is registered when callers are requesting a new IkeSession. It is automatically unregistered when an IkeSession is closed.

Summary

Public methods
abstract Unit

Called when the IkeSession is closed.

open Unit

Called if IkeSession setup failed or IkeSession is closed because of a fatal error.

open Unit
onError(exception: IkeException)

Called if a recoverable error is encountered in an established IkeSession.

abstract Unit
onOpened(sessionConfiguration: IkeSessionConfiguration)

Called when the IkeSession setup succeeds.

Public methods

onClosed

Added in API level 31
abstract fun onClosed(): Unit

Called when the IkeSession is closed.

When the closure is caused by a local, fatal error, onClosedWithException(android.net.ipsec.ike.exceptions.IkeException) will be fired instead of this method.

onClosedWithException

Added in API level 31
open fun onClosedWithException(exception: IkeException): Unit

Called if IkeSession setup failed or IkeSession is closed because of a fatal error.

Parameters
exception IkeException: the detailed error information. This value cannot be null.

onError

Added in API level 31
open fun onError(exception: IkeException): Unit

Called if a recoverable error is encountered in an established IkeSession.

This method may be triggered by protocol errors such as an INVALID_IKE_SPI, or by non-protocol errors such as the underlying android.net.Network dying.

Parameters
exception IkeException: the detailed error information. This value cannot be null.

onOpened

Added in API level 31
abstract fun onOpened(sessionConfiguration: IkeSessionConfiguration): Unit

Called when the IkeSession setup succeeds.

This method does not indicate the first Child Session has been setup. Caller MUST refer to the corresponding ChildSessionCallback for the Child Session setup result.

Parameters
sessionConfiguration IkeSessionConfiguration: the configuration information of IkeSession negotiated during IKE setup. This value cannot be null.