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

# AddNetworkResult

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/net/wifi/WifiManager.AddNetworkResult "View this page in Java")

```
class AddNetworkResult : Parcelable
```

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

Provides the results of a call to `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager#addNetworkPrivileged(android.net.wifi.WifiConfiguration)`

## Summary

| Constants ||
|---|---|
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_ADD_PASSPOINT_FAILURE:kotlin.Int` Generic failure code for adding a passpoint network. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_ADD_WIFI_CONFIG_FAILURE:kotlin.Int` Generic failure code for adding a non-passpoint network. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_FAILURE_UNKNOWN:kotlin.Int` The operation has failed due to an unknown reason. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_FAILURE_UPDATE_NETWORK_KEYS:kotlin.Int` Internal failure in updating network keys. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_INVALID_CONFIGURATION:kotlin.Int` The network configuration is invalid. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_INVALID_CONFIGURATION_ENTERPRISE:kotlin.Int` The enterprise network is missing either the root CA or domain name. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION:kotlin.Int` The calling app does not have permission to call this API. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_CONFIG:kotlin.Int` The calling app has no permission to modify the configuration. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_MAC_RANDOMIZATION:kotlin.Int` The calling app has no permission to modify the MAC randomization setting. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_PROXY_SETTING:kotlin.Int` The calling app has no permission to modify the proxy setting. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_SUCCESS:kotlin.Int` The operation has completed successfully. |

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#AddNetworkResult(kotlin.Int,%20kotlin.Int)(statusCode: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, networkId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` <br /> |

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[WifiManager.AddNetworkResult](https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#)!\> | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#CREATOR:android.os.Parcelable.Creator` Implement the Parcelable interface |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#networkId:kotlin.Int` The identifier of the added network, which could be used in other operations. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#statusCode:kotlin.Int` One of the `STATUS_` values. |

## Constants

### STATUS_ADD_PASSPOINT_FAILURE

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

```
static val STATUS_ADD_PASSPOINT_FAILURE: Int
```

Generic failure code for adding a passpoint network.

    Value: 3

### STATUS_ADD_WIFI_CONFIG_FAILURE

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

```
static val STATUS_ADD_WIFI_CONFIG_FAILURE: Int
```

Generic failure code for adding a non-passpoint network.

    Value: 4

### STATUS_FAILURE_UNKNOWN

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

```
static val STATUS_FAILURE_UNKNOWN: Int
```

The operation has failed due to an unknown reason.

    Value: 1

### STATUS_FAILURE_UPDATE_NETWORK_KEYS

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

```
static val STATUS_FAILURE_UPDATE_NETWORK_KEYS: Int
```

Internal failure in updating network keys..

    Value: 9

### STATUS_INVALID_CONFIGURATION

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

```
static val STATUS_INVALID_CONFIGURATION: Int
```

The network configuration is invalid.

    Value: 5

### STATUS_INVALID_CONFIGURATION_ENTERPRISE

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

```
static val STATUS_INVALID_CONFIGURATION_ENTERPRISE: Int
```

The enterprise network is missing either the root CA or domain name.

    Value: 10

### STATUS_NO_PERMISSION

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

```
static val STATUS_NO_PERMISSION: Int
```

The calling app does not have permission to call this API.

    Value: 2

### STATUS_NO_PERMISSION_MODIFY_CONFIG

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

```
static val STATUS_NO_PERMISSION_MODIFY_CONFIG: Int
```

The calling app has no permission to modify the configuration.

    Value: 6

### STATUS_NO_PERMISSION_MODIFY_MAC_RANDOMIZATION

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

```
static val STATUS_NO_PERMISSION_MODIFY_MAC_RANDOMIZATION: Int
```

The calling app has no permission to modify the MAC randomization setting.

    Value: 8

### STATUS_NO_PERMISSION_MODIFY_PROXY_SETTING

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

```
static val STATUS_NO_PERMISSION_MODIFY_PROXY_SETTING: Int
```

The calling app has no permission to modify the proxy setting.

    Value: 7

### STATUS_SUCCESS

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

```
static val STATUS_SUCCESS: Int
```

The operation has completed successfully.

    Value: 0

## Public constructors

### AddNetworkResult

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

```
AddNetworkResult(
    statusCode: Int, 
    networkId: Int)
```

| Parameters ||
|---|---|
| `statusCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is one of the following: - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_SUCCESS:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_FAILURE_UNKNOWN:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_ADD_PASSPOINT_FAILURE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_ADD_WIFI_CONFIG_FAILURE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_INVALID_CONFIGURATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_CONFIG:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_PROXY_SETTING:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_MAC_RANDOMIZATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_FAILURE_UPDATE_NETWORK_KEYS:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_INVALID_CONFIGURATION_ENTERPRISE:kotlin.Int` |

## Public methods

### describeContents

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

```
fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### writeToParcel

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

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

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

```
static val CREATOR: Parcelable.Creator<WifiManager.AddNetworkResult!>
```

Implement the Parcelable interface

### networkId

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

```
val networkId: Int
```

The identifier of the added network, which could be used in other operations. This field will be set to `-1` if the operation failed.

### statusCode

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

```
val statusCode: Int
```

One of the `STATUS_` values. If the operation is successful this field will be set to `STATUS_SUCCESS`.   
Value is one of the following:

- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_SUCCESS:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_FAILURE_UNKNOWN:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_ADD_PASSPOINT_FAILURE:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_ADD_WIFI_CONFIG_FAILURE:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_INVALID_CONFIGURATION:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_CONFIG:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_PROXY_SETTING:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_NO_PERMISSION_MODIFY_MAC_RANDOMIZATION:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_FAILURE_UPDATE_NETWORK_KEYS:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/net/wifi/WifiManager.AddNetworkResult#STATUS_INVALID_CONFIGURATION_ENTERPRISE:kotlin.Int`

<br />