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
This commit is contained in:
@@ -870,12 +870,12 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
private void addConnectedAccessPointPreference(AccessPoint connectedAp) {
|
private void addConnectedAccessPointPreference(AccessPoint connectedAp) {
|
||||||
final LongPressAccessPointPreference pref = getOrCreatePreference(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
|
// Save the state of the current access point in the bundle so that we can restore it
|
||||||
// in the Wifi Network Details Fragment
|
// in the Wifi Network Details Fragment
|
||||||
pref.getAccessPoint().saveWifiState(pref.getExtras());
|
pref.getAccessPoint().saveWifiState(pref.getExtras());
|
||||||
|
|
||||||
// Launch details page on click.
|
|
||||||
pref.setOnPreferenceClickListener(preference -> {
|
|
||||||
SettingsActivity activity = (SettingsActivity) WifiSettings.this.getActivity();
|
SettingsActivity activity = (SettingsActivity) WifiSettings.this.getActivity();
|
||||||
activity.startPreferencePanel(this,
|
activity.startPreferencePanel(this,
|
||||||
WifiNetworkDetailsFragment.class.getName(), pref.getExtras(),
|
WifiNetworkDetailsFragment.class.getName(), pref.getExtras(),
|
||||||
|
Reference in New Issue
Block a user