Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efec33e7 authored by Jeff Davidson's avatar Jeff Davidson
Browse files

Add a warning about the SSID format in CaptivePortalTracker.

WifiInfo#getSSID()'s behavior around surrounding the SSID with double
quotes changed in API 17. Since clients of CaptivePortalTracker may
have already taken this into account, we should make sure not to add
logic which changes the format of the SSID included in latency
broadcasts, soas not to break such logic.

Bug: 12934066
Change-Id: I8800da42c09f429c90409083af1b31c9f720d7d4
parent 82946aae
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -421,6 +421,13 @@ public class CaptivePortalTracker extends StateMachine {
            case ConnectivityManager.TYPE_WIFI:
                WifiInfo currentWifiInfo = mWifiManager.getConnectionInfo();
                if (currentWifiInfo != null) {
                    // NOTE: getSSID()'s behavior changed in API 17; before that, SSIDs were not
                    // surrounded by double quotation marks (thus violating the Javadoc), but this
                    // was changed to match the Javadoc in API 17. Since clients may have started
                    // sanitizing the output of this method since API 17 was released, we should
                    // not change it here as it would become impossible to tell whether the SSID is
                    // simply being surrounded by quotes due to the API, or whether those quotes
                    // are actually part of the SSID.
                    latencyBroadcast.putExtra(EXTRA_SSID, currentWifiInfo.getSSID());
                    latencyBroadcast.putExtra(EXTRA_BSSID, currentWifiInfo.getBSSID());
                } else {