summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/BandMode.java
diff options
context:
space:
mode:
authorAndrew Xie <andrew.w.xie@gmail.com>2013-02-06 21:51:46 -0600
committerAdnan Begovic <adnan@cyngn.com>2015-12-09 15:45:32 -0800
commitcdc1de15ed3673463ebd51255909498bb6fb3739 (patch)
tree3d5cf8678834583c6cf928687341af2af37e6fbc /src/com/android/settings/BandMode.java
parent9e4ebaf5d1f746565f099269f9fb3674696bedbe (diff)
downloadpackages_apps_Settings-cdc1de15ed3673463ebd51255909498bb6fb3739.zip
packages_apps_Settings-cdc1de15ed3673463ebd51255909498bb6fb3739.tar.gz
packages_apps_Settings-cdc1de15ed3673463ebd51255909498bb6fb3739.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/com/android/settings/BandMode.java')
-rw-r--r--src/com/android/settings/BandMode.java60
1 files changed, 35 insertions, 25 deletions
diff --git a/src/com/android/settings/BandMode.java b/src/com/android/settings/BandMode.java
index 81e8b49..4d17014 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;
@@ -140,21 +153,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());