Fix wifi not re-ordering
Bug: 22361247 Change-Id: I5c25061735628682741060c8a699c0a977c4351b
This commit is contained in:
@@ -653,16 +653,20 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
getPreferenceScreen().removeAll();
|
getPreferenceScreen().removeAll();
|
||||||
|
|
||||||
boolean hasAvailableAccessPoints = false;
|
boolean hasAvailableAccessPoints = false;
|
||||||
|
int index = 0;
|
||||||
for (AccessPoint accessPoint : accessPoints) {
|
for (AccessPoint accessPoint : accessPoints) {
|
||||||
// Ignore access points that are out of range.
|
// Ignore access points that are out of range.
|
||||||
if (accessPoint.getLevel() != -1) {
|
if (accessPoint.getLevel() != -1) {
|
||||||
hasAvailableAccessPoints = true;
|
hasAvailableAccessPoints = true;
|
||||||
if (accessPoint.getTag() != null) {
|
if (accessPoint.getTag() != null) {
|
||||||
getPreferenceScreen().addPreference((Preference) accessPoint.getTag());
|
final Preference pref = (Preference) accessPoint.getTag();
|
||||||
|
pref.setOrder(index++);
|
||||||
|
getPreferenceScreen().addPreference(pref);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
AccessPointPreference preference = new AccessPointPreference(accessPoint,
|
AccessPointPreference preference = new AccessPointPreference(accessPoint,
|
||||||
getActivity(), mUserBadgeCache, false);
|
getActivity(), mUserBadgeCache, false);
|
||||||
|
preference.setOrder(index++);
|
||||||
|
|
||||||
if (mOpenSsid != null && mOpenSsid.equals(accessPoint.getSsidStr())
|
if (mOpenSsid != null && mOpenSsid.equals(accessPoint.getSsidStr())
|
||||||
&& !accessPoint.isSaved()
|
&& !accessPoint.isSaved()
|
||||||
|
Reference in New Issue
Block a user