Loading api/current.txt +1 −5 Original line number Diff line number Diff line Loading @@ -31129,11 +31129,6 @@ package android.net.wifi { field @Deprecated public static final String[] strings; } @Deprecated public static class WifiConfiguration.SuiteBCipher { field @Deprecated public static final int ECDHE_ECDSA = 0; // 0x0 field @Deprecated public static final int ECDHE_RSA = 1; // 0x1 } public class WifiEnterpriseConfig implements android.os.Parcelable { ctor public WifiEnterpriseConfig(); ctor public WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig); Loading Loading @@ -31616,6 +31611,7 @@ package android.net.wifi.hotspot2 { method public android.net.wifi.hotspot2.pps.Credential getCredential(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); method public long getSubscriptionExpirationTimeInMillis(); method @NonNull public String getUniqueId() throws java.lang.IllegalStateException; method public boolean isOsuProvisioned(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); wifi/java/android/net/wifi/WifiConfiguration.java +3 −2 Original line number Diff line number Diff line Loading @@ -373,6 +373,7 @@ public class WifiConfiguration implements Parcelable { * ECDHE_ECDSA * ECDHE_RSA * </pre> * @hide */ public static class SuiteBCipher { private SuiteBCipher() { } Loading Loading @@ -715,8 +716,8 @@ public class WifiConfiguration implements Parcelable { public BitSet allowedGroupManagementCiphers; /** * The set of SuiteB ciphers supported by this configuration. * To be used for WPA3-Enterprise mode. * See {@link SuiteBCipher} for descriptions of the values. * To be used for WPA3-Enterprise mode. Set automatically by the framework based on the * certificate type that is used in this configuration. */ @NonNull public BitSet allowedSuiteBCiphers; Loading wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java +15 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.net.wifi.hotspot2; import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE; import static android.net.wifi.WifiConfiguration.MeteredOverride; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.net.wifi.hotspot2.pps.Credential; Loading Loading @@ -895,4 +896,18 @@ public final class PasspointConfiguration implements Parcelable { public boolean isOsuProvisioned() { return getUpdateIdentifier() != Integer.MIN_VALUE; } /** * Get a unique identifier for a PasspointConfiguration object. * * @return A unique identifier * @throws IllegalStateException if Credential or HomeSP nodes are not initialized */ public @NonNull String getUniqueId() throws IllegalStateException { if (mCredential == null || mHomeSp == null || TextUtils.isEmpty(mHomeSp.getFqdn())) { throw new IllegalStateException("Credential or HomeSP are not initialized"); } return mHomeSp.getFqdn(); } } wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java +51 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.net.wifi.hotspot2; import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; Loading Loading @@ -364,4 +365,54 @@ public class PasspointConfigurationTest { assertTrue(config.validateForR2()); assertTrue(config.isOsuProvisioned()); } /** * Verify that the unique identifier generated is correct. * * @throws Exception */ @Test public void validateUniqueId() throws Exception { PasspointConfiguration config = PasspointTestUtils.createConfig(); String uniqueId; uniqueId = config.getUniqueId(); assertEquals(uniqueId, config.getHomeSp().getFqdn()); } /** * Verify that the unique identifier API generates an exception if HomeSP is not initialized. * * @throws Exception */ @Test public void validateUniqueIdExceptionWithEmptyHomeSp() throws Exception { PasspointConfiguration config = PasspointTestUtils.createConfig(); config.setHomeSp(null); boolean exceptionCaught = false; try { String uniqueId = config.getUniqueId(); } catch (IllegalStateException e) { exceptionCaught = true; } assertTrue(exceptionCaught); } /** * Verify that the unique identifier API generates an exception if Credential is not * initialized. * * @throws Exception */ @Test public void validateUniqueIdExceptionWithEmptyCredential() throws Exception { PasspointConfiguration config = PasspointTestUtils.createConfig(); config.setCredential(null); boolean exceptionCaught = false; try { String uniqueId = config.getUniqueId(); } catch (IllegalStateException e) { exceptionCaught = true; } assertTrue(exceptionCaught); } } Loading
api/current.txt +1 −5 Original line number Diff line number Diff line Loading @@ -31129,11 +31129,6 @@ package android.net.wifi { field @Deprecated public static final String[] strings; } @Deprecated public static class WifiConfiguration.SuiteBCipher { field @Deprecated public static final int ECDHE_ECDSA = 0; // 0x0 field @Deprecated public static final int ECDHE_RSA = 1; // 0x1 } public class WifiEnterpriseConfig implements android.os.Parcelable { ctor public WifiEnterpriseConfig(); ctor public WifiEnterpriseConfig(android.net.wifi.WifiEnterpriseConfig); Loading Loading @@ -31616,6 +31611,7 @@ package android.net.wifi.hotspot2 { method public android.net.wifi.hotspot2.pps.Credential getCredential(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); method public long getSubscriptionExpirationTimeInMillis(); method @NonNull public String getUniqueId() throws java.lang.IllegalStateException; method public boolean isOsuProvisioned(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp);
wifi/java/android/net/wifi/WifiConfiguration.java +3 −2 Original line number Diff line number Diff line Loading @@ -373,6 +373,7 @@ public class WifiConfiguration implements Parcelable { * ECDHE_ECDSA * ECDHE_RSA * </pre> * @hide */ public static class SuiteBCipher { private SuiteBCipher() { } Loading Loading @@ -715,8 +716,8 @@ public class WifiConfiguration implements Parcelable { public BitSet allowedGroupManagementCiphers; /** * The set of SuiteB ciphers supported by this configuration. * To be used for WPA3-Enterprise mode. * See {@link SuiteBCipher} for descriptions of the values. * To be used for WPA3-Enterprise mode. Set automatically by the framework based on the * certificate type that is used in this configuration. */ @NonNull public BitSet allowedSuiteBCiphers; Loading
wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java +15 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.net.wifi.hotspot2; import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE; import static android.net.wifi.WifiConfiguration.MeteredOverride; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.net.wifi.hotspot2.pps.Credential; Loading Loading @@ -895,4 +896,18 @@ public final class PasspointConfiguration implements Parcelable { public boolean isOsuProvisioned() { return getUpdateIdentifier() != Integer.MIN_VALUE; } /** * Get a unique identifier for a PasspointConfiguration object. * * @return A unique identifier * @throws IllegalStateException if Credential or HomeSP nodes are not initialized */ public @NonNull String getUniqueId() throws IllegalStateException { if (mCredential == null || mHomeSp == null || TextUtils.isEmpty(mHomeSp.getFqdn())) { throw new IllegalStateException("Credential or HomeSP are not initialized"); } return mHomeSp.getFqdn(); } }
wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java +51 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.net.wifi.hotspot2; import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; Loading Loading @@ -364,4 +365,54 @@ public class PasspointConfigurationTest { assertTrue(config.validateForR2()); assertTrue(config.isOsuProvisioned()); } /** * Verify that the unique identifier generated is correct. * * @throws Exception */ @Test public void validateUniqueId() throws Exception { PasspointConfiguration config = PasspointTestUtils.createConfig(); String uniqueId; uniqueId = config.getUniqueId(); assertEquals(uniqueId, config.getHomeSp().getFqdn()); } /** * Verify that the unique identifier API generates an exception if HomeSP is not initialized. * * @throws Exception */ @Test public void validateUniqueIdExceptionWithEmptyHomeSp() throws Exception { PasspointConfiguration config = PasspointTestUtils.createConfig(); config.setHomeSp(null); boolean exceptionCaught = false; try { String uniqueId = config.getUniqueId(); } catch (IllegalStateException e) { exceptionCaught = true; } assertTrue(exceptionCaught); } /** * Verify that the unique identifier API generates an exception if Credential is not * initialized. * * @throws Exception */ @Test public void validateUniqueIdExceptionWithEmptyCredential() throws Exception { PasspointConfiguration config = PasspointTestUtils.createConfig(); config.setCredential(null); boolean exceptionCaught = false; try { String uniqueId = config.getUniqueId(); } catch (IllegalStateException e) { exceptionCaught = true; } assertTrue(exceptionCaught); } }