diff options
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 = |