Merge changes Iaa6f0d65,I68a16b64 am: 23d84d343b am: 2f8ac6dd48
Change-Id: I7e66156659fb88110d2a7f027d488e15499caee2
This commit is contained in:
@@ -367,12 +367,12 @@ public class NetworkPolicyManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String resolveNetworkId(WifiConfiguration config) {
|
public static String resolveNetworkId(WifiConfiguration config) {
|
||||||
return WifiInfo.removeDoubleQuotes(config.isPasspoint()
|
return WifiInfo.sanitizeSsid(config.isPasspoint()
|
||||||
? config.providerFriendlyName : config.SSID);
|
? config.providerFriendlyName : config.SSID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String resolveNetworkId(String ssid) {
|
public static String resolveNetworkId(String ssid) {
|
||||||
return WifiInfo.removeDoubleQuotes(ssid);
|
return WifiInfo.sanitizeSsid(ssid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import static android.net.NetworkStats.METERED_YES;
|
|||||||
import static android.net.NetworkStats.ROAMING_ALL;
|
import static android.net.NetworkStats.ROAMING_ALL;
|
||||||
import static android.net.NetworkStats.ROAMING_NO;
|
import static android.net.NetworkStats.ROAMING_NO;
|
||||||
import static android.net.NetworkStats.ROAMING_YES;
|
import static android.net.NetworkStats.ROAMING_YES;
|
||||||
import static android.net.wifi.WifiInfo.removeDoubleQuotes;
|
import static android.net.wifi.WifiInfo.sanitizeSsid;
|
||||||
|
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
@@ -401,7 +401,7 @@ public class NetworkTemplate implements Parcelable {
|
|||||||
switch (ident.mType) {
|
switch (ident.mType) {
|
||||||
case TYPE_WIFI:
|
case TYPE_WIFI:
|
||||||
return Objects.equals(
|
return Objects.equals(
|
||||||
removeDoubleQuotes(mNetworkId), removeDoubleQuotes(ident.mNetworkId));
|
sanitizeSsid(mNetworkId), sanitizeSsid(ident.mNetworkId));
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,14 +188,14 @@ public class NetworkNotificationManager {
|
|||||||
int icon = getIcon(transportType, notifyType);
|
int icon = getIcon(transportType, notifyType);
|
||||||
if (notifyType == NotificationType.NO_INTERNET && transportType == TRANSPORT_WIFI) {
|
if (notifyType == NotificationType.NO_INTERNET && transportType == TRANSPORT_WIFI) {
|
||||||
title = r.getString(R.string.wifi_no_internet,
|
title = r.getString(R.string.wifi_no_internet,
|
||||||
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
WifiInfo.sanitizeSsid(nai.networkCapabilities.getSSID()));
|
||||||
details = r.getString(R.string.wifi_no_internet_detailed);
|
details = r.getString(R.string.wifi_no_internet_detailed);
|
||||||
} else if (notifyType == NotificationType.PRIVATE_DNS_BROKEN) {
|
} else if (notifyType == NotificationType.PRIVATE_DNS_BROKEN) {
|
||||||
if (transportType == TRANSPORT_CELLULAR) {
|
if (transportType == TRANSPORT_CELLULAR) {
|
||||||
title = r.getString(R.string.mobile_no_internet);
|
title = r.getString(R.string.mobile_no_internet);
|
||||||
} else if (transportType == TRANSPORT_WIFI) {
|
} else if (transportType == TRANSPORT_WIFI) {
|
||||||
title = r.getString(R.string.wifi_no_internet,
|
title = r.getString(R.string.wifi_no_internet,
|
||||||
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
WifiInfo.sanitizeSsid(nai.networkCapabilities.getSSID()));
|
||||||
} else {
|
} else {
|
||||||
title = r.getString(R.string.other_networks_no_internet);
|
title = r.getString(R.string.other_networks_no_internet);
|
||||||
}
|
}
|
||||||
@@ -203,19 +203,19 @@ public class NetworkNotificationManager {
|
|||||||
} else if (notifyType == NotificationType.PARTIAL_CONNECTIVITY
|
} else if (notifyType == NotificationType.PARTIAL_CONNECTIVITY
|
||||||
&& transportType == TRANSPORT_WIFI) {
|
&& transportType == TRANSPORT_WIFI) {
|
||||||
title = r.getString(R.string.network_partial_connectivity,
|
title = r.getString(R.string.network_partial_connectivity,
|
||||||
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
WifiInfo.sanitizeSsid(nai.networkCapabilities.getSSID()));
|
||||||
details = r.getString(R.string.network_partial_connectivity_detailed);
|
details = r.getString(R.string.network_partial_connectivity_detailed);
|
||||||
} else if (notifyType == NotificationType.LOST_INTERNET &&
|
} else if (notifyType == NotificationType.LOST_INTERNET &&
|
||||||
transportType == TRANSPORT_WIFI) {
|
transportType == TRANSPORT_WIFI) {
|
||||||
title = r.getString(R.string.wifi_no_internet,
|
title = r.getString(R.string.wifi_no_internet,
|
||||||
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
WifiInfo.sanitizeSsid(nai.networkCapabilities.getSSID()));
|
||||||
details = r.getString(R.string.wifi_no_internet_detailed);
|
details = r.getString(R.string.wifi_no_internet_detailed);
|
||||||
} else if (notifyType == NotificationType.SIGN_IN) {
|
} else if (notifyType == NotificationType.SIGN_IN) {
|
||||||
switch (transportType) {
|
switch (transportType) {
|
||||||
case TRANSPORT_WIFI:
|
case TRANSPORT_WIFI:
|
||||||
title = r.getString(R.string.wifi_available_sign_in, 0);
|
title = r.getString(R.string.wifi_available_sign_in, 0);
|
||||||
details = r.getString(R.string.network_available_sign_in_detailed,
|
details = r.getString(R.string.network_available_sign_in_detailed,
|
||||||
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
WifiInfo.sanitizeSsid(nai.networkCapabilities.getSSID()));
|
||||||
break;
|
break;
|
||||||
case TRANSPORT_CELLULAR:
|
case TRANSPORT_CELLULAR:
|
||||||
title = r.getString(R.string.network_available_sign_in, 0);
|
title = r.getString(R.string.network_available_sign_in, 0);
|
||||||
@@ -236,7 +236,7 @@ public class NetworkNotificationManager {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (notifyType == NotificationType.LOGGED_IN) {
|
} else if (notifyType == NotificationType.LOGGED_IN) {
|
||||||
title = WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID());
|
title = WifiInfo.sanitizeSsid(nai.networkCapabilities.getSSID());
|
||||||
details = r.getString(R.string.captive_portal_logged_in_detailed);
|
details = r.getString(R.string.captive_portal_logged_in_detailed);
|
||||||
} else if (notifyType == NotificationType.NETWORK_SWITCH) {
|
} else if (notifyType == NotificationType.NETWORK_SWITCH) {
|
||||||
String fromTransport = getTransportName(transportType);
|
String fromTransport = getTransportName(transportType);
|
||||||
|
|||||||
Reference in New Issue
Block a user