[G3 Original Android Development] jeremie57:
Hello,

Since Lollipop is arrived, I am faced with a GPS problem with stock ROM, CM12, CM12.1 and CM13.

If I disable datas and I use GPS, I have many GPS fix losses. :(

These losses don't exist if I stay in airplane mode, if I enable datas or if I start the navigation with datas enabled and I disabled later. :eek:

We can see that it's a software issue only by reading this 2 Google's issue tracker :

https://code.google.com/p/android/issues/detail?id=81140

https://code.google.com/p/android/i...tars Reporter Opened&groupby=&sort=&id=190376

I have installed the apk RunGPS Pro Trial to be able to extract GPS datas during a trip.

This application can track the DOP (dilution of precision).

Each trip I made, I can see that I loose de GPS fix at exactly 5 min interval (see graph "DOP")

I have asked each time a bugreport and, each time RunGPS show me I lost the GPS fix, at exactly the same second, I've a network request like that :

DUMP OF SERVICE connectivity:

mNetworkRequestInfoLogs (most recent first):

02-17 17:32:04.007 - REGISTER Request from uid/pid:1000/951 for NetworkRequest [ id=49, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

02-17 17:27:03.506 - REGISTER Request from uid/pid:1000/951 for NetworkRequest [ id=48, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

02-17 17:22:03.666 - REGISTER Request from uid/pid:1000/951 for NetworkRequest [ id=47, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

02-17 17:17:03.518 - REGISTER Request from uid/pid:1000/951 for NetworkRequest [ id=46, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

02-17 17:12:03.226 - REGISTER Request from uid/pid:1000/951 for NetworkRequest [ id=45, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

02-17 17:07:02.312 - REGISTER Request from uid/pid:1000/951 for NetworkRequest [ id=44, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

If I go in the section "SERVICE com.android.phone/.TelephonyDebugService", I found more details :

02-17 17:27:03.509 - clearing log with size=1

NetworkRequest [ id=48, legacyType=3, [ Transports: CELLULAR Capabilities: SUPL&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

02-17 17:27:03.508 - Dctc.requestNetwork, priority=2

02-17 17:27:03.509 - DcSwitchStateMachine.AttachedState: REQ_CONNECT

02-17 17:27:03.509 - DctController.onExecuteRequest

02-17 17:27:03.509 - DcTracker.incApnRefCount on supl found {mApnType=supl mState=IDLE mWaitingApns={null} mWaitingApnsPermanentFailureCountDown=0 mApnSetting={null} mReason=dataDisabled mDataEnabled=false mDependencyMet=true}

02-17 17:27:03.510 - ApnContext.incRefCount - 0

02-17 17:27:03.510 - applyNewState(supl, true(false), true(true))

02-17 17:27:03.510 - ApnContext.resetErrorCodeRetries

02-17 17:27:03.510 - trySetupData due to dataEnabled

02-17 17:27:03.543 - trySetupData: X apnContext not 'ready' retValue=false

02-17 17:27:33.507 - Cellular releasing Network for

02-17 17:27:33.507 - DctController.releaseNetwork

02-17 17:27:33.507 - DctController.onReleaseRequest

02-17 17:27:33.507 - DcTracker.decApnRefCount on supl found {mApnType=supl mState=IDLE mWaitingApns={null} mWaitingApnsPermanentFailureCountDown=0 mApnSetting={null} mReason=dataEnabled mDataEnabled=true mDependencyMet=true}

02-17 17:27:33.507 - ApnContext.decRefCount - 1

02-17 17:27:33.509 - applyNewState(supl, false(true), true(true))

02-17 17:27:33.509 - cleanUpConnection: tearDown=true reason=dataDisabled

02-17 17:27:33.509 - cleanUpConnection: X tearDown=true reason=dataDisabled

I can see that it's the "supl" APN Type that is requested. That means that data for A-GPS are requested ! But why ? I have already a fix !

Strange things, if I set the Location in "Device only" mode, I have exactly the same requests !

To avoid such requests, I have changed the settings of the GPS in the gps.conf file.

I have disabled MSB in the GPS capabilities section. MSA is already deactivated.

That means I have set the capabilities at 0x31 to avoid the 2 modes of operation : Mobile station assisted (MSA) and Mobile station based (MSB).

Like that, I avoid any request from A-GPS...

And, It works like a charm... No more loss of fix with or without data enabled.

That means that when the device send a request for A-GPS datas, whatever the result, the fix is lost !

Now, why 5 minutes ?

In GpsLocationProvider.java, I've found this lines :

// how long to wait if we have a network error in NTP or XTRA downloading
// current setting - 5 minutes
private static final long RETRY_INTERVAL = 5*60*1000;

I have no knowledges in java so, I've stopped to try to understand exactly what's happened with this variable.

I think something is wrong and it is not conditionned by the fact that the fix of the GPS is done.