fix testSoftApConfigurationGetPersistentRandomizedMacAddress fail
when the length of device name is more than 28, add 'test'
to the end of device name will exceed the limit of 32 bytes.
bug:277298111
test:run cts -m CtsWifiTestCases -t
android.net.wifi.cts.WifiManagerTest#testSoftApConfigurationGetPersistentRandomizedMacAddress
Change-Id: I93e3c8740908ce79d4d0dfe0b45c788b56b727d4
Signed-off-by: zhujiatai <zhujiatai@xiaomi.com>
diff --git a/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java b/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java
index 732e07c..0023c80 100644
--- a/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/tests/wifi/src/android/net/wifi/cts/WifiManagerTest.java
@@ -2701,9 +2701,12 @@
public void testSoftApConfigurationGetPersistentRandomizedMacAddress() throws Exception {
SoftApConfiguration currentConfig = ShellIdentityUtils.invokeWithShellPermissions(
mWifiManager::getSoftApConfiguration);
+ final String ssid = currentConfig.getSsid().length() <= 28
+ ? currentConfig.getSsid() + "test"
+ : "AndroidTest";
ShellIdentityUtils.invokeWithShellPermissions(
() -> mWifiManager.setSoftApConfiguration(new SoftApConfiguration.Builder()
- .setSsid(currentConfig.getSsid() + "test").build()));
+ .setSsid(ssid).build()));
SoftApConfiguration changedSsidConfig = ShellIdentityUtils.invokeWithShellPermissions(
mWifiManager::getSoftApConfiguration);
assertNotEquals(currentConfig.getPersistentRandomizedMacAddress(),