diff options
author | Andrew Xie <andrew.w.xie@gmail.com> | 2013-02-06 21:51:46 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-03-24 15:40:06 -0700 |
commit | 7d6cc8cbc31e6c3772b64e72424e063e1fb726a0 (patch) | |
tree | 42ee64cf64881ed96de7fc7f92bf58331cf81cc7 /src | |
parent | 381611b6d59a32ce01a5594f1d4b528e16a88257 (diff) | |
download | packages_apps_settings-7d6cc8cbc31e6c3772b64e72424e063e1fb726a0.zip packages_apps_settings-7d6cc8cbc31e6c3772b64e72424e063e1fb726a0.tar.gz packages_apps_settings-7d6cc8cbc31e6c3772b64e72424e063e1fb726a0.tar.bz2 |
Fix FC when trying to adjust radio band via *#*#4636#*#* dialer code.
Fixes:
1. Add additional strings to BAND_NAMES array for additional bands from ril.h
2. Fix logic when adding band strings to selection list (for loop ends before entire array is read)
Change-Id: I5ff883a469f757a30c71d7d72c8f6ace19ce7a4d
Signed-off-by: Andrew Xie <andrew.w.xie@gmail.com>
(cherry picked from commit 4845045bb2dfd9b1a67f9f0c62bb44bfc5152284)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/BandMode.java | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/src/com/android/settings/BandMode.java b/src/com/android/settings/BandMode.java index 0a0f77f..d69d054 100644 --- a/src/com/android/settings/BandMode.java +++ b/src/com/android/settings/BandMode.java @@ -17,18 +17,14 @@ import android.widget.ListView; import android.widget.ArrayAdapter; import android.widget.AdapterView; - /** * Radio Band Mode Selection Class - * - * It will query baseband about all available band modes and display them - * in screen. It will display all six band modes if the query failed. - * - * After user select one band, it will send the selection to baseband. - * - * It will alter user the result of select operation and exit, no matter success - * or not. - * + * This will query the device for all available band modes + * and display the options on the screen. If however it fails it will then + * display all the available band modes that are in the BAND_NAMES array. + * After the user selects a band, it will attempt to set the band mode + * regardless of the outcome. However if the bandmode will not work RIL.Java + * will catch it and throw a GENERIC_FAILURE or RADIO_NOT_AVAILABLE error */ public class BandMode extends Activity { private static final String LOG_TAG = "phone"; @@ -36,14 +32,31 @@ public class BandMode extends Activity { private static final int EVENT_BAND_SCAN_COMPLETED = 100; private static final int EVENT_BAND_SELECTION_DONE = 200; - +/* +* pulled from hardware/ril/include/telephony/ril.h and cleaned up a little +* there ought to be a better way to do this... +* make queryAvailableBandMode return something other than just an int array? +*/ private static final String[] BAND_NAMES = new String[] { "Automatic", - "EURO Band", - "USA Band", - "JAPAN Band", - "AUS Band", - "AUS2 Band" + "EURO Band (GSM-900/DCS-1800/WCDMA-IMT-2000)", + "USA Band (GSM-850/PCS-1900/WCDMA-850/WCDMA-PCS-1900)", + "JAPAN Band (WCDMA-800/WCDMA-IMT-2000)", + "AUS Band (GSM-900/DCS-1800/WCDMA-850/WCDMA-IMT-2000)", + "AUS2 Band (GSM-900/DCS-1800/WCDMA-850)", + "Cellular (800-MHz)", + "PCS (1900-MHz)", + "Band Class 3 (JTACS Band)", + "Band Class 4 (Korean PCS Band)", + "Band Class 5 (450-MHz Band)", + "Band Class 6 (2-GMHz IMT2000 Band)", + "Band Class 7 (Upper 700-MHz Band)", + "Band Class 8 (1800-MHz Band)", + "Band Class 9 (900-MHz Band)", + "Band Class 10 (Secondary 800-MHz Band)", + "Band Class 11 (400-MHz European PAMR Band)", + "Band Class 15 (AWS Band)", + "Band Class 16 (US 2.5-GHz Band)" }; private ListView mBandList; @@ -141,21 +154,18 @@ public class BandMode extends Activity { if (result.result != null) { int bands[] = (int[])result.result; - int size = bands[0]; - if (size > 0) { - for (int i=1; i<size; i++) { - item = new BandListItem(bands[i]); - mBandListAdapter.add(item); - if (DBG) log("Add " + item.toString()); - } - addBandSuccess = true; + for (int i=0; i<bands.length; i++) { + item = new BandListItem(bands[i]); + mBandListAdapter.add(item); + if (DBG) log("Add " + item.toString()); } + addBandSuccess = true; } if (addBandSuccess == false) { if (DBG) log("Error in query, add default list"); - for (int i=0; i<Phone.BM_BOUNDARY; i++) { + for (int i=0; i<BAND_NAMES.length; i++) { item = new BandListItem(i); mBandListAdapter.add(item); if (DBG) log("Add default " + item.toString()); |