This started with me trying to figure out why GPS didn't work for my Nexus 5.
It turns out it doesn't work for a lot of people, on a lot of different devices. Many people say it works fine.
The short of it: Each device is supposed to have its GPS settings tweaked to get the specific device & cell provider configuration just right. This doesn't happen. Instead, a generic configuration is applied, which doesn't work for some people.
Google's Stock Nexus 5 image and builds of CyanogenMod 12.0 and 13.0 both set this for my Nexus 5 (using Sprint):
CAPABILITIES=0x33 LPP_PROFILE=0
And what is it supposed to be set to?
CAPABILITIES=0x31 LPP_PROFILE=2
With the default settings, GPS doesn't work. It sometimes works, but the GPS radio seems to just freeze up or die. Like it was switched off.
With the changed settings, GPS works just fine.
Android's source suggest that GPS configuration is supposed to be changed based on carrier.
Example:
https://android.googlesource.com/device/lge/bullhead/+/d3373fec0fcd39b345f199296a6e171ead38d27f
But it doesn't work like that. When did GPS work as expected? Back with Android 4.4 / CyanogenMod 11.0.
This code suggests that GPS settings were applied differently:
https://android.googlesource.com/platform/frameworks/base/+/67862cf%5E!/
Here are the /etc/gps.conf changes that are supposed to be made for each carrier:
Verizon
CAPABILITIES=0x31 LPP_PROFILE=3
AT&T
CAPABILITIES=0x33 LPP_PROFILE=3
T-Mobile
CAPABILITIES=0x33 LPP_PROFILE=2
Sprint
CAPABILITIES=0x31 LPP_PROFILE=2
I made an install script that I use on my Nexus 5 running CyanogenMod 13.0.
It corrects the gps.conf file for Sprint, then adds an addon.d script allow the fix to persist through updates. Just boot to Recovery / TWRP and flash it.
It's on my Nexus 5 GPS page: http://xenomorph.net/google/android/nexus5/gps/