diff options
author | Etan Cohen <etancohen@google.com> | 2019-12-13 18:32:50 -0800 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2019-12-13 18:32:50 -0800 |
commit | 750640c26942856f3d47a12fb9d6439cbc318957 (patch) | |
tree | 1b7317262da4283f36807f7e2bdf46daa6602fc3 /tests | |
parent | cdf50099aceca8271b620588ad48ee0d7e2f3cc4 (diff) |
[AWARE] Add API to expose supported cipher suites
Provide a new Aware capabilities API which exposes the supported
cipher suites. These cipher suites are used to negotiate the data-
path. The framework automatially selects the strongest cipher suite
when it initiates a negotiation.
Bug: 145697276
Test: atest com.android.server.wifi.aware
Test: (CTS) atest SingleDeviceTest
Change-Id: I5bed4b14df67766d352c0c25a86b0dc76d646e8a
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java index 044e02b4e..3e4089056 100644 --- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java @@ -34,6 +34,7 @@ import android.Manifest; import android.app.AppOpsManager; import android.content.Context; import android.content.pm.PackageManager; +import android.hardware.wifi.V1_0.NanCipherSuiteType; import android.net.wifi.aware.Characteristics; import android.net.wifi.aware.ConfigRequest; import android.net.wifi.aware.IWifiAwareDiscoverySessionCallback; @@ -617,6 +618,35 @@ public class WifiAwareServiceImplTest extends WifiBaseTest { }); } + @Test + public void testCapabilityTranslation() { + final int maxServiceName = 66; + final int maxServiceSpecificInfo = 69; + final int maxMatchFilter = 55; + + Capabilities cap = new Capabilities(); + cap.maxConcurrentAwareClusters = 1; + cap.maxPublishes = 2; + cap.maxSubscribes = 2; + cap.maxServiceNameLen = maxServiceName; + cap.maxMatchFilterLen = maxMatchFilter; + cap.maxTotalMatchFilterLen = 255; + cap.maxServiceSpecificInfoLen = maxServiceSpecificInfo; + cap.maxExtendedServiceSpecificInfoLen = MAX_LENGTH; + cap.maxNdiInterfaces = 1; + cap.maxNdpSessions = 1; + cap.maxAppInfoLen = 255; + cap.maxQueuedTransmitMessages = 6; + cap.supportedCipherSuites = NanCipherSuiteType.SHARED_KEY_256_MASK; + + Characteristics characteristics = cap.toPublicCharacteristics(); + assertEquals(characteristics.getMaxServiceNameLength(), maxServiceName); + assertEquals(characteristics.getMaxServiceSpecificInfoLength(), maxServiceSpecificInfo); + assertEquals(characteristics.getMaxMatchFilterLength(), maxMatchFilter); + assertEquals(characteristics.getSupportedCipherSuites(), + Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_SK_256); + } + /* * Utilities */ @@ -695,6 +725,7 @@ public class WifiAwareServiceImplTest extends WifiBaseTest { cap.maxNdpSessions = 1; cap.maxAppInfoLen = 255; cap.maxQueuedTransmitMessages = 6; + cap.supportedCipherSuites = NanCipherSuiteType.SHARED_KEY_256_MASK; return cap.toPublicCharacteristics(); } |