summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-10-22 09:17:38 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-22 09:17:38 -0700
commit4c918335ef6ac44530bfefa33860a4e0b23b523c (patch)
treee858925e27568c0b0ccb01149124d5999b8ea859 /services
parentda36c84a9706b1a7a1052113dcec527d0c71156e (diff)
parentd78c8d8bb9516878eb5042a28d76bd6bcf4c6780 (diff)
downloadframeworks_base-4c918335ef6ac44530bfefa33860a4e0b23b523c.zip
frameworks_base-4c918335ef6ac44530bfefa33860a4e0b23b523c.tar.gz
frameworks_base-4c918335ef6ac44530bfefa33860a4e0b23b523c.tar.bz2
am d78c8d8b: am f6572e7e: Merge "GPS: Fix network type logic in requestRefLocation" into gingerbread
Merge commit 'd78c8d8bb9516878eb5042a28d76bd6bcf4c6780' * commit 'd78c8d8bb9516878eb5042a28d76bd6bcf4c6780': GPS: Fix network type logic in requestRefLocation
Diffstat (limited to 'services')
-rwxr-xr-xservices/java/com/android/server/location/GpsLocationProvider.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java
index 4a6b5f4..755a228 100755
--- a/services/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/java/com/android/server/location/GpsLocationProvider.java
@@ -1451,23 +1451,30 @@ public class GpsLocationProvider implements LocationProviderInterface {
mContext.getSystemService(Context.TELEPHONY_SERVICE);
if (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) {
GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation();
- if ((gsm_cell != null) && (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM)
- && (phone.getNetworkOperator().length() > 3)) {
+ if ((gsm_cell != null) && (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM) &&
+ (phone.getNetworkOperator() != null) &&
+ (phone.getNetworkOperator().length() > 3)) {
int type;
int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3));
int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3));
- if (phone.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS)
+ int networkType = phone.getNetworkType();
+ if (networkType == TelephonyManager.NETWORK_TYPE_UMTS
+ || networkType == TelephonyManager.NETWORK_TYPE_HSDPA
+ || networkType == TelephonyManager.NETWORK_TYPE_HSUPA
+ || networkType == TelephonyManager.NETWORK_TYPE_HSPA) {
type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
- else
+ } else {
type = AGPS_REF_LOCATION_TYPE_GSM_CELLID;
+ }
native_agps_set_ref_location_cellid(type, mcc, mnc,
gsm_cell.getLac(), gsm_cell.getCid());
- }
- else
+ } else {
Log.e(TAG,"Error getting cell location info.");
+ }
}
- else
+ else {
Log.e(TAG,"CDMA not supported.");
+ }
}
private void sendMessage(int message, int arg, Object obj) {