[Nexus 4 Original Android Development] zaclimon:
Changelog, other stuff

V10 (18/12/16):
- Updated to Android 7.1.1
- Patched kernel with the latest security fixes.

V9: (14/10/16)
- Video recording on Camera2 partially fixed (Video shakes sometimes)
- Fixed stack trace for native processes
- Updated to October's Security patches
- Misc fixes

V8: (18/09/16)
- Kernel patched accordingly to September security fixes (Patches all Quadrooter exploits up to now)
- Fixed Torch

V7: (11/09/16)
- Updated to September security fixes (For real this time)
- Enabled H/W encoding for video recording
- Re-enabled navigation bar tweaks and night mode in SystemUI
- Fixed Google Play Services FC's using OpenGApps (For real also)
- Add possibility to change WebView provider

V6: (09/09/16)
- Updated to September security patches
- Fixed freezing while watching YouTube
- Attempt to enable LTE
- Hidden misc battery drain as it causes some misinterpretations

V5: (05/09/16)
- Enabled Doze for real this time
- Reverted a change that may have broke Camera

V4: (02/09/16)
- Fixed H/W video decoding for the most part
- Kernel: SDCard FS enabled
- Attempt to fix permissions for GApps
- Enabled Navigation Bar tweaks and Night mode in SystemUI Tuner.

V3: (30/08/16)
- Fixed Sensors
- Semi-Fixed camera
- Fixed MPDecision
- Enabled Doze
- Used Flo's developper preview N GPU drivers

V2: (28/08/16)
- Fixed audio
- Fixed GPS
- Fixed data connectivity
- Disabled the power toggle widget which caused Settings to crash on every boot

V1 (26/08/16):
- Initial release

Here's a video showing how to install the ROM.

(Thanks [MENTION=6844471]Swapnil Soni[/MENTION])

[YOUTUBE]Ti7hMSbC9gw[/YOUTUBE]

Here's another one with a little overview of it.

(Thanks [MENTION=5037198]DaKoin[/MENTION])

[YOUTUBE]ke6FzsYb1H4[/YOUTUBE]

Build instructions:

Since some of you guys asked me how to build from scratch, I will give a walkthrough of what I mostly did.

Note that this is in no way a walkthrough in how to compile

(there are several guides for that on XDA) but more a guide

on how I did my setup so you can replicate the AOSP builds on your device.

Here's what I did:

1. Download the latest AOSP revision for android-7.1 which is r6 at the time of this writing (replace with whatever required branch necessary)

repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-7.1.1_r6
repo sync

2. Download the kernel source used for the build:

git clone https://github.com/zaclimon/android_kernel_google_msm -b mako_nougat

3. Once both sources has been downloaded, compile the kernel. Note that AOSP do have a kernel toolchain that you can use to compile

export CROSS_COMPILE "/path/to/aosp/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-"
make mako_defconfig
make -j$(grep -c processor /proc/cpuinfo)

4. Copy the arch/arm/boot/zImage file to the Android source into device/lge/mako-kernel

Note: You must create the said directories if they don't exist. You also must rename the file to kernel after copy.

5. Go back to the AOSP source, and download/update/replace the following repositories for each component (relative path):

device/lge:
git clone https://github.com/zaclimon/android_device_lge_mako mako

hardware/qcom:
git clone https://github.com/zaclimon/android_hardware_qcom_audio audio
git clone https://github.com/zaclimon/android_hardware_qcom_display display
git clone https://github.com/zaclimon/android_hardware_qcom_gps gps
git clone https://github.com/zaclimon/android_hardware_qcom_media media

vendor:
git clone https://github.com/zaclimon/android_vendor_lge lge

6. Apply the following patches to each of their respective repositories:

bionic:
https://github.com/LineageOS/android_bionic/commit/81af26a3a033723fb34ddf280e33a9d4a6ce82c4.patch

frameworks/base:
https://gist.github.com/zaclimon/bb39d7f5059b63e3add3b5cad15e87db
https://android-review.googlesource.com/#/c/147266/

system/sepolicy:
https://github.com/LineageOS/android_system_sepolicy/commit/10dd0402ab62aa1a6416d7ea549a6a3eea1c6ae4.patch

7. Increase RAM usage for Jack (Only if you have 6/8GB of RAM in your system)

export ANDROID_JACK_VM_ARGS="-Xmx4g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"

8. Once all the patches have been applied, we can now proceed to compile the system.

. build/envsetup.sh && lunch aosp_mako-userdebug
make -j$(grep -c processor /proc/cpuinfo) otapackage

9. The build should be in out/target/product/mako

10. Flash and enjoy!! :)