Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -30654,11 +30654,11 @@ package android.net.wifi { ctor public WifiNetworkSuggestion.Builder(); 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 setCredentialSharedWithUser(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedOpen(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsHiddenSsid(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsMetered(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserAllowedToManuallyConnect(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserInteractionRequired(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPasspointConfig(@NonNull android.net.wifi.hotspot2.PasspointConfiguration); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPriority(@IntRange(from=0) int); wifi/java/android/net/wifi/WifiNetworkSuggestion.java +13 −13 Original line number Diff line number Diff line Loading @@ -116,12 +116,12 @@ public final class WifiNetworkSuggestion implements Parcelable { /** * Whether this network is shared credential with user to allow user manually connect. */ private boolean mIsUserAllowed; private boolean mIsSharedWithUser; /** * Whether the setIsUserAllowedToManuallyConnect have been called. * Whether the setCredentialSharedWithUser have been called. */ private boolean mIsUserAllowedBeenSet; private boolean mIsSharedWithUserSet; /** * Pre-shared key for use with WAPI-PSK networks. */ Loading @@ -146,8 +146,8 @@ public final class WifiNetworkSuggestion implements Parcelable { mIsAppInteractionRequired = false; mIsUserInteractionRequired = false; mIsMetered = false; mIsUserAllowed = true; mIsUserAllowedBeenSet = false; mIsSharedWithUser = true; mIsSharedWithUserSet = false; mPriority = UNASSIGNED_PRIORITY; mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID; mWapiPskPassphrase = null; Loading Loading @@ -430,13 +430,13 @@ public final class WifiNetworkSuggestion implements Parcelable { * <li>If not set, defaults to true (i.e. allow user to manually connect) for secure * networks and false for open networks.</li> * * @param isAllowed {@code true} to indicate that the credentials may be used by the user to * @param isShared {@code true} to indicate that the credentials may be used by the user to * manually connect to the network, {@code false} otherwise. * @return Instance of {@link Builder} to enable chaining of the builder method. */ public @NonNull Builder setIsUserAllowedToManuallyConnect(boolean isAllowed) { mIsUserAllowed = isAllowed; mIsUserAllowedBeenSet = true; public @NonNull Builder setCredentialSharedWithUser(boolean isShared) { mIsSharedWithUser = isShared; mIsSharedWithUserSet = true; return this; } Loading Loading @@ -602,11 +602,11 @@ public final class WifiNetworkSuggestion implements Parcelable { } wifiConfiguration = buildWifiConfiguration(); if (wifiConfiguration.isOpenNetwork()) { if (mIsUserAllowedBeenSet && mIsUserAllowed) { if (mIsSharedWithUserSet && mIsSharedWithUser) { throw new IllegalStateException("Open network should not be " + "setIsUserAllowedToManuallyConnect to true"); + "setCredentialSharedWithUser to true"); } mIsUserAllowed = false; mIsSharedWithUser = false; } } Loading @@ -615,7 +615,7 @@ public final class WifiNetworkSuggestion implements Parcelable { mPasspointConfiguration, mIsAppInteractionRequired, mIsUserInteractionRequired, mIsUserAllowed); mIsSharedWithUser); } } Loading wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public class WifiNetworkSuggestionTest { .setSsid(TEST_SSID) .setWpa2Passphrase(TEST_PRESHARED_KEY) .setIsAppInteractionRequired(true) .setIsUserAllowedToManuallyConnect(false) .setCredentialSharedWithUser(false) .setPriority(0) .build(); Loading Loading @@ -151,7 +151,7 @@ public class WifiNetworkSuggestionTest { WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder() .setSsid(TEST_SSID) .setWpa3Passphrase(TEST_PRESHARED_KEY) .setIsUserAllowedToManuallyConnect(true) .setCredentialSharedWithUser(true) .build(); assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID); Loading Loading @@ -709,14 +709,14 @@ public class WifiNetworkSuggestionTest { /** * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception * when {@link WifiNetworkSuggestion.Builder#setIsUserAllowedToManuallyConnect(boolean)} to * when {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} to * true on a open network suggestion. */ @Test(expected = IllegalStateException.class) public void testSetIsUserAllowedToManuallyConnectToWithOpenNetwork() { WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder() .setSsid(TEST_SSID) .setIsUserAllowedToManuallyConnect(true) .setCredentialSharedWithUser(true) .build(); } } Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -30654,11 +30654,11 @@ package android.net.wifi { ctor public WifiNetworkSuggestion.Builder(); 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 setCredentialSharedWithUser(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedOpen(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsHiddenSsid(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsMetered(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserAllowedToManuallyConnect(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserInteractionRequired(boolean); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPasspointConfig(@NonNull android.net.wifi.hotspot2.PasspointConfiguration); method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPriority(@IntRange(from=0) int);
wifi/java/android/net/wifi/WifiNetworkSuggestion.java +13 −13 Original line number Diff line number Diff line Loading @@ -116,12 +116,12 @@ public final class WifiNetworkSuggestion implements Parcelable { /** * Whether this network is shared credential with user to allow user manually connect. */ private boolean mIsUserAllowed; private boolean mIsSharedWithUser; /** * Whether the setIsUserAllowedToManuallyConnect have been called. * Whether the setCredentialSharedWithUser have been called. */ private boolean mIsUserAllowedBeenSet; private boolean mIsSharedWithUserSet; /** * Pre-shared key for use with WAPI-PSK networks. */ Loading @@ -146,8 +146,8 @@ public final class WifiNetworkSuggestion implements Parcelable { mIsAppInteractionRequired = false; mIsUserInteractionRequired = false; mIsMetered = false; mIsUserAllowed = true; mIsUserAllowedBeenSet = false; mIsSharedWithUser = true; mIsSharedWithUserSet = false; mPriority = UNASSIGNED_PRIORITY; mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID; mWapiPskPassphrase = null; Loading Loading @@ -430,13 +430,13 @@ public final class WifiNetworkSuggestion implements Parcelable { * <li>If not set, defaults to true (i.e. allow user to manually connect) for secure * networks and false for open networks.</li> * * @param isAllowed {@code true} to indicate that the credentials may be used by the user to * @param isShared {@code true} to indicate that the credentials may be used by the user to * manually connect to the network, {@code false} otherwise. * @return Instance of {@link Builder} to enable chaining of the builder method. */ public @NonNull Builder setIsUserAllowedToManuallyConnect(boolean isAllowed) { mIsUserAllowed = isAllowed; mIsUserAllowedBeenSet = true; public @NonNull Builder setCredentialSharedWithUser(boolean isShared) { mIsSharedWithUser = isShared; mIsSharedWithUserSet = true; return this; } Loading Loading @@ -602,11 +602,11 @@ public final class WifiNetworkSuggestion implements Parcelable { } wifiConfiguration = buildWifiConfiguration(); if (wifiConfiguration.isOpenNetwork()) { if (mIsUserAllowedBeenSet && mIsUserAllowed) { if (mIsSharedWithUserSet && mIsSharedWithUser) { throw new IllegalStateException("Open network should not be " + "setIsUserAllowedToManuallyConnect to true"); + "setCredentialSharedWithUser to true"); } mIsUserAllowed = false; mIsSharedWithUser = false; } } Loading @@ -615,7 +615,7 @@ public final class WifiNetworkSuggestion implements Parcelable { mPasspointConfiguration, mIsAppInteractionRequired, mIsUserInteractionRequired, mIsUserAllowed); mIsSharedWithUser); } } Loading
wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public class WifiNetworkSuggestionTest { .setSsid(TEST_SSID) .setWpa2Passphrase(TEST_PRESHARED_KEY) .setIsAppInteractionRequired(true) .setIsUserAllowedToManuallyConnect(false) .setCredentialSharedWithUser(false) .setPriority(0) .build(); Loading Loading @@ -151,7 +151,7 @@ public class WifiNetworkSuggestionTest { WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder() .setSsid(TEST_SSID) .setWpa3Passphrase(TEST_PRESHARED_KEY) .setIsUserAllowedToManuallyConnect(true) .setCredentialSharedWithUser(true) .build(); assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID); Loading Loading @@ -709,14 +709,14 @@ public class WifiNetworkSuggestionTest { /** * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception * when {@link WifiNetworkSuggestion.Builder#setIsUserAllowedToManuallyConnect(boolean)} to * when {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} to * true on a open network suggestion. */ @Test(expected = IllegalStateException.class) public void testSetIsUserAllowedToManuallyConnectToWithOpenNetwork() { WifiNetworkSuggestion suggestion = new WifiNetworkSuggestion.Builder() .setSsid(TEST_SSID) .setIsUserAllowedToManuallyConnect(true) .setCredentialSharedWithUser(true) .build(); } }