Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

phone settings: do not present duplicate operators to the user

filter out duplicates; use the operator numeric representation as the
criteria for finding duplicates since the numeric is what is actually
used when manually selecting an operator.

Change-Id: I71619a78d52d387bab938856ca6d0232105691cc
  • Loading branch information...
commit 1359c7e501d87c52ce02d534a09a23c1ec06e07a 1 parent e1b36d0
@dferg dferg authored Whitehawkx committed
Showing with 15 additions and 7 deletions.
  1. +15 −7 src/com/android/phone/NetworkSetting.java
View
22 src/com/android/phone/NetworkSetting.java
@@ -42,6 +42,7 @@
import java.util.HashMap;
import java.util.List;
+import java.util.ArrayList;
/**
* "Networks" settings UI for the Phone app.
@@ -407,14 +408,21 @@ private void networksListLoaded(List<OperatorInfo> result, int status) {
// create a preference for each item in the list.
// just use the operator name instead of the mildly
// confusing mcc/mnc.
+ ArrayList <String> operatorNumerics = new ArrayList<String>();
for (OperatorInfo ni : result) {
- Preference carrier = new Preference(this, null);
- carrier.setTitle(getNetworkTitle(ni));
- carrier.setPersistent(false);
- mNetworkList.addPreference(carrier);
- mNetworkMap.put(carrier, ni);
-
- if (DBG) log(" " + ni);
+ String operatorNumeric = ni.getOperatorNumeric();
+ if (!operatorNumerics.contains(operatorNumeric)) {
+ operatorNumerics.add(operatorNumeric);
+ Preference carrier = new Preference(this, null);
+ carrier.setTitle(getNetworkTitle(ni));
+ carrier.setPersistent(false);
+ mNetworkList.addPreference(carrier);
+ mNetworkMap.put(carrier, ni);
+
+ if (DBG) log(" adding: " + ni);
+ } else {
+ if (DBG) log(" skipping: " + ni);
+ }
}
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.