[HOW TO] Add Ambient Display on Settings [Lollipop]

Search This thread

raffaele88

Senior Member
Mar 15, 2010
2,528
9,215
Salerno
www.foxhoundrom.net
Hey guys! Today I'll be showing you how to add the Ambient Dislpay in Settings:

a.png


You will need
framework-res.apk from the rom you are modding
SystemUI.apk from your Rom
Notepad++ or another text editor of your choice
apktool



Ok now we can start :)


First decompile Systemui.apk with this comand
Code:
apktool d systemui.apk

Navigate to systemui/res/values/bools and open it with Notepad++ and change this line:

from
PHP:
<bool name="doze_display_state_supported">false</bool>	
<bool name="doze_pulse_on_pick_up">false</bool>

to
PHP:
<bool name="doze_display_state_supported">true</bool>	
<bool name="doze_pulse_on_pick_up">true</bool>

Save and ricompile systemui with this comand:
Code:
apktool b systemui


Now start to mod framework-res.apk


Decompile framework-res.apk with apktool with this comand:
Code:
apktool d framework-res.apk

Navigate to framework-res/res/values/string and open it with notepad++ and change this line:

from
PHP:
<string name="config_dozeComponent"></string>

to
PHP:
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>

Save and close.....



Now in the same folder open bool.xml and with notepad++ and mod this line:

from
PHP:
<bool name="config_dozeAfterScreenOff">false</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">false</bool>

to
PHP:
<bool name="config_dozeAfterScreenOff">true</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>

Save it and close....


Now in the same folder open Interger.xml with notepad++ andmod this line:

from
PHP:
<integer name="config_screenBrightnessDoze">1</integer>

to
PHP:
<integer name="config_screenBrightnessDoze">17</integer>

Now recompile with this comand:
Code:
apktool b framework-res.apk

That's it!!! Enjoy with your new mod :)

NB... Remember to insert original Signature after recompile APK,you can find in original folder on apktool


In attachment file there is my apktool if you need ;)

thanks to david279 for update guide
 

Attachments

  • apktool_lolly.zip
    11.3 MB · Views: 9,778
Last edited:

david279

Senior Member
Sep 4, 2007
5,680
1,888
New Orleans
Thanks man but I can't do any of that from my phone right now

---------- Post added at 05:55 PM ---------- Previous post was at 05:50 PM ----------

Oops Nevermind Ubuntu to the rescue
 

david279

Senior Member
Sep 4, 2007
5,680
1,888
New Orleans
Ok what am i doing wrong

I: Using Apktool 2.0.0-dirty on framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:247)
at brut.androlib.Androlib.build(Androlib.java:266)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:243)
... 4 more
 
  • Like
Reactions: dekefake

raffaele88

Senior Member
Mar 15, 2010
2,528
9,215
Salerno
www.foxhoundrom.net
Ok what am i doing wrong

I: Using Apktool 2.0.0-dirty on framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:247)
at brut.androlib.Androlib.build(Androlib.java:266)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:243)
... 4 more
You have java installed?
 

david279

Senior Member
Sep 4, 2007
5,680
1,888
New Orleans
whats the sigature? im new to apktool.

Edit....Now this error

I: Using Apktool 2.0.0-dirty on framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" invalid resource directory name: /home/david/Downloads/framework-res/res/values-watch
brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_2728941901145358304.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0-1570415, -F, /tmp/APKTOOL3406553026750852423.tmp, -x, -0, arsc, -S, /home/david/Downloads/framework-res/res, -M, /home/david/Downloads/framework-res/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:449)
at brut.androlib.Androlib.buildResources(Androlib.java:383)
at brut.androlib.Androlib.build(Androlib.java:286)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_2728941901145358304.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0-1570415, -F, /tmp/APKTOOL3406553026750852423.tmp, -x, -0, arsc, -S, /home/david/Downloads/framework-res/res, -M, /home/david/Downloads/framework-res/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:487)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_2728941901145358304.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0-1570415, -F, /tmp/APKTOOL3406553026750852423.tmp, -x, -0, arsc, -S, /home/david/Downloads/framework-res/res, -M, /home/david/Downloads/framework-res/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:481)
... 6 more


So i dont.
 
Last edited:

flex360

Senior Member
Sep 22, 2010
4,518
6,810
whats the sigature? im new to apktool.

Edit....Now this error

I: Using Apktool 2.0.0-dirty on framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" invalid resource directory name: /home/david/Downloads/framework-res/res/values-watch
brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_2728941901145358304.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0-1570415, -F, /tmp/APKTOOL3406553026750852423.tmp, -x, -0, arsc, -S, /home/david/Downloads/framework-res/res, -M, /home/david/Downloads/framework-res/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:449)
at brut.androlib.Androlib.buildResources(Androlib.java:383)
at brut.androlib.Androlib.build(Androlib.java:286)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_2728941901145358304.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0-1570415, -F, /tmp/APKTOOL3406553026750852423.tmp, -x, -0, arsc, -S, /home/david/Downloads/framework-res/res, -M, /home/david/Downloads/framework-res/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:487)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_2728941901145358304.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --version-name, 5.0-1570415, -F, /tmp/APKTOOL3406553026750852423.tmp, -x, -0, arsc, -S, /home/david/Downloads/framework-res/res, -M, /home/david/Downloads/framework-res/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:481)
... 6 more


So i dont.

delete the values-watch forlder in res
 

Argumentation

Senior Member
Feb 21, 2012
385
149
Washinton, DC
Any idea what's causing this error?

Code:
C:\Users\Admin\Desktop\apktool_lolly>apktool b framework-res
I: Using Apktool 2.0.0-dirty on framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\Admin\Desktop\apktool_lolly\framework-
res\res/values-watch
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [C:\Users\Admin\
AppData\Local\Temp\brut_util_Jar_7863948608617729428.tmp, p, --forced-package-id
, 1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --vers
ion-name, 5.0-1570415, -F, C:\Users\Admin\AppData\Local\Temp\APKTOOL851320018741
208575.tmp, -x, -0, arsc, -S, C:\Users\Admin\Desktop\apktool_lolly\framework-res
\res, -M, C:\Users\Admin\Desktop\apktool_lolly\framework-res\AndroidManifest.xml
]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:449)
        at brut.androlib.Androlib.buildResources(Androlib.java:383)
        at brut.androlib.Androlib.build(Androlib.java:286)
        at brut.androlib.Androlib.build(Androlib.java:258)
        at brut.apktool.Main.cmdBuild(Main.java:240)
        at brut.apktool.Main.main(Main.java:89)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
 exec command: [C:\Users\Admin\AppData\Local\Temp\brut_util_Jar_7863948608617729
428.tmp, p, --forced-package-id, 1, --min-sdk-version, 21, --target-sdk-version,
 21, --version-code, 21, --version-name, 5.0-1570415, -F, C:\Users\Admin\AppData
\Local\Temp\APKTOOL851320018741208575.tmp, -x, -0, arsc, -S, C:\Users\Admin\Desk
top\apktool_lolly\framework-res\res, -M, C:\Users\Admin\Desktop\apktool_lolly\fr
amework-res\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:487)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:434)
        ... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Admin\Ap
pData\Local\Temp\brut_util_Jar_7863948608617729428.tmp, p, --forced-package-id,
1, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 21, --versio
n-name, 5.0-1570415, -F, C:\Users\Admin\AppData\Local\Temp\APKTOOL85132001874120
8575.tmp, -x, -0, arsc, -S, C:\Users\Admin\Desktop\apktool_lolly\framework-res\r
es, -M, C:\Users\Admin\Desktop\apktool_lolly\framework-res\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:89)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:481)
        ... 6 more
 
Last edited:

gamer.11

Senior Member
Dec 11, 2012
508
83
Ernakulam
Please don't take me the wrong way, you have done a very good job of it but, won't ambient display keep the screen on? Ergo meaning more battery drainage? The reason ambient display is on AMOLED screens are because of the pixel independent display, but LCD is plain old ON/OFF.
 

nikhil007mmus

Inactive Recognized Developer
Feb 26, 2011
1,866
8,794
30
Pune
Thanks a lot for the guide but it would be really appreciated if we could have a precompiled flashable zip of LRX210 stock version for direct flashing !! It would work pretty well !!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 81
    Hey guys! Today I'll be showing you how to add the Ambient Dislpay in Settings:

    a.png


    You will need
    framework-res.apk from the rom you are modding
    SystemUI.apk from your Rom
    Notepad++ or another text editor of your choice
    apktool



    Ok now we can start :)


    First decompile Systemui.apk with this comand
    Code:
    apktool d systemui.apk

    Navigate to systemui/res/values/bools and open it with Notepad++ and change this line:

    from
    PHP:
    <bool name="doze_display_state_supported">false</bool>	
    <bool name="doze_pulse_on_pick_up">false</bool>

    to
    PHP:
    <bool name="doze_display_state_supported">true</bool>	
    <bool name="doze_pulse_on_pick_up">true</bool>

    Save and ricompile systemui with this comand:
    Code:
    apktool b systemui


    Now start to mod framework-res.apk


    Decompile framework-res.apk with apktool with this comand:
    Code:
    apktool d framework-res.apk

    Navigate to framework-res/res/values/string and open it with notepad++ and change this line:

    from
    PHP:
    <string name="config_dozeComponent"></string>

    to
    PHP:
    <string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>

    Save and close.....



    Now in the same folder open bool.xml and with notepad++ and mod this line:

    from
    PHP:
    <bool name="config_dozeAfterScreenOff">false</bool>
    <bool name="config_powerDecoupleInteractiveModeFromDisplay">false</bool>

    to
    PHP:
    <bool name="config_dozeAfterScreenOff">true</bool>
    <bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>

    Save it and close....


    Now in the same folder open Interger.xml with notepad++ andmod this line:

    from
    PHP:
    <integer name="config_screenBrightnessDoze">1</integer>

    to
    PHP:
    <integer name="config_screenBrightnessDoze">17</integer>

    Now recompile with this comand:
    Code:
    apktool b framework-res.apk

    That's it!!! Enjoy with your new mod :)

    NB... Remember to insert original Signature after recompile APK,you can find in original folder on apktool


    In attachment file there is my apktool if you need ;)

    thanks to david279 for update guide
    13
    Ambient Notifications for stock Nexus 5 with stock Android 5.1 (LMY47D)

    Just created this and used adb sideload to install on my Nexus 5 with stock Android 5.1 (LMY47D). Phone boots without issue and ambient notifications work.

    Make a backup, install at your own risk, I'm not responsible for you being stupid, etc.

    EDIT: If your phone was updated to LMY47I (5.1.0r3), see post #204.
    10
    I made two flashable zip for LMY48B (5.1.1) to enable Ambient Display and revert to stock, available here: goo.gl/pNcpbV or attached below.
    8
    Hey guys,

    I edited the the zip file to install into the right directory (/system/priv-app/SystemUI) and double checked.
    Hope this helps! Thanks for the mod in the first place!
    8
    Hi everyone, I finally made 2 flashable zips for N5/Marshmallow MRA58K.
    Please let me know if everything works fine.

    Mirror on GDrive: https://goo.gl/ZPxwXG
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone