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

Commit 36dd5cf1 authored by Stephen Chen's avatar Stephen Chen
Browse files

Change string for connected via WFA.

Bug: 34773168
Test: runtest
Change-Id: I292013c874012cca004be1078f854cb3ee145112
parent 5beefa69
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -73,8 +73,10 @@
    <!-- Summary for saved networks -->
    <string name="saved_network">Saved by <xliff:g id="name">%1$s</xliff:g></string>

    <!-- Status message of Wi-Fi when it is connected by a Wi-Fi assistant application. [CHAR LIMIT=NONE] -->
    <string name="connected_via_wfa">Connected via Wi\u2011Fi assistant</string>
    <!-- Status message of Wi-Fi when it is automatically connected by a network recommendation provider. [CHAR LIMIT=NONE] -->
    <string name="connected_via_network_scorer">Automatically connected via %1$s</string>
    <!-- Status message of Wi-Fi when it is automatically connected by a default network recommendation provider. [CHAR LIMIT=NONE] -->
    <string name="connected_via_network_scorer_default">Automatically connected via Network Quality Scorer</string>
    <!-- Status message of Wi-Fi when it is connected by Passpoint configuration. [CHAR LIMIT=NONE] -->
    <string name="connected_via_passpoint">Connected via %1$s</string>
    <!-- Status message of Wi-Fi when network has matching passpoint credentials. [CHAR LIMIT=NONE] -->
+11 −1
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.NetworkInfo.DetailedState;
import android.net.NetworkInfo.State;
import android.net.NetworkScoreManager;
import android.net.NetworkScorerAppData;
import android.net.ScoredNetwork;
import android.net.wifi.IWifiManager;
import android.net.wifi.ScanResult;
@@ -949,7 +951,15 @@ public class AccessPoint implements Comparable<AccessPoint> {
                return String.format(format, passpointProvider);
            } else if (isEphemeral) {
                // Special case for connected + ephemeral networks.
                return context.getString(R.string.connected_via_wfa);
                final NetworkScoreManager networkScoreManager = context.getSystemService(
                        NetworkScoreManager.class);
                NetworkScorerAppData scorer = networkScoreManager.getActiveScorer();
                if (scorer != null && scorer.getRecommendationServiceLabel() != null) {
                    String format = context.getString(R.string.connected_via_network_scorer);
                    return String.format(format, scorer.getRecommendationServiceLabel());
                } else {
                    return context.getString(R.string.connected_via_network_scorer_default);
                }
            }
        }