field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkSpecifier> CREATOR;
}
- public static class WifiNetworkSpecifier.Builder {
+ public static final class WifiNetworkSpecifier.Builder {
ctor public WifiNetworkSpecifier.Builder();
- method public android.net.NetworkSpecifier build();
- method public android.net.wifi.WifiNetworkSpecifier.Builder setBssid(@NonNull android.net.MacAddress);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setBssidPattern(@NonNull android.net.MacAddress, @NonNull android.net.MacAddress);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setIsEnhancedOpen();
- method public android.net.wifi.WifiNetworkSpecifier.Builder setIsHiddenSsid();
- method public android.net.wifi.WifiNetworkSpecifier.Builder setSsid(@NonNull String);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setSsidPattern(@NonNull android.os.PatternMatcher);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setWpa2EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setWpa2Passphrase(@NonNull String);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3Passphrase(@NonNull String);
+ method @NonNull public android.net.NetworkSpecifier build();
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setBssid(@NonNull android.net.MacAddress);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setBssidPattern(@NonNull android.net.MacAddress, @NonNull android.net.MacAddress);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setIsEnhancedOpen();
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setIsHiddenSsid();
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setSsid(@NonNull String);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setSsidPattern(@NonNull android.os.PatternMatcher);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa2EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa2Passphrase(@NonNull String);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
+ method @NonNull public android.net.wifi.WifiNetworkSpecifier.Builder setWpa3Passphrase(@NonNull String);
}
public final class WifiNetworkSuggestion implements android.os.Parcelable {
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkSuggestion> CREATOR;
}
- public static class WifiNetworkSuggestion.Builder {
+ public static final class WifiNetworkSuggestion.Builder {
ctor public WifiNetworkSuggestion.Builder();
- method public android.net.wifi.WifiNetworkSuggestion build();
- method public android.net.wifi.WifiNetworkSuggestion.Builder setBssid(@NonNull android.net.MacAddress);
- method public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired();
- method public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedOpen();
- method public android.net.wifi.WifiNetworkSuggestion.Builder setIsHiddenSsid();
- method public android.net.wifi.WifiNetworkSuggestion.Builder setIsMetered();
- method public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserInteractionRequired();
- method public android.net.wifi.WifiNetworkSuggestion.Builder setPriority(int);
- method public android.net.wifi.WifiNetworkSuggestion.Builder setSsid(@NonNull String);
- method public android.net.wifi.WifiNetworkSuggestion.Builder setWpa2EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method public android.net.wifi.WifiNetworkSuggestion.Builder setWpa2Passphrase(@NonNull String);
- method public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
- method public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3Passphrase(@NonNull String);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion build();
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setBssid(@NonNull android.net.MacAddress);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired();
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedOpen();
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsHiddenSsid();
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsMetered();
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserInteractionRequired();
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPriority(int);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setSsid(@NonNull String);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa2EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa2Passphrase(@NonNull String);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3EnterpriseConfig(@NonNull android.net.wifi.WifiEnterpriseConfig);
+ method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setWpa3Passphrase(@NonNull String);
}
public class WpsInfo implements android.os.Parcelable {
/**
* Builder used to create {@link WifiNetworkSpecifier} objects.
*/
- public static class Builder {
+ public static final class Builder {
private static final String MATCH_ALL_SSID_PATTERN_PATH = ".*";
private static final String MATCH_EMPTY_SSID_PATTERN_PATH = "";
private static final Pair<MacAddress, MacAddress> MATCH_NO_BSSID_PATTERN1 =
* string pattern to use for matching the network's SSID.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setSsidPattern(@NonNull PatternMatcher ssidPattern) {
+ public @NonNull Builder setSsidPattern(@NonNull PatternMatcher ssidPattern) {
checkNotNull(ssidPattern);
mSsidPatternMatcher = ssidPattern;
return this;
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the SSID is not valid unicode.
*/
- public Builder setSsid(@NonNull String ssid) {
+ public @NonNull Builder setSsid(@NonNull String ssid) {
checkNotNull(ssid);
final CharsetEncoder unicodeEncoder = StandardCharsets.UTF_8.newEncoder();
if (!unicodeEncoder.canEncode(ssid)) {
* @param mask Mask for BSSID pattern.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setBssidPattern(
+ public @NonNull Builder setBssidPattern(
@NonNull MacAddress baseAddress, @NonNull MacAddress mask) {
checkNotNull(baseAddress, mask);
mBssidPatternMatcher = Pair.create(baseAddress, mask);
* @param bssid BSSID of the network.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setBssid(@NonNull MacAddress bssid) {
+ public @NonNull Builder setBssid(@NonNull MacAddress bssid) {
checkNotNull(bssid);
mBssidPatternMatcher = Pair.create(bssid, MATCH_EXACT_BSSID_PATTERN_MASK);
return this;
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsEnhancedOpen() {
+ public @NonNull Builder setIsEnhancedOpen() {
mIsEnhancedOpen = true;
return this;
}
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the passphrase is not ASCII encodable.
*/
- public Builder setWpa2Passphrase(@NonNull String passphrase) {
+ public @NonNull Builder setWpa2Passphrase(@NonNull String passphrase) {
checkNotNull(passphrase);
final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
if (!asciiEncoder.canEncode(passphrase)) {
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the passphrase is not ASCII encodable.
*/
- public Builder setWpa3Passphrase(@NonNull String passphrase) {
+ public @NonNull Builder setWpa3Passphrase(@NonNull String passphrase) {
checkNotNull(passphrase);
final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
if (!asciiEncoder.canEncode(passphrase)) {
* @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setWpa2EnterpriseConfig(
+ public @NonNull Builder setWpa2EnterpriseConfig(
@NonNull WifiEnterpriseConfig enterpriseConfig) {
checkNotNull(enterpriseConfig);
mWpa2EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
* @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setWpa3EnterpriseConfig(
+ public @NonNull Builder setWpa3EnterpriseConfig(
@NonNull WifiEnterpriseConfig enterpriseConfig) {
checkNotNull(enterpriseConfig);
mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsHiddenSsid() {
+ public @NonNull Builder setIsHiddenSsid() {
mIsHiddenSSID = true;
return this;
}
-
private void setSecurityParamsInWifiConfiguration(
@NonNull WifiConfiguration configuration) {
if (!TextUtils.isEmpty(mWpa2PskPassphrase)) { // WPA-PSK network.
* @return Instance of {@link NetworkSpecifier}.
* @throws IllegalStateException on invalid params set.
*/
- public NetworkSpecifier build() {
+ public @NonNull NetworkSpecifier build() {
if (!hasSetAnyPattern()) {
throw new IllegalStateException("one of setSsidPattern/setSsid/setBssidPattern/"
+ "setBssid should be invoked for specifier");
this.requestorPackageName = requestorPackageName;
}
- public static final @android.annotation.NonNull Creator<WifiNetworkSpecifier> CREATOR =
+ public static final @NonNull Creator<WifiNetworkSpecifier> CREATOR =
new Creator<WifiNetworkSpecifier>() {
@Override
public WifiNetworkSpecifier createFromParcel(Parcel in) {
/**
* Builder used to create {@link WifiNetworkSuggestion} objects.
*/
- public static class Builder {
+ public static final class Builder {
private static final int UNASSIGNED_PRIORITY = -1;
/**
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the SSID is not valid unicode.
*/
- public Builder setSsid(@NonNull String ssid) {
+ public @NonNull Builder setSsid(@NonNull String ssid) {
checkNotNull(ssid);
final CharsetEncoder unicodeEncoder = StandardCharsets.UTF_8.newEncoder();
if (!unicodeEncoder.canEncode(ssid)) {
* @param bssid BSSID of the network.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setBssid(@NonNull MacAddress bssid) {
+ public @NonNull Builder setBssid(@NonNull MacAddress bssid) {
checkNotNull(bssid);
mBssid = MacAddress.fromBytes(bssid.toByteArray());
return this;
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsEnhancedOpen() {
+ public @NonNull Builder setIsEnhancedOpen() {
mIsEnhancedOpen = true;
return this;
}
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the passphrase is not ASCII encodable.
*/
- public Builder setWpa2Passphrase(@NonNull String passphrase) {
+ public @NonNull Builder setWpa2Passphrase(@NonNull String passphrase) {
checkNotNull(passphrase);
final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
if (!asciiEncoder.canEncode(passphrase)) {
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the passphrase is not ASCII encodable.
*/
- public Builder setWpa3Passphrase(@NonNull String passphrase) {
+ public @NonNull Builder setWpa3Passphrase(@NonNull String passphrase) {
checkNotNull(passphrase);
final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder();
if (!asciiEncoder.canEncode(passphrase)) {
* @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setWpa2EnterpriseConfig(
+ public @NonNull Builder setWpa2EnterpriseConfig(
@NonNull WifiEnterpriseConfig enterpriseConfig) {
checkNotNull(enterpriseConfig);
mWpa2EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
* @param enterpriseConfig Instance of {@link WifiEnterpriseConfig}.
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setWpa3EnterpriseConfig(
+ public @NonNull Builder setWpa3EnterpriseConfig(
@NonNull WifiEnterpriseConfig enterpriseConfig) {
checkNotNull(enterpriseConfig);
mWpa3EnterpriseConfig = new WifiEnterpriseConfig(enterpriseConfig);
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsHiddenSsid() {
+ public @NonNull Builder setIsHiddenSsid() {
mIsHiddenSSID = true;
return this;
}
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsAppInteractionRequired() {
+ public @NonNull Builder setIsAppInteractionRequired() {
mIsAppInteractionRequired = true;
return this;
}
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsUserInteractionRequired() {
+ public @NonNull Builder setIsUserInteractionRequired() {
mIsUserInteractionRequired = true;
return this;
}
* @return Instance of {@link Builder} to enable chaining of the builder method.
* @throws IllegalArgumentException if the priority value is negative.
*/
- public Builder setPriority(int priority) {
+ public @NonNull Builder setPriority(int priority) {
if (priority < 0) {
throw new IllegalArgumentException("Invalid priority value " + priority);
}
*
* @return Instance of {@link Builder} to enable chaining of the builder method.
*/
- public Builder setIsMetered() {
+ public @NonNull Builder setIsMetered() {
mIsMetered = true;
return this;
}
* @return Instance of {@link WifiNetworkSuggestion}.
* @throws IllegalStateException on invalid params set.
*/
- public WifiNetworkSuggestion build() {
+ public @NonNull WifiNetworkSuggestion build() {
if (mSsid == null) {
throw new IllegalStateException("setSsid should be invoked for suggestion");
}
this.suggestorPackageName = suggestorPackageName;
}
- public static final @android.annotation.NonNull Creator<WifiNetworkSuggestion> CREATOR =
+ public static final @NonNull Creator<WifiNetworkSuggestion> CREATOR =
new Creator<WifiNetworkSuggestion>() {
@Override
public WifiNetworkSuggestion createFromParcel(Parcel in) {