Added in API level 33

WifiSsidPolicy


class WifiSsidPolicy : Parcelable
kotlin.Any
   ↳ android.app.admin.WifiSsidPolicy

Used to indicate the Wi-Fi SSID restriction policy the network must satisfy in order to be eligible for a connection. If the policy type is a denylist, the device may not connect to networks on the denylist. If the policy type is an allowlist, the device may only connect to networks on the allowlist. Admin configured networks are not exempt from this restriction. This policy only prohibits connecting to a restricted network and does not affect adding a restricted network. If the current network is present in the denylist or not present in the allowlist, it will be disconnected.

Summary

Constants
static Int

SSID policy type indicator for WifiSsidPolicy.

static Int

SSID policy type indicator for WifiSsidPolicy.

Inherited constants
Public constructors
WifiSsidPolicy(policyType: Int, ssids: MutableSet<WifiSsid!>)

Create the Wi-Fi SSID Policy.

Public methods
Int

Boolean
equals(other: Any?)

Two instances of WifiSsidPolicy are considered equal if they have the same WifiSsidPolicyType and the same set of WifiSsids

Int

Returns the policy type.

MutableSet<WifiSsid!>

Returns the set of WifiSsid

Int

Returns the hash code value of WifiSsidPolicyType and WifiSsid set

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<WifiSsidPolicy!>

Constants

WIFI_SSID_POLICY_TYPE_ALLOWLIST

Added in API level 33
static val WIFI_SSID_POLICY_TYPE_ALLOWLIST: Int

SSID policy type indicator for WifiSsidPolicy.

When returned from WifiSsidPolicy#getPolicyType(), the constant indicates that the SSID policy type is an allowlist.

Value: 0

WIFI_SSID_POLICY_TYPE_DENYLIST

Added in API level 33
static val WIFI_SSID_POLICY_TYPE_DENYLIST: Int

SSID policy type indicator for WifiSsidPolicy.

When returned from WifiSsidPolicy#getPolicyType(), the constant indicates that the SSID policy type is a denylist.

Value: 1

Public constructors

WifiSsidPolicy

Added in API level 33
WifiSsidPolicy(
    policyType: Int,
    ssids: MutableSet<WifiSsid!>)

Create the Wi-Fi SSID Policy.

Parameters
policyType Int: indicate whether the policy is an allowlist or a denylist Value is android.app.admin.WifiSsidPolicy#WIFI_SSID_POLICY_TYPE_ALLOWLIST, or android.app.admin.WifiSsidPolicy#WIFI_SSID_POLICY_TYPE_DENYLIST
ssids MutableSet<WifiSsid!>: set of WifiSsid This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the input ssids set is empty or the policyType is invalid

Public methods

describeContents

Added in API level 33
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 33
fun equals(other: Any?): Boolean

Two instances of WifiSsidPolicy are considered equal if they have the same WifiSsidPolicyType and the same set of WifiSsids

Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getSsids

Added in API level 33
fun getSsids(): MutableSet<WifiSsid!>

Returns the set of WifiSsid

Return
MutableSet<WifiSsid!> This value cannot be null.

hashCode

Added in API level 33
fun hashCode(): Int

Returns the hash code value of WifiSsidPolicyType and WifiSsid set

Return
Int a hash code value for this object.

writeToParcel

Added in API level 33
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 33
static val CREATOR: Parcelable.Creator<WifiSsidPolicy!>