summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHai Shalom <haishalom@google.com>2020-02-13 23:37:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-13 23:37:51 +0000
commitd001198b09b648457c180627fc53696686456d3b (patch)
tree517e92a1c2b281a95959bde00781518d8e1c0bf5
parent23b3957e5ef946e472955edb873b0d10e9d9455c (diff)
parentfe5a17436194a3644ee2b1a6c05182b537030dc2 (diff)
Merge "[Passpoint] HS2.0 ANQP elements are not requested from R1 AP"
-rw-r--r--service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java28
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/ANQPRequestManagerTest.java10
2 files changed, 23 insertions, 15 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java b/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java
index 4e7a0ab22..1fc47e03a 100644
--- a/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java
+++ b/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java
@@ -73,12 +73,12 @@ public class ANQPRequestManager {
Constants.ANQPElementType.ANQPIPAddrAvailability,
Constants.ANQPElementType.ANQPNAIRealm,
Constants.ANQPElementType.ANQP3GPPNetwork,
- Constants.ANQPElementType.ANQPDomName);
-
- private static final List<Constants.ANQPElementType> R2_ANQP_BASE_SET = Arrays.asList(
+ Constants.ANQPElementType.ANQPDomName,
Constants.ANQPElementType.HSFriendlyName,
Constants.ANQPElementType.HSWANMetrics,
- Constants.ANQPElementType.HSConnCapability,
+ Constants.ANQPElementType.HSConnCapability);
+
+ private static final List<Constants.ANQPElementType> R2_ANQP_BASE_SET = Arrays.asList(
Constants.ANQPElementType.HSOSUProviders);
/**
@@ -124,12 +124,8 @@ public class ANQPRequestManager {
return false;
}
- boolean requestHs20Elements = (hsReleaseVer != NetworkDetail.HSRelease.R1
- && hsReleaseVer != NetworkDetail.HSRelease.Unknown);
-
// No need to hold off future requests for send failures.
- if (!mPasspointHandler.requestANQP(bssid, getRequestElementIDs(rcOIs,
- requestHs20Elements))) {
+ if (!mPasspointHandler.requestANQP(bssid, getRequestElementIDs(rcOIs, hsReleaseVer))) {
return false;
}
@@ -198,20 +194,26 @@ public class ANQPRequestManager {
* and the ANQP OI count indicated in the Information Element.
*
* @param rcOIs Flag indicating the inclusion of roaming consortium OIs
- * @param hsReleaseR2 Flag indicating support of Hotspot 2.0 Release 2
+ * @param hsRelease Hotspot 2.0 Release version of the AP
* @return List of ANQP Element ID
*/
private static List<Constants.ANQPElementType> getRequestElementIDs(boolean rcOIs,
- boolean hsReleaseR2) {
+ NetworkDetail.HSRelease hsRelease) {
List<Constants.ANQPElementType> requestList = new ArrayList<>();
requestList.addAll(R1_ANQP_BASE_SET);
if (rcOIs) {
requestList.add(Constants.ANQPElementType.ANQPRoamingConsortium);
}
- if (hsReleaseR2) {
- requestList.addAll(R2_ANQP_BASE_SET);
+ if (hsRelease == NetworkDetail.HSRelease.R1) {
+ // Return R1 ANQP request list
+ return requestList;
}
+
+ requestList.addAll(R2_ANQP_BASE_SET);
+
+ // Return R2+ ANQP request list. This also includes the Unknown version, which may imply
+ // a future version.
return requestList;
}
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/ANQPRequestManagerTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/ANQPRequestManagerTest.java
index 6559ac448..2f84c0d3c 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/ANQPRequestManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/ANQPRequestManagerTest.java
@@ -54,7 +54,10 @@ public class ANQPRequestManagerTest extends WifiBaseTest {
Constants.ANQPElementType.ANQPIPAddrAvailability,
Constants.ANQPElementType.ANQPNAIRealm,
Constants.ANQPElementType.ANQP3GPPNetwork,
- Constants.ANQPElementType.ANQPDomName);
+ Constants.ANQPElementType.ANQPDomName,
+ Constants.ANQPElementType.HSFriendlyName,
+ Constants.ANQPElementType.HSWANMetrics,
+ Constants.ANQPElementType.HSConnCapability);
private static final List<Constants.ANQPElementType> R1_ANQP_WITH_RC = Arrays.asList(
Constants.ANQPElementType.ANQPVenueName,
@@ -62,6 +65,9 @@ public class ANQPRequestManagerTest extends WifiBaseTest {
Constants.ANQPElementType.ANQPNAIRealm,
Constants.ANQPElementType.ANQP3GPPNetwork,
Constants.ANQPElementType.ANQPDomName,
+ Constants.ANQPElementType.HSFriendlyName,
+ Constants.ANQPElementType.HSWANMetrics,
+ Constants.ANQPElementType.HSConnCapability,
Constants.ANQPElementType.ANQPRoamingConsortium);
private static final List<Constants.ANQPElementType> R1R2_ANQP_WITHOUT_RC = Arrays.asList(
@@ -81,10 +87,10 @@ public class ANQPRequestManagerTest extends WifiBaseTest {
Constants.ANQPElementType.ANQPNAIRealm,
Constants.ANQPElementType.ANQP3GPPNetwork,
Constants.ANQPElementType.ANQPDomName,
- Constants.ANQPElementType.ANQPRoamingConsortium,
Constants.ANQPElementType.HSFriendlyName,
Constants.ANQPElementType.HSWANMetrics,
Constants.ANQPElementType.HSConnCapability,
+ Constants.ANQPElementType.ANQPRoamingConsortium,
Constants.ANQPElementType.HSOSUProviders);
@Mock