Skip to content

Commit 1330f13

Browse files
Fan Zhangandroid-build-merger
authored andcommitted
Don't remove wifi preferences when updating AP to avoid GC.
am: 9d031f2 Change-Id: I0a4c7204dcb79880aee5db620b9642b8a1314757
2 parents 68c6d99 + 9d031f2 commit 1330f13

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/com/android/settings/wifi/WifiSettings.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import android.support.v7.preference.Preference;
4343
import android.support.v7.preference.PreferenceViewHolder;
4444
import android.text.Spannable;
45+
import android.text.TextUtils;
4546
import android.text.style.TextAppearanceSpan;
4647
import android.util.Log;
4748
import android.view.ContextMenu;
@@ -54,6 +55,7 @@
5455
import android.widget.TextView;
5556
import android.widget.TextView.BufferType;
5657
import android.widget.Toast;
58+
5759
import com.android.internal.logging.MetricsLogger;
5860
import com.android.internal.logging.MetricsProto.MetricsEvent;
5961
import com.android.settings.LinkifyUtils;
@@ -612,7 +614,6 @@ public void onAccessPointsChanged() {
612614
// AccessPoints are automatically sorted with TreeSet.
613615
final Collection<AccessPoint> accessPoints =
614616
mWifiTracker.getAccessPoints();
615-
getPreferenceScreen().removeAll();
616617

617618
boolean hasAvailableAccessPoints = false;
618619
int index = 0;
@@ -621,6 +622,9 @@ public void onAccessPointsChanged() {
621622
// Ignore access points that are out of range.
622623
if (accessPoint.getLevel() != -1) {
623624
String key = accessPoint.getBssid();
625+
if (TextUtils.isEmpty(key)) {
626+
key = accessPoint.getSsidStr();
627+
}
624628
hasAvailableAccessPoints = true;
625629
LongPressAccessPointPreference pref = (LongPressAccessPointPreference)
626630
getCachedPreference(key);

0 commit comments

Comments
 (0)