Update BandMode Names to support full list, fix off-by-one UI error.

am: 575fe1af95

* commit '575fe1af95864819d457c08e169b1af5c269bcfb':
  Update BandMode Names to support full list, fix off-by-one UI error.
This commit is contained in:
Nathan Harold
2016-02-17 00:51:20 +00:00
committed by android-build-merger

View File

@@ -38,13 +38,27 @@ public class BandMode extends Activity {
private static final int EVENT_BAND_SCAN_COMPLETED = 100; private static final int EVENT_BAND_SCAN_COMPLETED = 100;
private static final int EVENT_BAND_SELECTION_DONE = 200; private static final int EVENT_BAND_SELECTION_DONE = 200;
//Directly maps to RIL_RadioBandMode from ril.h
private static final String[] BAND_NAMES = new String[] { private static final String[] BAND_NAMES = new String[] {
"Automatic", "Automatic",
"EURO Band", "Europe",
"USA Band", "United States",
"JAPAN Band", "Japan",
"AUS Band", "Australia",
"AUS2 Band" "Australia 2",
"Cellular 800",
"PCS",
"Class 3 (JTACS)",
"Class 4 (Korea-PCS)",
"Class 5",
"Class 6 (IMT2000)",
"Class 7 (700Mhz-Upper)",
"Class 8 (1800Mhz-Upper)",
"Class 9 (900Mhz)",
"Class 10 (800Mhz-Secondary)",
"Class 11 (Europe PAMR 400Mhz)",
"Class 15 (US-AWS)",
"Class 16 (US-2500Mhz)"
}; };
private ListView mBandList; private ListView mBandList;
@@ -141,10 +155,16 @@ public class BandMode extends Activity {
if (result.result != null) { if (result.result != null) {
int bands[] = (int[])result.result; int bands[] = (int[])result.result;
if(bands.length == 0) {
Log.wtf(LOG_TAG, "No Supported Band Modes");
return;
}
int size = bands[0]; int size = bands[0];
if (size > 0) { if (size > 0) {
for (int i=1; i<size; i++) { for (int i=1; i<=size; i++) {
item = new BandListItem(bands[i]); item = new BandListItem(bands[i]);
mBandListAdapter.add(item); mBandListAdapter.add(item);
if (DBG) log("Add " + item.toString()); if (DBG) log("Add " + item.toString());
@@ -155,7 +175,7 @@ public class BandMode extends Activity {
if (addBandSuccess == false) { if (addBandSuccess == false) {
if (DBG) log("Error in query, add default list"); if (DBG) log("Error in query, add default list");
for (int i=0; i<Phone.BM_BOUNDARY; i++) { for (int i=0; i<Phone.BM_NUM_BAND_MODES; i++) {
item = new BandListItem(i); item = new BandListItem(i);
mBandListAdapter.add(item); mBandListAdapter.add(item);
if (DBG) log("Add default " + item.toString()); if (DBG) log("Add default " + item.toString());