Move AccessPointPreference.generateApKey.
Move logic into AccessPoint.java.
Bug: 64989100
Test: runtest --path
tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java
Change-Id: I822a9675263191f22e84233bf2f83a610375a815
diff --git a/src/com/android/settings/wifi/SavedAccessPointsWifiSettings.java b/src/com/android/settings/wifi/SavedAccessPointsWifiSettings.java
index 9f52159..3079f8d 100644
--- a/src/com/android/settings/wifi/SavedAccessPointsWifiSettings.java
+++ b/src/com/android/settings/wifi/SavedAccessPointsWifiSettings.java
@@ -161,7 +161,7 @@
final int accessPointsSize = accessPoints.size();
for (int i = 0; i < accessPointsSize; ++i) {
AccessPoint ap = accessPoints.get(i);
- String key = AccessPointPreference.generatePreferenceKey(ap);
+ String key = ap.getKey();
LongPressAccessPointPreference preference =
(LongPressAccessPointPreference) getCachedPreference(key);
if (preference == null) {
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 73f17f7..74fe881 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -768,7 +768,7 @@
AccessPoint accessPoint = accessPoints.get(index);
// Ignore access points that are out of range.
if (accessPoint.isReachable()) {
- String key = AccessPointPreference.generatePreferenceKey(accessPoint);
+ String key = accessPoint.getKey();
hasAvailableAccessPoints = true;
LongPressAccessPointPreference pref =
(LongPressAccessPointPreference) getCachedPreference(key);