diff options
author | Peter Qiu <zqiu@google.com> | 2017-04-02 16:11:29 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-02 16:11:29 +0000 |
commit | 5b01b20886b8702570651f56c7413dfd94089d43 (patch) | |
tree | 28eaea45e106afc4287c6d01c5fb2c415c2f0505 /service | |
parent | f3e692154964b83188537f046487a5f447a7551a (diff) | |
parent | 31eb1e8997a0ee98df33f6d8b3b907e0fcb070ed (diff) |
Merge "hotspot2: request ANQP element for OSU Providers" into oc-dev
am: 31eb1e8997
Change-Id: I5f08f928acdec21f41a4e424529e4731843b4184
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java | 3 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointManager.java | 20 |
2 files changed, 17 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java b/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java index dfdf4ad16..a050b1606 100644 --- a/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java +++ b/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java @@ -77,7 +77,8 @@ public class ANQPRequestManager { private static final List<Constants.ANQPElementType> R2_ANQP_BASE_SET = Arrays.asList( Constants.ANQPElementType.HSFriendlyName, Constants.ANQPElementType.HSWANMetrics, - Constants.ANQPElementType.HSConnCapability); + Constants.ANQPElementType.HSConnCapability, + Constants.ANQPElementType.HSOSUProviders); /** * Class to keep track of AP status for ANQP requests. diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java index ea7181321..deec28464 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java @@ -18,7 +18,9 @@ package com.android.server.wifi.hotspot2; import static android.net.wifi.WifiManager.ACTION_PASSPOINT_DEAUTH_IMMINENT; import static android.net.wifi.WifiManager.ACTION_PASSPOINT_ICON; +import static android.net.wifi.WifiManager.ACTION_PASSPOINT_OSU_PROVIDERS_LIST; import static android.net.wifi.WifiManager.ACTION_PASSPOINT_SUBSCRIPTION_REMEDIATION; +import static android.net.wifi.WifiManager.EXTRA_ANQP_ELEMENT_DATA; import static android.net.wifi.WifiManager.EXTRA_BSSID_LONG; import static android.net.wifi.WifiManager.EXTRA_DELAY; import static android.net.wifi.WifiManager.EXTRA_ESS; @@ -47,6 +49,7 @@ import com.android.server.wifi.WifiKeyStore; import com.android.server.wifi.WifiNative; import com.android.server.wifi.hotspot2.anqp.ANQPElement; import com.android.server.wifi.hotspot2.anqp.Constants; +import com.android.server.wifi.hotspot2.anqp.RawByteElement; import com.android.server.wifi.util.InformationElementUtil; import com.android.server.wifi.util.ScanResultUtil; @@ -118,6 +121,18 @@ public class PasspointManager { // Add new entry to the cache. mAnqpCache.addEntry(anqpKey, anqpElements); + + // Broadcast OSU providers info. + if (anqpElements.containsKey(Constants.ANQPElementType.HSOSUProviders)) { + RawByteElement osuProviders = (RawByteElement) anqpElements.get( + Constants.ANQPElementType.HSOSUProviders); + Intent intent = new Intent(ACTION_PASSPOINT_OSU_PROVIDERS_LIST); + intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); + intent.putExtra(EXTRA_BSSID_LONG, bssid); + intent.putExtra(EXTRA_ANQP_ELEMENT_DATA, osuProviders.getPayload()); + mContext.sendBroadcastAsUser(intent, UserHandle.ALL, + android.Manifest.permission.ACCESS_WIFI_STATE); + } } @Override @@ -313,11 +328,6 @@ public class PasspointManager { * @return A pair of {@link PasspointProvider} and match status. */ public Pair<PasspointProvider, PasspointMatch> matchProvider(ScanResult scanResult) { - // Nothing to be done if no Passpoint provider is installed. - if (mProviders.isEmpty()) { - return null; - } - // Retrieve the relevant information elements, mainly Roaming Consortium IE and Hotspot 2.0 // Vendor Specific IE. InformationElementUtil.RoamingConsortium roamingConsortium = |