• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

GPS Almanac / Ephemeris Update

Guys,

I'm using a HTC Magic on Rogers current ROM (Android 1.5) and get frequent GPS lock-ups. Looks like the GPS glitches, thinks it's in the atlantic and never comes back to a working state. I've tried turning the unit off, pulling the battery and the problem persists.

The only way I've found to restore GPS operation is to factory reset the phone which is a little drastic since all that's needed is a GPS reset.

So right now I'm thinking some means to at least wipe the Almanac and Ephemeric data out of the GPS chip should force the chip to start fresh. That would defenitely be a great start. Some means of pre-loading this data from USB or something similar would be even cooler, but that's purely optional for me...

Looking at the high level Android API's there's nothing there either that covers this (you'd think a GPS Reset command would be a useful thing...) so looks like we'd need to go under the hood...

So we may need to talk direct to the GPS chip, and in my case this is a Qualcomm 7200A with a GPSone module. You'd think Qualcomm would be forthcoming with the programming info for this device but I've been looking for it all AM with no success.

There may be something in the GPS driver also but not sure if that open or closed source.

So defenitely not for the faint of heart, but if someone out there's got the knowledge I'd be much appreciated. Such an app may in fact alreadt exist, so open to any suggestions here...
 
Well looked into the android source and found the following:

platform/hardware/qcom/gps/loc_api/libloc_api/loc_eng.cpp

Contains the following functions which are of interest:

Code:
static int  loc_eng_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty);
 
static int  loc_eng_inject_location(double latitude, double longitude, float accuracy);
 
static void loc_eng_delete_aiding_data (GpsAidingData f);

By reading the source sounds like I'd need to turn off the GPS, call loc_eng_delete_aiding_data and then resart the GPS.

The loc_eng_inject_* functions might also be interesting from a perspective of forcing the gps engine to start with the network derrived location and time rather than starting from scratch.

So does anyone have any insight on how to call these functions from an application? Anyone interested in giving this a go?
 
Upvote 0
Well looks like I got my phone working again...

Charged it up, left it outside to freeze for about 30 minutes and it was okay again. So not too much priority on this but would still be great to be able to pre-load this data manually vs having to wait for 30 minutes for GPS to start! ;-)

That said I'm still a little perplexed as to why a factory reset returns operation immediately. If someone can create a quick app to wipe the aiding data as mentionned above it would defenitely be useful...
 
Upvote 0
I just found an app in the market - GPSTest (by Mike Lockwood). It can clear aiding data and inject time/xtra-data - press menu button after you launch the app and you will see them. I'm testing these features and hope it help you.

Well looks like I got my phone working again...

Charged it up, left it outside to freeze for about 30 minutes and it was okay again. So not too much priority on this but would still be great to be able to pre-load this data manually vs having to wait for 30 minutes for GPS to start! ;-)

That said I'm still a little perplexed as to why a factory reset returns operation immediately. If someone can create a quick app to wipe the aiding data as mentionned above it would defenitely be useful...
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones