Fix metered SSID matching regression.

WifiInfo changed to return SSIDs with quotes included, so relax our
identity matching to accept matches regardless of quotedness.

Bug: 7695807
Change-Id: Ib5d06666035e06b2d4b2f7cb498767d63b1b1828
This commit is contained in:
Jeff Sharkey
2012-12-18 17:06:06 -08:00
parent bded8b7b0d
commit 86230aca66

View File

@@ -22,6 +22,7 @@ import static android.net.ConnectivityManager.TYPE_WIFI_P2P;
import static android.net.ConnectivityManager.TYPE_WIMAX;
import static android.net.NetworkIdentity.COMBINE_SUBTYPE_ENABLED;
import static android.net.NetworkIdentity.scrubSubscriberId;
import static android.net.wifi.WifiInfo.removeDoubleQuotes;
import static android.telephony.TelephonyManager.NETWORK_CLASS_2_G;
import static android.telephony.TelephonyManager.NETWORK_CLASS_3_G;
import static android.telephony.TelephonyManager.NETWORK_CLASS_4_G;
@@ -279,7 +280,8 @@ public class NetworkTemplate implements Parcelable {
private boolean matchesWifi(NetworkIdentity ident) {
switch (ident.mType) {
case TYPE_WIFI:
return Objects.equal(mNetworkId, ident.mNetworkId);
return Objects.equal(
removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId));
default:
return false;
}