summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2009-08-19 11:18:53 -0700
committerRobert Greenwalt <robdroid@android.com>2009-08-19 11:18:53 -0700
commit75e1d3137cdcdb88783795d3f1fe735098330fa8 (patch)
tree715f28f5770a1c5ba00661dc51337cc3a0a7190e /services
parenta659744041d0b74b4243fdd448a5fa302a581278 (diff)
downloadframeworks_base-75e1d3137cdcdb88783795d3f1fe735098330fa8.zip
frameworks_base-75e1d3137cdcdb88783795d3f1fe735098330fa8.tar.gz
frameworks_base-75e1d3137cdcdb88783795d3f1fe735098330fa8.tar.bz2
Fix exception when reporting disconn cdma state.
Array out of bounds when checking first element of a 0-length array.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/TelephonyRegistry.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/TelephonyRegistry.java b/services/java/com/android/server/TelephonyRegistry.java
index 7379b5d..170a9f8 100644
--- a/services/java/com/android/server/TelephonyRegistry.java
+++ b/services/java/com/android/server/TelephonyRegistry.java
@@ -535,9 +535,12 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
intent.putExtra(Phone.STATE_CHANGE_REASON_KEY, reason);
}
intent.putExtra(Phone.DATA_APN_KEY, apn);
- String types = apnTypes[0];
- for (int i = 1; i < apnTypes.length; i++) {
- types = types+","+apnTypes[i];
+ String types = new String("");
+ if (apnTypes.length > 0) {
+ types = apnTypes[0];
+ for (int i = 1; i < apnTypes.length; i++) {
+ types = types+","+apnTypes[i];
+ }
}
intent.putExtra(Phone.DATA_APN_TYPES_KEY, types);
intent.putExtra(Phone.DATA_IFACE_NAME_KEY, interfaceName);