Refersh saved Wi-Fi networks
- Refresh existing saved networks with the same key of WifiEntry - Update Wi-Fi icon when connection status changes Bug: 290644817 Bug: 291032267 Bug: 293468313 Bug: 294866208 Test: Manual test make RunSettingsRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest make RunSettingsRoboTests ROBOTEST_FILTER=SavedAccessPointsPreferenceController2Test Change-Id: Ifadfb7c46edf8eda32e4ff5dcb6bb3ff086447c8
This commit is contained in:
@@ -86,9 +86,18 @@ public class WifiEntryPreference extends RestrictedPreference implements
|
||||
|
||||
setLayoutResource(R.layout.preference_access_point);
|
||||
mFrictionSld = getFrictionStateListDrawable();
|
||||
mIconInjector = iconInjector;
|
||||
setWifiEntry(wifiEntry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set updated {@link WifiEntry} to refresh the preference
|
||||
*
|
||||
* @param wifiEntry An instance of {@link WifiEntry}
|
||||
*/
|
||||
public void setWifiEntry(@NonNull WifiEntry wifiEntry) {
|
||||
mWifiEntry = wifiEntry;
|
||||
mWifiEntry.setListener(this);
|
||||
mIconInjector = iconInjector;
|
||||
refresh();
|
||||
}
|
||||
|
||||
@@ -151,14 +160,9 @@ public class WifiEntryPreference extends RestrictedPreference implements
|
||||
if (mWifiEntry instanceof HotspotNetworkEntry) {
|
||||
updateHotspotIcon(((HotspotNetworkEntry) mWifiEntry).getDeviceType());
|
||||
} else {
|
||||
int level = mWifiEntry.getLevel();
|
||||
boolean showX = mWifiEntry.shouldShowXLevelIcon();
|
||||
|
||||
if (level != mLevel || showX != mShowX) {
|
||||
mLevel = level;
|
||||
mShowX = showX;
|
||||
updateIcon(mShowX, mLevel);
|
||||
}
|
||||
mLevel = mWifiEntry.getLevel();
|
||||
mShowX = mWifiEntry.shouldShowXLevelIcon();
|
||||
updateIcon(mShowX, mLevel);
|
||||
}
|
||||
|
||||
setSummary(mWifiEntry.getSummary(false /* concise */));
|
||||
|
Reference in New Issue
Block a user