Merge "GPS: Initialize XTRA support when GPS is enabled" into gingerbread

This commit is contained in:
Mike Lockwood
2010-08-17 04:46:29 -07:00
committed by Android (Google) Code Review

View File

@ -197,6 +197,9 @@ public class GpsLocationProvider implements LocationProviderInterface {
// capabilities of the GPS engine
private int mEngineCapabilities;
// true if XTRA is supported
private boolean mSupportsXtra;
// for calculating time to first fix
private long mFixRequestTime = 0;
// time to first fix for most recent session
@ -635,6 +638,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
mEnabled = native_init();
if (mEnabled) {
mSupportsXtra = native_supports_xtra();
if (mSuplServerHost != null) {
native_set_agps_server(AGPS_TYPE_SUPL, mSuplServerHost, mSuplServerPort);
}
@ -839,7 +843,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
sendMessage(INJECT_NTP_TIME, 0, null);
result = true;
} else if ("force_xtra_injection".equals(command)) {
if (native_supports_xtra()) {
if (mSupportsXtra) {
xtraDownloadRequest();
result = true;
}
@ -1372,7 +1376,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
handleInjectNtpTime();
break;
case DOWNLOAD_XTRA_DATA:
if (native_supports_xtra()) {
if (mSupportsXtra) {
handleDownloadXtraData();
}
break;