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

Commit 389daf02 authored by Eric Schwarzenbach's avatar Eric Schwarzenbach
Browse files

Show updated Speed Label on Wifi detail page.

Fixes a bug where the detail page sometimes doesn't show a speed label
even when WifiSettings shows it. WifiSettings stores its connected
AccessPoint in a bundle on page load and connect. If that AccessPoint's
score cache doesn't have a score yet, it won't (can't) store it in the
bundle. If the score cache is then updated, it will display a score in
WifiSettings, but since the bundle has already been saved, the
AccessPoint that WifiNetworkDetailPage receives will not have a score.

This change modifies the preference to store the bundle only once the
user clicks the preference, so the detail page will be in sync with
WifiSettings.

Bug: 67607122
Test: manual
Change-Id: I6b33129b5a03b0e3e6d6e48ea48726e8dbe840b9
parent 980e5b58
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -870,12 +870,12 @@ public class WifiSettings extends RestrictedSettingsFragment
    private void addConnectedAccessPointPreference(AccessPoint connectedAp) {
        final LongPressAccessPointPreference pref = getOrCreatePreference(connectedAp);

        // Launch details page on click.
        pref.setOnPreferenceClickListener(preference -> {
            // Save the state of the current access point in the bundle so that we can restore it
            // in the Wifi Network Details Fragment
            pref.getAccessPoint().saveWifiState(pref.getExtras());

        // Launch details page on click.
        pref.setOnPreferenceClickListener(preference -> {
            SettingsActivity activity = (SettingsActivity) WifiSettings.this.getActivity();
            activity.startPreferencePanel(this,
                    WifiNetworkDetailsFragment.class.getName(), pref.getExtras(),