Skip to content

Commit 75a2ae9

Browse files
mikeandroidAndroid Code Review
authored andcommitted
Merge "GPS: Initialize XTRA support when GPS is enabled"
2 parents 9e64fcb + b445946 commit 75a2ae9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

location/java/com/android/internal/location/GpsLocationProvider.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ public class GpsLocationProvider implements LocationProviderInterface {
216216
// true if we started navigation
217217
private boolean mStarted;
218218

219+
// true if XTRA is supported
220+
private boolean mSupportsXtra;
221+
219222
// for calculating time to first fix
220223
private long mFixRequestTime = 0;
221224
// time to first fix for most recent session
@@ -659,6 +662,7 @@ private void handleEnable() {
659662
mEnabled = native_init();
660663

661664
if (mEnabled) {
665+
mSupportsXtra = native_supports_xtra();
662666
if (mSuplServerHost != null) {
663667
native_set_agps_server(AGPS_TYPE_SUPL, mSuplServerHost, mSuplServerPort);
664668
}
@@ -860,7 +864,7 @@ public boolean sendExtraCommand(String command, Bundle extras) {
860864
return true;
861865
}
862866
if ("force_xtra_injection".equals(command)) {
863-
if (native_supports_xtra()) {
867+
if (mSupportsXtra) {
864868
xtraDownloadRequest();
865869
return true;
866870
}
@@ -1383,7 +1387,7 @@ public void handleMessage(Message msg)
13831387
handleInjectNtpTime();
13841388
break;
13851389
case DOWNLOAD_XTRA_DATA:
1386-
if (native_supports_xtra()) {
1390+
if (mSupportsXtra) {
13871391
handleDownloadXtraData();
13881392
}
13891393
break;

0 commit comments

Comments
 (0)