diff options
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/RttManager.java | 18 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 4 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiEnterpriseConfig.java | 32 |
3 files changed, 49 insertions, 5 deletions
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java index b156d0c..d2fb0dd 100644 --- a/wifi/java/android/net/wifi/RttManager.java +++ b/wifi/java/android/net/wifi/RttManager.java @@ -808,7 +808,7 @@ public class RttManager { if (mRttCapabilities == null) { if(getRttCapabilities() == null) { Log.e(TAG, "Can not get RTT capabilities"); - //throw new IllegalStateException("RTT chip is not working"); + throw new IllegalStateException("RTT chip is not working"); } } @@ -866,6 +866,15 @@ public class RttManager { return true; } + /** + * Request to start an RTT ranging + * + * @param params -- RTT request Parameters + * @param listener -- Call back to inform RTT result + * @exception throw IllegalArgumentException when params are illegal + * throw IllegalStateException when RttCapabilities do not exist + */ + public void startRanging(RttParams[] params, RttListener listener) { int index = 0; for(RttParams rttParam : params) { @@ -874,9 +883,9 @@ public class RttManager { } index++; } - validateChannel(); ParcelableRttParams parcelableParams = new ParcelableRttParams(params); + Log.i(TAG, "Send RTT request to RTT Service"); sAsyncChannel.sendMessage(CMD_OP_START_RANGING, 0, putListener(listener), parcelableParams); } @@ -1024,6 +1033,7 @@ public class RttManager { } @Override public void handleMessage(Message msg) { + Log.i(TAG, "RTT manager get message: " + msg.what); switch (msg.what) { case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED: if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) { @@ -1049,10 +1059,10 @@ public class RttManager { Object listener = getListener(msg.arg2); if (listener == null) { - if (DBG) Log.d(TAG, "invalid listener key = " + msg.arg2); + Log.e(TAG, "invalid listener key = " + msg.arg2 ); return; } else { - if (DBG) Log.d(TAG, "listener key = " + msg.arg2); + Log.i(TAG, "listener key = " + msg.arg2); } switch (msg.what) { diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index c6f2991..b731316 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -243,6 +243,7 @@ public class WifiConfiguration implements Parcelable { * The band which AP resides on * 0-2G 1-5G * By default, 2G is chosen + * @hide */ public int apBand = 0; @@ -251,6 +252,7 @@ public class WifiConfiguration implements Parcelable { * 2G 1-11 * 5G 36,40,44,48,149,153,157,161,165 * 0 - find a random available channel according to the apBand + * @hide */ public int apChannel = 0; @@ -953,7 +955,7 @@ public class WifiConfiguration implements Parcelable { if (!TextUtils.isEmpty(FQDN)) { /* this is passpoint configuration; it must not have an SSID */ if (!TextUtils.isEmpty(SSID)) { - return "no SSID"; + return "SSID not expected for Passpoint: '" + SSID + "'"; } /* this is passpoint configuration; it must have a providerFriendlyName */ if (TextUtils.isEmpty(providerFriendlyName)) { diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java index 6917971..3525ec2 100644 --- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -56,6 +56,8 @@ public class WifiEnterpriseConfig implements Parcelable { /** @hide */ public static final String ALTSUBJECT_MATCH_KEY = "altsubject_match"; /** @hide */ + public static final String DOM_SUFFIX_MATCH_KEY = "domain_suffix_match"; + /** @hide */ public static final String OPP_KEY_CACHING = "proactive_key_caching"; /** * String representing the keystore OpenSSL ENGINE's ID. @@ -577,6 +579,36 @@ public class WifiEnterpriseConfig implements Parcelable { } /** + * Set the domain_suffix_match directive on wpa_supplicant. This is the parameter to use + * for Hotspot 2.0 defined matching of AAA server certs per WFA HS2.0 spec, section 7.3.3.2, + * second paragraph. + * + * From wpa_supplicant documentation: + * Constraint for server domain name. If set, this FQDN is used as a suffix match requirement + * for the AAAserver certificate in SubjectAltName dNSName element(s). If a matching dNSName is + * found, this constraint is met. If no dNSName values are present, this constraint is matched + * against SubjectName CN using same suffix match comparison. + * Suffix match here means that the host/domain name is compared one label at a time starting + * from the top-level domain and all the labels in domain_suffix_match shall be included in the + * certificate. The certificate may include additional sub-level labels in addition to the + * required labels. + * For example, domain_suffix_match=example.com would match test.example.com but would not + * match test-example.com. + * @param domain The domain value + */ + public void setDomainSuffixMatch(String domain) { + setFieldValue(DOM_SUFFIX_MATCH_KEY, domain); + } + + /** + * Get the domain_suffix_match value. See setDomSuffixMatch. + * @return The domain value. + */ + public String getDomainSubjectMatch() { + return getFieldValue(DOM_SUFFIX_MATCH_KEY, ""); + } + + /** * Set realm for passpoint credential * @param realm the realm */ |