Recently, I need to build a working ROM for Nexus 5 from LG (hammerhead, here-forth). There are variety of tutorials and guide all over the web on the general steps needed to compile AOSP from scratch, which I do not intend to repeat here. Instead, I'll mostly focus on how to make the data connection (3G/LTE) working on Sprint phones.
I choose the latest AOSP release as of writing this post,
per the official Android build numbers page, and followed the
official build instructions from Android. Everything went smoothly, except that
after flashing to device, I found there was no data connection (3G/LTE). Of
course Google apps were also missing but it should be easy to fix.
After banging my head for a while, I came across this post from Jameson
and this thread, which shed some light on what's happening.
Apparently, the vendor binaries from Google's driver page do not work
properly out of the box. Some was missing, such as
OmaDmclient.apk, and others
were different from those in factory image. So based on Jameson's vendor binary
repos (lge, qcom), I updated them with the binaries from
factory image of Android 4.4.4 (KTU84P). Yet still no luck.
Finally, one of the comments in that post led me to this xda thread
talking about APN fixes for Sprint users, which seems to be just I missed. So I
apns-conf.xml file from there and va-la, LTE is working! One tiny
glitch though, on first boot, activating data connection took far longer than it
should be, so once you saw the LTE icon, it's safe to hit skip.
UPDATE (Jun 28, 2014)
To be able to sign the added vendor apks properly, I've added corresponding
Android.mk in each proprietary directory. Also,
TimeService.apk from qcom
should override the one from gapps.
UPDATE (Oct 3, 2015)
To extract the files from factory image:
- Download the factory image, uncompress it.
- Unzip the image files (
images-hammerhead-xxxxxx.zip) inside it.
- Uncompress the
$ simg2img system.img system.img.raw
- Mount the system image (assuming you already have a mount point).
$ mount -t ext4 -o loop system.img.raw /mnt/system.img/
More instructions can be found here.