summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/BandMode.java
diff options
context:
space:
mode:
authorDerek Tan <derektan@google.com>2014-04-25 16:47:54 -0700
committerDerek Tan <derektan@google.com>2014-04-26 00:15:59 +0000
commiteb4575e8c256885ba845e773d7e9e09b99a73a65 (patch)
tree46edbe9998d416eb793e6ce5f661abd27ba95033 /src/com/android/settings/BandMode.java
parent1102f76e5852d4cc482264e67c52cabf85d7a51d (diff)
downloadpackages_apps_Settings-eb4575e8c256885ba845e773d7e9e09b99a73a65.tar.gz
packages_apps_Settings-eb4575e8c256885ba845e773d7e9e09b99a73a65.tar.bz2
packages_apps_Settings-eb4575e8c256885ba845e773d7e9e09b99a73a65.zip
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
Diffstat (limited to 'src/com/android/settings/BandMode.java')
-rw-r--r--src/com/android/settings/BandMode.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/settings/BandMode.java b/src/com/android/settings/BandMode.java
index 0a0f77fdb..81e8b4987 100644
--- a/src/com/android/settings/BandMode.java
+++ b/src/com/android/settings/BandMode.java
@@ -58,7 +58,7 @@ public class BandMode extends Activity {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
-
+
setContentView(R.layout.band_mode);
setTitle(getString(R.string.band_mode_title));
@@ -73,8 +73,6 @@ public class BandMode extends Activity {
mBandList.setAdapter(mBandListAdapter);
mBandList.setOnItemClickListener(mBandSelectionHandler);
-
-
loadBandList();
}
@@ -109,6 +107,7 @@ public class BandMode extends Activity {
}
public String toString() {
+ if (mBandMode >= BAND_NAMES.length) return "Band mode " + mBandMode;
return BAND_NAMES[mBandMode];
}
}