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

Commit 9e376b56 authored by Chalard Jean's avatar Chalard Jean Committed by android-build-merger
Browse files

Merge "Simplification of code to prevent a Log.wtf in expected cases." am: f54483b6

am: fbc68b97

Change-Id: I5f5fa22468c8db09e4eeb3d446220b4ebc396d98
parents 340f79bc fbc68b97
Loading
Loading
Loading
Loading
+14 −25
Original line number Diff line number Diff line
@@ -178,31 +178,15 @@ public class NetworkNotificationManager {
        CharSequence title;
        CharSequence details;
        int icon = getIcon(transportType, notifyType);
        if (notifyType == NotificationType.NO_INTERNET) {
            switch (transportType) {
                case TRANSPORT_WIFI:
        if (notifyType == NotificationType.NO_INTERNET && transportType == TRANSPORT_WIFI) {
            title = r.getString(R.string.wifi_no_internet,
                    WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
            details = r.getString(R.string.wifi_no_internet_detailed);
                    break;
                default:
                    // TODO: Display notifications for those networks that provide internet.
                    // except VPN.
                    return;
            }

        } else if (notifyType == NotificationType.PARTIAL_CONNECTIVITY) {
            switch (transportType) {
                case TRANSPORT_WIFI:
        } else if (notifyType == NotificationType.PARTIAL_CONNECTIVITY
                && transportType == 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 &&
                transportType == TRANSPORT_WIFI) {
            title = r.getString(R.string.wifi_no_internet,
@@ -248,6 +232,11 @@ public class NetworkNotificationManager {
            title = r.getString(R.string.network_switch_metered, toTransport);
            details = r.getString(R.string.network_switch_metered_detail, toTransport,
                    fromTransport);
        } else if (notifyType == NotificationType.NO_INTERNET
                    || notifyType == NotificationType.PARTIAL_CONNECTIVITY) {
            // NO_INTERNET and PARTIAL_CONNECTIVITY notification for non-WiFi networks
            // are sent, but they are not implemented yet.
            return;
        } else {
            Slog.wtf(TAG, "Unknown notification type " + notifyType + " on network transport "
                    + getTransportName(transportType));