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

# VcnStatusCallback

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/net/vcn/VcnManager.VcnStatusCallback "View this page in Java")

```
abstract class VcnStatusCallback
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.net.vcn.VcnManager.VcnStatusCallback](https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager.VcnStatusCallback#) |

VcnStatusCallback is the interface for Carrier apps to receive updates for their VCNs.

VcnStatusCallbacks may be registered before `https://developer.android.com/reference/kotlin/android/net/vcn/VcnConfig`s are provided for a subscription group.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager.VcnStatusCallback#VcnStatusCallback()()` <br /> |

| Public methods ||
|---|---|
| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager.VcnStatusCallback#onGatewayConnectionError(kotlin.String,%20kotlin.Int,%20kotlin.Throwable)(gatewayConnectionName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, errorCode: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, detail: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html?)` Invoked when a VCN Gateway Connection corresponding to this callback's subscription group encounters an error. |
| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager.VcnStatusCallback#onStatusChanged(kotlin.Int)(statusCode: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Invoked when status of the VCN for this callback's subscription group changes. |

## Public constructors

### VcnStatusCallback

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

```
VcnStatusCallback()
```

## Public methods

### onGatewayConnectionError

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

```
abstract fun onGatewayConnectionError(
    gatewayConnectionName: String, 
    errorCode: Int, 
    detail: Throwable?
): Unit
```

Invoked when a VCN Gateway Connection corresponding to this callback's subscription group encounters an error.

| Parameters ||
|---|---|
| `gatewayConnectionName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): the String GatewayConnection name for the GatewayConnection encountering an error. This will match the name for exactly one `https://developer.android.com/reference/kotlin/android/net/vcn/VcnGatewayConnectionConfig` for the `https://developer.android.com/reference/kotlin/android/net/vcn/VcnConfig` configured for this callback's subscription group. This value cannot be `null`. |
| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the code to indicate the error that occurred. This value will be one of VCN_ERROR_CODE_\*. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_ERROR_CODE_INTERNAL_ERROR:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_ERROR_CODE_CONFIG_ERROR:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_ERROR_CODE_NETWORK_ERROR:kotlin.Int` |
| `detail` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?: Throwable to provide additional information about the error, or `null` if none |

### onStatusChanged

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

```
abstract fun onStatusChanged(statusCode: Int): Unit
```

Invoked when status of the VCN for this callback's subscription group changes.

| Parameters ||
|---|---|
| `statusCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the code for the status change encountered by this `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager.VcnStatusCallback#`'s subscription group. This value will be one of VCN_STATUS_CODE_\*. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_STATUS_CODE_NOT_CONFIGURED:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_STATUS_CODE_INACTIVE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_STATUS_CODE_ACTIVE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/vcn/VcnManager#VCN_STATUS_CODE_SAFE_MODE:kotlin.Int` |