Merge "Fix crash issue when NetworkSelectSettings UI goes OFF and then ON"

This commit is contained in:
Treehugger Robot
2021-02-19 08:53:56 +00:00
committed by Gerrit Code Review

View File

@@ -343,16 +343,6 @@ public class NetworkSelectSettings extends DashboardFragment {
mPreferenceCategory.getPreference(numberOfPreferences)); mPreferenceCategory.getPreference(numberOfPreferences));
} }
// update selected preference instance by index
for (int index = 0; index < mCellInfoList.size(); index++) {
final CellInfo cellInfo = mCellInfoList.get(index);
if ((mSelectedPreference != null) && mSelectedPreference.isSameCell(cellInfo)) {
mSelectedPreference = (NetworkOperatorPreference)
(mPreferenceCategory.getPreference(index));
}
}
// update the content of preference // update the content of preference
NetworkOperatorPreference connectedPref = null; NetworkOperatorPreference connectedPref = null;
for (int index = 0; index < mCellInfoList.size(); index++) { for (int index = 0; index < mCellInfoList.size(); index++) {
@@ -386,6 +376,16 @@ public class NetworkSelectSettings extends DashboardFragment {
} }
} }
// update selected preference instance by index
for (int index = 0; index < mCellInfoList.size(); index++) {
final CellInfo cellInfo = mCellInfoList.get(index);
if ((mSelectedPreference != null) && mSelectedPreference.isSameCell(cellInfo)) {
mSelectedPreference = (NetworkOperatorPreference)
(mPreferenceCategory.getPreference(index));
}
}
return connectedPref; return connectedPref;
} }