Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#inhmethods)

# WifiNetworkSuggestion.Builder

*** ** * ** ***

` public static final class WifiNetworkSuggestion.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.wifi.WifiNetworkSuggestion.Builder |

<br />

*** ** * ** ***

Builder used to create `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` objects.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#build()() ` Create a network suggestion object for use in `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setBssid(android.net.MacAddress)(https://developer.android.com/reference/android/net/MacAddress bssid) ` Set the BSSID to use for filtering networks from scan results. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)(boolean isCarrierMerged) ` Specifies whether the suggestion represents a carrier merged network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)(boolean isShared) ` Specifies whether the network credentials provided with this suggestion can be used by the user to explicitly (manually) connect to this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsAppInteractionRequired(boolean)(boolean isAppInteractionRequired) ` Specifies whether the app needs to log in to a captive portal to obtain Internet access. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsEnhancedOpen(boolean)(boolean isEnhancedOpen) ` Specifies whether this represents an Enhanced Open (OWE) network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsHiddenSsid(boolean)(boolean isHiddenSsid) ` Specifies whether this represents a hidden network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)(boolean enabled) ` Specifies whether the suggestion is created with auto-join enabled or disabled. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsMetered(boolean)(boolean isMetered) ` Specifies whether this network is metered. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsUserInteractionRequired(boolean)(boolean isUserInteractionRequired) ` Specifies whether the user needs to log in to a captive portal to obtain Internet access. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsWpa3SaeH2eOnlyModeEnabled(boolean)(boolean enable) ` Specifies whether the suggestion represents an SAE network which only accepts Hash-to-Element mode. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setMacRandomizationSetting(int)(int macRandomizationSetting) ` Specifies the MAC randomization method. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPasspointConfig(android.net.wifi.hotspot2.PasspointConfiguration)(https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration passpointConfig) ` Set the associated Passpoint configuration for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPriority(int)(int priority) ` Specify the priority of this network among other network suggestions provided by the same app and within the same priority group, see `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPriorityGroup(int)`. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPriorityGroup(int)(int priorityGroup) ` Suggested networks are considered as part of a pool of all suggested networks and other networks (e.g. saved networks) - one of which will be selected. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setRestricted(boolean)(boolean isRestricted) ` Specifies whether the system will bring up the network (if selected) as restricted. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSsid(java.lang.String)(https://developer.android.com/reference/java/lang/String ssid) ` Set the unicode SSID for the network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionGroup(android.os.ParcelUuid)(https://developer.android.com/reference/android/os/ParcelUuid groupUuid) ` Configure the suggestion to only be used with the SIMs that belong to the Subscription Group specified in this method. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionId(int)(int subscriptionId) ` Configure the suggestion to only be used with the SIM identified by the subscription ID specified in this method. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setUntrusted(boolean)(boolean isUntrusted) ` Specifies whether the system will bring up the network (if selected) as untrusted. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWapiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig)(https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig enterpriseConfig) ` Set the associated enterprise configuration for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWapiPassphrase(java.lang.String)(https://developer.android.com/reference/java/lang/String passphrase) ` Set the ASCII WAPI passphrase for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWifi7Enabled(boolean)(boolean enabled) ` Sets whether Wi-Fi 7 is enabled for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWifiSsid(android.net.wifi.WifiSsid)(https://developer.android.com/reference/android/net/wifi/WifiSsid wifiSsid) ` Set the SSID for the network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa2EnterpriseConfig(android.net.wifi.WifiEnterpriseConfig)(https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig enterpriseConfig) ` Set the associated enterprise configuration for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa2Passphrase(java.lang.String)(https://developer.android.com/reference/java/lang/String passphrase) ` Set the ASCII WPA2 passphrase for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)(https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig enterpriseConfig) ` Set the associated enterprise configuration for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3EnterpriseConfig(android.net.wifi.WifiEnterpriseConfig)(https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig enterpriseConfig) ` *This method was deprecated in API level 31. use `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3EnterpriseStandardModeConfig(android.net.wifi.WifiEnterpriseConfig)` or `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)` to specify WPA3-Enterprise type explicitly.* |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3EnterpriseStandardModeConfig(android.net.wifi.WifiEnterpriseConfig)(https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig enterpriseConfig) ` Set the associated enterprise configuration for this network. |
| ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | ` https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Passphrase(java.lang.String)(https://developer.android.com/reference/java/lang/String passphrase) ` Set the ASCII WPA3 passphrase for this network. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Builder

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

```
public Builder ()
```

<br />

<br />

## Public methods

### build

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

```
public WifiNetworkSuggestion build ()
```

Create a network suggestion object for use in `https://developer.android.com/reference/android/net/wifi/WifiManager#addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>)`.

**Note:** Apps can set a combination of SSID using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSsid(java.lang.String)` and BSSID using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setBssid(android.net.MacAddress)` to provide more fine grained network suggestions to the platform.
For example: To provide credentials for one open, one WPA2, one WPA3 network with their corresponding SSID's and one with Passpoint config:

    final WifiNetworkSuggestion suggestion1 =
          new Builder()
          .setSsid("test111111")
          .build();
     final WifiNetworkSuggestion suggestion2 =
          new Builder()
          .setSsid("test222222")
          .setWpa2Passphrase("test123456")
          .build();
     final WifiNetworkSuggestion suggestion3 =
          new Builder()
          .setSsid("test333333")
          .setWpa3Passphrase("test6789")
          .build();
     final PasspointConfiguration passpointConfig= new PasspointConfiguration();
     // configure passpointConfig to include a valid Passpoint configuration
     final WifiNetworkSuggestion suggestion4 =
          new Builder()
          .setPasspointConfig(passpointConfig)
          .build();
     final List<WifiNetworkSuggestion> suggestionsList =
          new ArrayList<WifiNetworkSuggestion> { {
              add(suggestion1);
              add(suggestion2);
              add(suggestion3);
              add(suggestion4);
          } };
     final WifiManager wifiManager =
          context.getSystemService(Context.WIFI_SERVICE);
     wifiManager.addNetworkSuggestions(suggestionsList);
     // ...
     
<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion` This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | on invalid params set |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion`

### setBssid

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

```
public WifiNetworkSuggestion.Builder setBssid (MacAddress bssid)
```

Set the BSSID to use for filtering networks from scan results. Will only match network whose BSSID is identical to the specified value.

<br />

- If set, only the specified BSSID with the specified SSID will be considered for connection.
- If not set, all BSSIDs with the specified SSID will be considered for connection.
- Overrides any previous value set using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setBssid(android.net.MacAddress)`.

| Parameters ||
|---|---|
| `bssid` | `MacAddress`: BSSID of the network. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setCarrierMerged

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

```
public WifiNetworkSuggestion.Builder setCarrierMerged (boolean isCarrierMerged)
```

Specifies whether the suggestion represents a carrier merged network. A carrier merged Wi-Fi network is treated as part of the mobile carrier network. Such configuration may impact the user interface and data usage accounting.

Only carriers with the `https://developer.android.com/reference/android/telephony/CarrierConfigManager#KEY_CARRIER_PROVISIONS_WIFI_MERGED_NETWORKS_BOOL` flag set to `true` may use this API.

<br />

- A suggestion marked as carrier merged must be metered enterprise network with a valid subscription Id set.<br />

  <br />

  | Parameters ||
  |---|---|
  | `isCarrierMerged` | `boolean`: Boolean indicating whether the network is treated a carrier merged network (if true) or non-merged network (if false); <br /> |

  | Returns ||
  |---|---|
  | `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

  **See also:**
  - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setIsMetered(boolean)`
  - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionId(int)`
  - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa2EnterpriseConfig(android.net.wifi.WifiEnterpriseConfig)`
  - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)`
  - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3EnterpriseStandardModeConfig(android.net.wifi.WifiEnterpriseConfig)`
  - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPasspointConfig(android.net.wifi.hotspot2.PasspointConfiguration)`
  `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPasspointConfig(android.net.wifi.hotspot2.PasspointConfiguration)`

### setCredentialSharedWithUser

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

```
public WifiNetworkSuggestion.Builder setCredentialSharedWithUser (boolean isShared)
```

Specifies whether the network credentials provided with this suggestion can be used by the user to explicitly (manually) connect to this network. If true this network will appear in the Wi-Fi Picker (in Settings) and the user will be able to select and connect to it with the provided credentials. If false, the user will need to enter network credentials and the resulting configuration will become a user saved network.

<br />

- Note: Only valid for secure (non-open) networks.
- If not set, defaults to true (i.e. allow user to manually connect) for secure networks and false for open networks.

| Parameters ||
|---|---|
| `isShared` | `boolean`: `true` to indicate that the credentials may be used by the user to manually connect to the network, `false` otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsAppInteractionRequired

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

```
public WifiNetworkSuggestion.Builder setIsAppInteractionRequired (boolean isAppInteractionRequired)
```

Specifies whether the app needs to log in to a captive portal to obtain Internet access.

This will dictate if the directed broadcast `https://developer.android.com/reference/android/net/wifi/WifiManager#ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION` will be sent to the app after successfully connecting to the network. Use this for captive portal type networks where the app needs to authenticate the user before the device can access the network.

<br />

- If not set, defaults to false (i.e no app interaction required).

| Parameters ||
|---|---|
| `isAppInteractionRequired` | `boolean`: `true` to indicate that app interaction is required, `false` otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsEnhancedOpen

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

```
public WifiNetworkSuggestion.Builder setIsEnhancedOpen (boolean isEnhancedOpen)
```

Specifies whether this represents an Enhanced Open (OWE) network.

<br />

| Parameters ||
|---|---|
| `isEnhancedOpen` | `boolean`: `true` to indicate that the network used enhanced open, `false` otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsHiddenSsid

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

```
public WifiNetworkSuggestion.Builder setIsHiddenSsid (boolean isHiddenSsid)
```

Specifies whether this represents a hidden network.

<br />

- If not set, defaults to false (i.e not a hidden network).

| Parameters ||
|---|---|
| `isHiddenSsid` | `boolean`: `true` to indicate that the network is hidden, `false` otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsInitialAutojoinEnabled

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

```
public WifiNetworkSuggestion.Builder setIsInitialAutojoinEnabled (boolean enabled)
```

Specifies whether the suggestion is created with auto-join enabled or disabled. The user may modify the auto-join configuration of a suggestion directly once the device associates to the network.

If auto-join is initialized as disabled the user may still be able to manually connect to the network. Therefore, disabling auto-join only makes sense if `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)` is set to true (the default) which itself implies a secure (non-open) network.

If not set, defaults to true (i.e. auto-join is initialized as enabled).

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: true for initializing with auto-join enabled (the default), false to initializing with auto-join disabled. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsMetered

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

```
public WifiNetworkSuggestion.Builder setIsMetered (boolean isMetered)
```

Specifies whether this network is metered.

<br />

- If not set, defaults to detect automatically.

| Parameters ||
|---|---|
| `isMetered` | `boolean`: `true` to indicate that the network is metered, `false` for not metered. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsUserInteractionRequired

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

```
public WifiNetworkSuggestion.Builder setIsUserInteractionRequired (boolean isUserInteractionRequired)
```

Specifies whether the user needs to log in to a captive portal to obtain Internet access.

<br />

- If not set, defaults to false (i.e no user interaction required).

| Parameters ||
|---|---|
| `isUserInteractionRequired` | `boolean`: `true` to indicate that user interaction is required, `false` otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setIsWpa3SaeH2eOnlyModeEnabled

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

```
public WifiNetworkSuggestion.Builder setIsWpa3SaeH2eOnlyModeEnabled (boolean enable)
```

Specifies whether the suggestion represents an SAE network which only accepts Hash-to-Element mode. If this is enabled, Hunting \& Pecking mode is disabled and only Hash-to-Element mode is used for this network. This is only valid for an SAE network which is configured using the `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Passphrase(java.lang.String)`. Before calling this API, the application should check Hash-to-Element support using `https://developer.android.com/reference/android/net/wifi/WifiManager#isWpa3SaeH2eSupported()`.

<br />

| Parameters ||
|---|---|
| `enable` | `boolean`: Boolean indicating whether the network only accepts Hash-to-Element mode, default is false. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setMacRandomizationSetting

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

```
public WifiNetworkSuggestion.Builder setMacRandomizationSetting (int macRandomizationSetting)
```

Specifies the MAC randomization method.

Suggested networks will never use the device (factory) MAC address to associate to the network - instead they use a locally generated random MAC address. This method controls the strategy for generating the random MAC address. If not set, defaults to `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#RANDOMIZATION_PERSISTENT`.

<br />

| Parameters ||
|---|---|
| `macRandomizationSetting` | `int`: - one of `RANDOMIZATION_*` values. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#RANDOMIZATION_PERSISTENT` - `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion#RANDOMIZATION_NON_PERSISTENT` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setPasspointConfig

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

```
public WifiNetworkSuggestion.Builder setPasspointConfig (PasspointConfiguration passpointConfig)
```

Set the associated Passpoint configuration for this network. Needed for authenticating to Hotspot 2.0 networks. See `https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration` for description.

<br />

| Parameters ||
|---|---|
| `passpointConfig` | `PasspointConfiguration`: Instance of `https://developer.android.com/reference/android/net/wifi/hotspot2/PasspointConfiguration`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if passpoint configuration is invalid. |

### setPriority

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

```
public WifiNetworkSuggestion.Builder setPriority (int priority)
```

Specify the priority of this network among other network suggestions provided by the same app and within the same priority group, see `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPriorityGroup(int)`. Priorities have no impact on suggestions by other apps or suggestions from the same app using a different priority group. The higher the number, the higher the priority (i.e value of 0 = lowest priority). If not set, defaults to a lower priority than any assigned priority.

<br />

| Parameters ||
|---|---|
| `priority` | `int`: Integer number representing the priority among suggestions by the app. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the priority value is negative. |

### setPriorityGroup

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

```
public WifiNetworkSuggestion.Builder setPriorityGroup (int priorityGroup)
```

Suggested networks are considered as part of a pool of all suggested networks and other networks (e.g. saved networks) - one of which will be selected.

- Any app can suggest any number of networks.
- Priority: only the highest priority (0 being the lowest) currently visible suggested network or networks (multiple suggested networks may have the same priority) are added to the network selection pool.

However, this restricts a suggesting app to have a single group of networks which can be prioritized. In some circumstances multiple groups are useful: for instance, suggesting networks for 2 different SIMs - each of which may have its own priority order.

Priority group: creates a separate priority group. Only the highest priority, currently visible suggested network or networks, within each priority group are included in the network selection pool.

Specify an arbitrary integer only used as the priority group. Use with `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setPriority(int)`.

<br />

| Parameters ||
|---|---|
| `priorityGroup` | `int`: priority group id, if not set default is 0. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setRestricted

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

```
public WifiNetworkSuggestion.Builder setRestricted (boolean isRestricted)
```

Specifies whether the system will bring up the network (if selected) as restricted. A restricted network has its `https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_NOT_RESTRICTED` capability removed. The Wi-Fi network selection process may use this information to influence priority of the suggested network for Wi-Fi network selection (most likely to reduce it). The connectivity service may use this information to influence the overall network configuration of the device.

<br />

- These suggestions are only considered for network selection if a `https://developer.android.com/reference/android/net/NetworkRequest` without `https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_NOT_RESTRICTED` capability is filed.
- A restricted network's credentials may not be shared with the user using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)`.
- If not set, defaults to false (i.e. network is unrestricted).

| Parameters ||
|---|---|
| `isRestricted` | `boolean`: Boolean indicating whether the network should be brought up restricted (if true) or unrestricted (if false). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setSsid

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

```
public WifiNetworkSuggestion.Builder setSsid (String ssid)
```

Set the unicode SSID for the network.

<br />

- Overrides any previous value set using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSsid(java.lang.String)`.
- Note: use `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWifiSsid(android.net.wifi.WifiSsid)` which supports both unicode and non-unicode SSID.

| Parameters ||
|---|---|
| `ssid` | `String`: The SSID of the network. It must be valid Unicode. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the SSID is not valid unicode. |

### setSubscriptionGroup

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

```
public WifiNetworkSuggestion.Builder setSubscriptionGroup (ParcelUuid groupUuid)
```

Configure the suggestion to only be used with the SIMs that belong to the Subscription Group specified in this method. The suggested network will only be used by the SIM in this Subscription Group and no other SIMs - even from the same carrier.

The caller is restricted to be either of:
- A carrier provisioning app.
- A carrier-privileged app - which is restricted to only specify a subscription ID which belong to the same carrier which signed the app, see `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`.

  Specifying a subscription group which doesn't match these restriction will cause the suggestion to be rejected with the error code `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED`. Only one of the `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionGroup(android.os.ParcelUuid)` and `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionId(int)` should be called for a suggestion.

  <br />

  | Parameters ||
  |---|---|
  | `groupUuid` | `ParcelUuid`: Subscription group UUID see `https://developer.android.com/reference/android/telephony/SubscriptionManager#createSubscriptionGroup(java.util.List<java.lang.Integer>)` This value cannot be `null`. <br /> |

  | Returns ||
  |---|---|
  | `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

  | Throws ||
  |---|---|
  | `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if group UUID is `null`. |

### setSubscriptionId

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

```
public WifiNetworkSuggestion.Builder setSubscriptionId (int subscriptionId)
```

Configure the suggestion to only be used with the SIM identified by the subscription ID specified in this method. The suggested network will only be used by that SIM and no other SIM - even from the same carrier.

The caller is restricted to be either of:
- A carrier provisioning app (which holds the `android.Manifest.permission#NETWORK_CARRIER_PROVISIONING` permission).
- A carrier-privileged app - which is restricted to only specify a subscription ID which belong to the same carrier which signed the app, see `https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges()`.

  Specifying a subscription ID which doesn't match these restriction will cause the suggestion to be rejected with the error code `https://developer.android.com/reference/android/net/wifi/WifiManager#STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED`. Only one of the `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionGroup(android.os.ParcelUuid)` and `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSubscriptionId(int)` should be called for a suggestion.

  <br />

  | Parameters ||
  |---|---|
  | `subscriptionId` | `int`: subscription ID see `https://developer.android.com/reference/android/telephony/SubscriptionInfo#getSubscriptionId()` <br /> |

  | Returns ||
  |---|---|
  | `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

  | Throws ||
  |---|---|
  | `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if subscriptionId equals to `https://developer.android.com/reference/android/telephony/SubscriptionManager#INVALID_SUBSCRIPTION_ID` |

### setUntrusted

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

```
public WifiNetworkSuggestion.Builder setUntrusted (boolean isUntrusted)
```

Specifies whether the system will bring up the network (if selected) as untrusted. An untrusted network has its `https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_TRUSTED` capability removed. The Wi-Fi network selection process may use this information to influence priority of the suggested network for Wi-Fi network selection (most likely to reduce it). The connectivity service may use this information to influence the overall network configuration of the device.

<br />

- These suggestions are only considered for network selection if a `https://developer.android.com/reference/android/net/NetworkRequest` without `https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_TRUSTED` capability is filed.
- An untrusted network's credentials may not be shared with the user using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)`.
- If not set, defaults to false (i.e. network is trusted).

| Parameters ||
|---|---|
| `isUntrusted` | `boolean`: Boolean indicating whether the network should be brought up untrusted (if true) or trusted (if false). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setWapiEnterpriseConfig

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

```
public WifiNetworkSuggestion.Builder setWapiEnterpriseConfig (WifiEnterpriseConfig enterpriseConfig)
```

Set the associated enterprise configuration for this network. Needed for authenticating to WAPI-CERT networks. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig` for description.

<br />

| Parameters ||
|---|---|
| `enterpriseConfig` | `WifiEnterpriseConfig`: Instance of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setWapiPassphrase

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

```
public WifiNetworkSuggestion.Builder setWapiPassphrase (String passphrase)
```

Set the ASCII WAPI passphrase for this network. Needed for authenticating to WAPI-PSK networks.

<br />

| Parameters ||
|---|---|
| `passphrase` | `String`: passphrase of the network. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the passphrase is not ASCII encodable. |

### setWifi7Enabled

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

```
public WifiNetworkSuggestion.Builder setWifi7Enabled (boolean enabled)
```

Sets whether Wi-Fi 7 is enabled for this network.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: Enable Wi-Fi 7 if true, otherwise disable Wi-Fi 7 <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

### setWifiSsid

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

```
public WifiNetworkSuggestion.Builder setWifiSsid (WifiSsid wifiSsid)
```

Set the SSID for the network. `https://developer.android.com/reference/android/net/wifi/WifiSsid` support both unicode and non-unicode SSID.

<br />

- Overrides any previous value set using `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWifiSsid(android.net.wifi.WifiSsid)` or `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSsid(java.lang.String)`.
- Note: this method is the superset of the `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setSsid(java.lang.String)`

| Parameters ||
|---|---|
| `wifiSsid` | `WifiSsid`: The SSID of the network, in `https://developer.android.com/reference/android/net/wifi/WifiSsid` format. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the wifiSsid is invalid. |

### setWpa2EnterpriseConfig

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

```
public WifiNetworkSuggestion.Builder setWpa2EnterpriseConfig (WifiEnterpriseConfig enterpriseConfig)
```

Set the associated enterprise configuration for this network. Needed for authenticating to WPA2 enterprise networks. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig` for description.

<br />

| Parameters ||
|---|---|
| `enterpriseConfig` | `WifiEnterpriseConfig`: Instance of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If configuration uses server certificate but validation is not enabled. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isServerCertValidationEnabled()` |

### setWpa2Passphrase

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

```
public WifiNetworkSuggestion.Builder setWpa2Passphrase (String passphrase)
```

Set the ASCII WPA2 passphrase for this network. Needed for authenticating to WPA2-PSK networks.

<br />

| Parameters ||
|---|---|
| `passphrase` | `String`: passphrase of the network. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the passphrase is not ASCII encodable. |

### setWpa3Enterprise192BitModeConfig

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

```
public WifiNetworkSuggestion.Builder setWpa3Enterprise192BitModeConfig (WifiEnterpriseConfig enterpriseConfig)
```

Set the associated enterprise configuration for this network. Needed for authenticating to WPA3-Enterprise in 192-bit security mode networks. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig` for description. Both the client and CA certificates must be provided, and must be of type of either sha384WithRSAEncryption with key length of 3072bit or more (OID 1.2.840.113549.1.1.12), or ecdsa-with-SHA384 with key length of 384bit or more (OID 1.2.840.10045.4.3.3).

<br />

| Parameters ||
|---|---|
| `enterpriseConfig` | `WifiEnterpriseConfig`: Instance of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the EAP type or certificates do not meet 192-bit mode requirements. |

### setWpa3EnterpriseConfig

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

```
public WifiNetworkSuggestion.Builder setWpa3EnterpriseConfig (WifiEnterpriseConfig enterpriseConfig)
```

<br />

**This method was deprecated in API level 31.**   

use `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3EnterpriseStandardModeConfig(android.net.wifi.WifiEnterpriseConfig)` or `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)` to specify WPA3-Enterprise type explicitly.

Set the associated enterprise configuration for this network. Needed for authenticating to WPA3-Enterprise networks (standard and 192-bit security). See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig` for description. For 192-bit security networks, both the client and CA certificates must be provided, and must be of type of either sha384WithRSAEncryption (OID 1.2.840.113549.1.1.12) or ecdsa-with-SHA384 (OID 1.2.840.10045.4.3.3).

<br />

| Parameters ||
|---|---|
| `enterpriseConfig` | `WifiEnterpriseConfig`: Instance of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If configuration uses server certificate but validation is not enabled. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isServerCertValidationEnabled()` |

### setWpa3EnterpriseStandardModeConfig

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

```
public WifiNetworkSuggestion.Builder setWpa3EnterpriseStandardModeConfig (WifiEnterpriseConfig enterpriseConfig)
```

Set the associated enterprise configuration for this network. Needed for authenticating to WPA3-Enterprise standard networks. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig` for description. For WPA3-Enterprise in 192-bit security mode networks, see `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setWpa3Enterprise192BitModeConfig(android.net.wifi.WifiEnterpriseConfig)` for description.

<br />

| Parameters ||
|---|---|
| `enterpriseConfig` | `WifiEnterpriseConfig`: Instance of `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If configuration uses server certificate but validation is not enabled. See `https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isServerCertValidationEnabled()` |

### setWpa3Passphrase

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

```
public WifiNetworkSuggestion.Builder setWpa3Passphrase (String passphrase)
```

Set the ASCII WPA3 passphrase for this network. Needed for authenticating to WPA3-SAE networks.

<br />

| Parameters ||
|---|---|
| `passphrase` | `String`: passphrase of the network. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` | Instance of `https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder` to enable chaining of the builder method. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the passphrase is not ASCII encodable. |