[WIP] AOSP 7.1.1 (Nougat)

Search This thread

zaclimon

Inactive Recognized Contributor
Aug 14, 2011
4,365
7,292
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

Inactive Recognized Contributor
Aug 14, 2011
4,365
7,292
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
175
36
Merci infiniement !!!
Just downloaded, and works, I think we need to changes the permission so that google play service not crashing
 

zaclimon

Inactive Recognized Contributor
Aug 14, 2011
4,365
7,292
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
75
30
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
22
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

Inactive Recognized Contributor
Aug 14, 2011
4,365
7,292
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
175
36
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
22
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
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⁴]
 

Top Liked Posts

  • There are no posts matching your filters.
  • 270
    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
    83
    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!! :)
    65
    Update/Future

    Hi guys! Another day, another update for the Nexus 4. I don't know if it'll be enough but anyway here it is:

    V4 (02/09/16):

    - Fixed H/W video decoding for the most part (can see YouTube 60 FPS videos/Was able to play some local video files using it as well)
    - Kernel: SDCard FS enabled (I leave the discretion to the custom roms whether to really enable it or not)
    - Attempt to fix permissions for GApps
    - Enabled Navigation Bar tweaks and Night mode in SystemUI Tuner.

    If YouTube is somewhat posing a problem with 60 fps playback, I compiled a test version of Quanta V19 which is compatible with Nougat. Please note that I won't be offering any support for this version as it is mostly experimental stuff.

    It has been a somewhat challenging two weeks trying to get everything working, I definitely won't have a lot of time to be on this project anymore starting next Tuesday. School is beginning for me and I want to focus on some other projects (Quanta stuff mostly) Though, It's nice to see that there are still a lot of people interrested in flashing new updates and that's what is somewhat the heart of XDA. I wanted to get mostly everything working and I believe that it has been mostly accomplished. (minus some minor stuff like the flashlight and notification light) I'll leave out all the source required to build for the N4 + some patches I used. (GApps/Navigation bar + night mode)

    At the same time I take the time to remind to some people here that might have some hope of features coming to this rom. Sorry to say it to you bluntly but I'll crush these dreams right away. This rom is meant as a way (even more as a proof of concept more than anything else really for this device) to get Android 7.0 running. As such it will act as a base for the custom roms that will have all your favorite feature. :)

    Anyways, the update and the test Quanta build is available in the OP.

    Enjoy!! :)
    59
    Daily driver material?

    Hey guys, this past week has been a bit tiring. (Was expecting some vacation and a bit of rest but got Nougat popping out of nowhere, thanks Telus!) That is without to say that I can consider this to be stable enough even though there are some caveats.

    I must say also that you guys are heavy on the bandwith used on QuantaWorks. You guys managed to use over 260GB of over the last week XD. It shows that the Nexus 4 community is still well and alive.

    Anyways here it is:

    V3: (30/08/16)

    - Fixed sensors (For you Pokemon Go people :p)
    - Semi-Fixed Camera (Taking pictures works but video recording not saving and I'm a bit clueless. See below for details)
    - Fixed MPDecision
    - Enabled Doze
    - Used GPU drivers from Flo's N developper preview

    About sensors, as some of you may know, it looks like the use of Clang broke the use of our sensors, however we can force the part responsible of it to be compiled with GCC. The patch for you builders can be found here:

    https://github.com/xyyx/android_bionic/commit/bb34389f42032b829cfe970c951bd527231d9302

    About camera, I don't know what's happening since I have 2 possible theories. I can see that the OMX encoder has some issues. That said, it could be possible that our HAL needs to be modified for Nougat support as seen here:

    https://source.android.com/devices/camera/versioning.html#hardening

    If we use API1 HAL1, that's where it could get a bit tricky and can go harder than what I can possibly do. Flo doesn't have the same issue since it uses Camera2.

    @ganachoco What's your insight regarding this? I know you had some issues with getting Google Camera because of Camera2.

    Anyways enough talking. The build is available in the OP and I hope you'll be happy enough for the moment. Time for a little break now. :p

    Enjoy!! :)
    57
    Hype calming down (or maybe not)

    What's up guys, as the Rom got most likely ready for daily usage, I decided to gradually retire myself from it. This way I can concentrate on other stuff. (like said before) Without further ado here's the changelog:

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

    I'm pretty sure that others will take on my lead and deliver some interesting Nougat roms on our Nexus 4. I could perhaps also get some stuff when I'll update my device to it who knows. ;)

    Anyways, the build is available on AFH and I've added also the download link for Banks GApps as it looks like to be somewhat more stable than OpenGApps for some.

    Enjoy!! :)