Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder used to create BlockingOption
objects.
Summary
Public constructors |
Create a Builder with blocking time for the network
|
Public constructors
Builder
Builder(blockingTimeSec: Int)
Create a Builder
with blocking time for the network
Parameters |
blockingTimeSec |
Int: Time period to block the network in seconds Value is between 1 and 86400 inclusive |
Exceptions |
java.lang.IllegalArgumentException |
if input is invalid. |
Public methods
setBlockingBssidOnly
fun setBlockingBssidOnly(bssidOnly: Boolean): BlockingOption.Builder
Set to configure blocking the whole network or a single BSSID. By default, the whole network will be blocked.
Parameters |
bssidOnly |
Boolean: True for a single BSSID, otherwise the whole network will be blocked |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[null,null,["Last updated 2025-03-13 UTC."],[],[],null,["# BlockingOption.Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/wifi/BlockingOption.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.wifi.BlockingOption.Builder](#) |\n\nBuilder used to create [BlockingOption](/reference/kotlin/android/net/wifi/BlockingOption) objects.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.Int))`(`blockingTimeSec:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Create a [Builder](#) with blocking time for the network |\n\n| Public methods ||\n|---------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [BlockingOption](/reference/kotlin/android/net/wifi/BlockingOption) | [build](#build())`()` Create a BlockingOption object for use in [WifiManager.disallowCurrentSuggestedNetwork(BlockingOption)](/reference/kotlin/android/net/wifi/WifiManager#disallowCurrentSuggestedNetwork(android.net.wifi.BlockingOption)). |\n| [BlockingOption.Builder](#) | [setBlockingBssidOnly](#setBlockingBssidOnly(kotlin.Boolean))`(`bssidOnly:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Set to configure blocking the whole network or a single BSSID. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(blockingTimeSec: Int)\n```\n\nCreate a [Builder](#) with blocking time for the network\n\n| Parameters ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `blockingTimeSec` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Time period to block the network in seconds Value is between 1 and 86400 inclusive |\n\n| Exceptions ||\n|--------------------------------------|----------------------|\n| `java.lang.IllegalArgumentException` | if input is invalid. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): BlockingOption\n```\n\nCreate a BlockingOption object for use in [WifiManager.disallowCurrentSuggestedNetwork(BlockingOption)](/reference/kotlin/android/net/wifi/WifiManager#disallowCurrentSuggestedNetwork(android.net.wifi.BlockingOption)).\n\n| Return ||\n|---------------------------------------------------------------------|------------------------------|\n| [BlockingOption](/reference/kotlin/android/net/wifi/BlockingOption) | This value cannot be `null`. |\n\n### setBlockingBssidOnly\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setBlockingBssidOnly(bssidOnly: Boolean): BlockingOption.Builder\n```\n\nSet to configure blocking the whole network or a single BSSID. By default, the whole network will be blocked.\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `bssidOnly` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): True for a single BSSID, otherwise the whole network will be blocked |\n\n| Return ||\n|-----------------------------|-------------------------------------------------------------------------------------------------|\n| [BlockingOption.Builder](#) | Instance of [Builder](#) to enable chaining of the builder method. This value cannot be `null`. |"]]