[WIP] AOSP 7.1.1 (Nougat)

zaclimon

Recognized Contributor
Aug 14, 2011
4,365
7,292
0
Montréal
What's up guys, even though this Nexus 4 is 4 years old, (pun not intended XD) it's still holding up strong and in time for some Nougat treatment. [emoji14]

Note: Most of the components are working and I believe that it is enough for daily tasks. However, YOU see whether it fits your needs or not.

Working:
- Audio
- Wi-Fi
- Bluetooth
- RIL
- H/W Acceleration
- USB
- GPS
- NFC
- Sensors

Semi-Working:
- Camera (Video recording stutters sometimes with some apps)

Not Working:

How to Flash:
1. Download Zip
2. Flash zip
3. Flash GApps
4. Wipe Data (If coming from anything other than 7.0)
4. Flash SuperSU (Optionnal, Uses systemless as a root method)
5. Profit

Note: You will see Fc's all along the setup, just skip them if shown. Also if Google Play Services is crashing, grant it the location permission in the settings.

Download:
AOSP 7.0 download folder
Mirror

Quanta:
Quanta V19 Test

GApps:
OpenGApps
Banks GApps

SuperSU: SuperSU Stable

Sources:
Device Tree
Kernel Source
 
Last edited:

zaclimon

Recognized Contributor
Aug 14, 2011
4,365
7,292
0
Montréal
Changelog, other stuff

Code:
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 @Swapnil Soni)



Here's another one with a little overview of it. (Thanks @DaKoin)



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)
Code:
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:
Code:
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
Code:
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):

Code:
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:

Code:
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)
Code:
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.
Code:
. 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!! :)
 
Last edited:

cqloveqc

Senior Member
Jun 30, 2012
168
34
0
Merci infiniement !!!
Just downloaded, and works, I think we need to changes the permission so that google play service not crashing
 

nitin.chobhe

Recognized Contributor
Jan 3, 2013
8,097
19,497
263
Pune
It's not necessary per se because it should boot fine. That said, as always, it's recommended to wipe so random issues are less prone to happen.
Thanks man! One last question - I need N gapps for this, right?

Open gapps should be fine?
@cqloveqc what gapps did you use? And what permissions need to be modified?

Nitin
 

zaclimon

Recognized Contributor
Aug 14, 2011
4,365
7,292
0
Montréal
Its people like you who make this world a better place, thank you very much!
Thanks man! One last question - I need N gapps for this, right?

Open gapps should be fine?
@cqloveqc what gapps did you use? And what permissions need to be modified?

Nitin
Please everybody read the note (I should make it bold so people can see it)

"Note:You will see Fc's all along the setup, just skip them if shown. Also if Google Play Services is crashing, grant it the location permission in the settings. I'm also surprised to say that even with your data not wiped, it's working."
 

unrealmac

Senior Member
Oct 12, 2014
70
29
0
I am coming from the fake Nexus Rom aka I do not have a custom bootloader yet. What bootloader is the best to go with?

Could someone write me a quick instruction how to get started with my situation. I bet there are a lot coming from fake nexus.

Thanks for the great work!!
 

aabuk

Senior Member
Dec 1, 2014
53
16
0
19
Hať
wow! cool zaclimon, so quanta is now N compatible i guess? haha, gj, if i'll find any kind of fix for something, i'll pull request, and thanks alot!
 

zaclimon

Recognized Contributor
Aug 14, 2011
4,365
7,292
0
Montréal
wow! cool zaclimon, so quanta is now N compatible i guess? haha, gj, if i'll find any kind of fix for something, i'll pull request, and thanks alot!
I compiled a stock kernel as I wanted to start off a fresh base if ever others wanted to use a custom kernel. (Including myself with Quanta) It is patched with Google's latest updates.

I could compile a build of Quanta and incorporate the patches required to boot Nougat but it wouldn't be fair lool.
 
  • Like
Reactions: Idiosyncratinom

cqloveqc

Senior Member
Jun 30, 2012
168
34
0
Please everybody read the note (I should make it bold so people can see it)

"Note:You will see Fc's all along the setup, just skip them if shown. Also if Google Play Services is crashing, grant it the location permission in the settings. I'm also surprised to say that even with your data not wiped, it's working."
I'm using the open gapps 7.0 arm version, and after change the app permission, all is good so far

And another sergestion, can we change the original LCD density to 240 instead of the default 320 ?
This change make the desktop more attractive.
 

aabuk

Senior Member
Dec 1, 2014
53
16
0
19
Hať
I compiled a stock kernel as I wanted to start off a fresh base if ever others wanted to use a custom kernel. (Including myself with Quanta) It is patched with Google's latest updates.

I could compile a build of Quanta and incorporate the patches required to boot Nougat but it wouldn't be fair lool.
hahaha, okie, atleast i got some space to look at dem kernelzz, thanks for echo
 

Gu$houn*

Senior Member
Dec 10, 2010
879
430
0
Prague
I'm using the open gapps 7.0 arm version, and after change the app permission, all is good so far

And another sergestion, can we change the original LCD density to 240 instead of the default 320 ?
This change make the desktop more attractive.
This has been allowed always from build.prop, did you try that?

P.
[sntfrmnxs⁴]