Fix the crash of BandMode app.
It crashes because of out of array boundary exception. This app
predefined a list of constant strings of band mode. Unfortunately
the actual supported band modes keep adding and the hardcoded
list can meet.
Change-Id: Ife9683924706a1606d4f72b01a5904e9aa0f782c
diff --git a/src/com/android/settings/BandMode.java b/src/com/android/settings/BandMode.java
index 0a0f77f..81e8b49 100644
--- a/src/com/android/settings/BandMode.java
+++ b/src/com/android/settings/BandMode.java
@@ -58,7 +58,7 @@
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
-
+
setContentView(R.layout.band_mode);
setTitle(getString(R.string.band_mode_title));
@@ -73,8 +73,6 @@
mBandList.setAdapter(mBandListAdapter);
mBandList.setOnItemClickListener(mBandSelectionHandler);
-
-
loadBandList();
}
@@ -109,6 +107,7 @@
}
public String toString() {
+ if (mBandMode >= BAND_NAMES.length) return "Band mode " + mBandMode;
return BAND_NAMES[mBandMode];
}
}