Merge "Suppress the wtf log for notifications that are expected" am: fbb97ab240

am: 4e3761e1d9

Change-Id: Ia1c2a765b0fb0cc8d440c02533bdc15774a5a3ef
This commit is contained in:
Chiachang Wang
2019-06-13 02:29:06 -07:00
committed by android-build-merger

View File

@@ -178,15 +178,31 @@ public class NetworkNotificationManager {
CharSequence title; CharSequence title;
CharSequence details; CharSequence details;
int icon = getIcon(transportType, notifyType); int icon = getIcon(transportType, notifyType);
if (notifyType == NotificationType.NO_INTERNET && transportType == TRANSPORT_WIFI) { if (notifyType == NotificationType.NO_INTERNET) {
title = r.getString(R.string.wifi_no_internet, switch (transportType) {
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID())); case TRANSPORT_WIFI:
details = r.getString(R.string.wifi_no_internet_detailed); title = r.getString(R.string.wifi_no_internet,
} else if (notifyType == NotificationType.PARTIAL_CONNECTIVITY WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
&& transportType == TRANSPORT_WIFI) { details = r.getString(R.string.wifi_no_internet_detailed);
title = r.getString(R.string.network_partial_connectivity, break;
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID())); default:
details = r.getString(R.string.network_partial_connectivity_detailed); // TODO: Display notifications for those networks that provide internet.
// except VPN.
return;
}
} else if (notifyType == NotificationType.PARTIAL_CONNECTIVITY) {
switch (transportType) {
case TRANSPORT_WIFI:
title = r.getString(R.string.network_partial_connectivity,
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
details = r.getString(R.string.network_partial_connectivity_detailed);
break;
default:
// TODO: Display notifications for those networks that provide internet.
// except VPN.
return;
}
} 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,