• XDA Forums have been migrated to XenForo. To discuss, report bugs and other issues, use this thread.

[MOD]Lower Auto-Brightness levels to save battery

LockeOn

New member
Sep 5, 2010
241
156
0
Lublin
Hi,

I wanted to share a little mod that could help in extending battery life - lowering default auto-brightness levels. As all of You know our big, bright SuperAMOLED Plus is an excelent display but for that it uses most of our battery:/ I like the idea of auto-brightness but I find it too bright for most of the time. Setting brightness manualy to one level makes it either too dim or it uses too much battery and switching it all the time that You go outside or turn on the light is a little bit inconvenient. In order to lower auto-brightness levels You have to change values in framework-res.apk/res/values/arrays.xml

These are stock Samsung values:

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
        <item>32</item>
        <item>69</item>
        <item>118</item>
        <item>177</item>
        <item>255</item>
    </integer-array>
These are values that I use (It is just an example):

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
        <item>5</item>
        <item>30</item>
        <item>70</item>
        <item>130</item>
        <item>255</item>
    </integer-array>
These brightness levels are corresponding to the amount of light that light sensor is getting - the lowest value is while in the low light the highest when for example your phone is in direct sunlight. Brightness values are defined by numbers 1 is the lowest possible setting and 255 is the maximum brightness that can be set.

As You can see I was pretty aggressive with lowering these values and yet the screen is still bright in every situation. You can set them a little bit higher or lower in order to suit your preferences.


Here is a guide on how to perform this mod on any framework-res.apk using apk manager (thanks for the guide goes to desean):

1. Download APK manager and unpack somewhere
2. Grab framework-res.apk from your phone under \system\framework\ (e.g. adb pull) and place it in the "place-apk-here-for-modding" folder
3. Run Script.bat and select option 9
4. Once done, go to projects\framework-res.apk\res\values\arrays.xml and edit your values as per first post.
5. Once edited, compile the apk using option 11
6. Qn: Is this a system apk. Ans: y
7. Qn: Aside from the signatures, would .... least. Ans: y
8. Prompt: In the apk manager folder u'll find a keep folder..... done then press enter on this script. Press any key to continue . . . You have to go to "keep" folder and delete resources.arsc because arrays.xml have been changed. After this You can press any key in apk manager window.
9. Once done, input 22 in apk manager and select "unsignedframework-res.apk" by entering the number that stands for it. After selecting it You should see in apk main window in the top right corner "Current-App: unsignedframework-res.apk". Now press 5 to zipalign apk. You will find your completed, zipaligned apk under place-apk-here-for-modding\unsignedframework-res.apk. Rename it back to framework-res.apk and adb push the file back to your phone

And here is a link for already modified framework-res.apk (originaly made by Kahvitahra with his modifications - APM + CRT + OS + JKays Green Battery I just added lower auto-brightness levels). It will work only with VillainRom 2.4.2:
http://www.multiupload.com/5TE5GY2J32

I hope that You'll like it:)
 
Last edited:

GadgetCheck

Inactive Recognized Developer
Sep 18, 2010
3,259
5,190
0
28
Bangalore
checkrom.com
Hi,

I wanted to share a little mod that could help in extending battery life - lowering default auto-brightness levels. As all of You know our big, bright SuperAMOLED Plus is an excelent display but for that it uses most of our battery:/ I like the idea of auto-brightness but I find it too bright for most of the time. Setting brightness manualy to one level makes it either too dim or it uses too much battery and switching it all the time that You go outside or turn on the light is a little bit inconvenient. In order to lower auto-brightness levels You have to change values in framework-res.apk/res/values/arrays.xml

These are stock Samsung values:

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
        <item>32</item>
        <item>69</item>
        <item>118</item>
        <item>177</item>
        <item>255</item>
    </integer-array>
These are values that I use (It is just an example):

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
        <item>5</item>
        <item>30</item>
        <item>70</item>
        <item>130</item>
        <item>255</item>
    </integer-array>
As You can see I was pretty aggressive with lowering these values and yet the screen is still bright in every situation. You can set them a little bit higher or lower in order to suit your preferences.

Here is a link for already modified framework-res.apk (originaly made by Kahvitahra with his modifications - APM + CRT + OS + JKays Green Battery I just added lower auto-brightness levels). It will work only with VillainRom 2.4.2:
http://www.multiupload.com/5TE5GY2J32

I hope that You'll like it:)
Thanks again ;)
 

a9402169

New member
Apr 4, 2009
190
61
0
compiled, changed the values, can't notice any difference... but I'll keep watching.

Edit:

Ok, lower values - can notice the difference, it works!
My values - 255, 140, 90, 40, 10.
 
Last edited:

bgx

New member
Dec 23, 2010
580
127
0
Yeah! Will try to compile later! Thx this was the mod I waiting for!

Sent from my GT-I9100 using XDA App

EDIT: Tryed to compile for cog 1.5 but stuck into bootloop...

EDIT2: Have made it work! Here the file for Cognition 1.5 with Lucid/Hyperdroid Theme with these params:

Code:
        <item>3</item>
        <item>30</item>
        <item>70</item>
        <item>140</item>
        <item>255</item>
 

Attachments

Last edited:
  • Like
Reactions: galinha

prosumerhacks

New member
Mar 28, 2010
730
61
0
Can you outline the procedure and tools used..just simple steps would do.. Btw is the hack working as expected? :)

Sent from my GT-I9100 using Tapatalk
 

ebliss

New member
Oct 18, 2005
494
52
0
look for APK Manager links and how to
you need to decompil framework-res.apk
then compil back
Do you have to change anything in the apk manager setting? such as compression rate?

Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
 

DanRyb

New member
Jun 6, 2010
521
126
0
Los Angeles
I really wanted to try this out, using MoDaCo but there is no framework-res.apk/res/values/arrays.xml in the framework-res.apk. Am I pulling it from the right place? I pulled it from /system/framework/
 

LockeOn

New member
Sep 5, 2010
241
156
0
Lublin
Can you outline the procedure and tools used..just simple steps would do.. Btw is the hack working as expected? :)

Sent from my GT-I9100 using Tapatalk
Excuse my ignorance, but how do I install this?

Sent from my GT-I9100
Do you have to change anything in the apk manager setting? such as compression rate?

Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
I will post a simple guide how to modify any framework-res.apk using apkmanager but it has to wait till midnight or so. Another thing is that I think that 70, 130 and 255 values can be lowered a little bit more - I have been using my phone all day while I was outside and the screen was really bright. If anyone will find some kind of perfect ultra low levels please share them, for now everybody can test their configuration. Last thing - i was using my phone a lot today and battery usage for display went down from usual 68-72% to 55-56%.
 

desean

New member
Oct 29, 2008
364
214
0
Do you have to change anything in the apk manager setting? such as compression rate?

Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
yes

I really wanted to try this out, using MoDaCo but there is no framework-res.apk/res/values/arrays.xml in the framework-res.apk. Am I pulling it from the right place? I pulled it from /system/framework/
on post 5, it is already mentioned that you need to decompile the apk first!
 

sicopat

New member
Oct 21, 2007
808
955
0
Do you have to change anything in the apk manager setting? such as compression rate?

Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
don't change compression rate
every apks located in /system folders are system apk so Yes.
you press Yes then Yes again. a keep folder is created delete ressources.acrs in it, then press any kay in apk manager windows
in place here apk to mod you have now unsignedframework-res.apk, just rename it in framework-res.apk and if you want you can zipallign it (it will work without last step)
 
  • Like
Reactions: ebliss

desean

New member
Oct 29, 2008
364
214
0
Thanks LockeOn for sharing.

Just a quick how-to for everyone else before more people post on how to apply the MOD, using APK manager (I think this is the easiest method)

Steps
  1. Download APK manager and unpack somewhere
  2. Grab framework-res.apk from your phone under \system\framework\ (e.g. adb pull) and place it in the "place-apk-here-for-modding" folder
  3. Run Script.bat and select option 9
  4. Once done, go to projects\framework-res.apk\res\values\arrays.xml and edit your values as per first post.
  5. Once edited, compile the apk using option 11
  6. Qn: Is this a system apk. Ans: y
  7. Qn: Aside from the signatures, would .... least. Ans: y
  8. Prompt: In the apk manager folder u'll find a keep folder..... done then press enter on this script. Press any key to continue . . . You have to go to "keep" folder and delete resources.arsc because arrays.xml have been changed. After this You can press any key in apk manager window.
  9. Once done, input 22 in apk manager and select "unsignedframework-res.apk" by entering the number that stands for it. After selecting it You should see in apk main window in the top right corner "Current-App: unsignedframework-res.apk". Now press 5 to zipalign apk. You will find your completed, zipaligned apk under place-apk-here-for-modding\unsignedframework-res.apk
  10. rename back to framework-res.apk and adb push the file back to your phone.

And here are the values I use, taking some values from my Hero days :p
Code:
    <integer-array name="config_autoBrightnessLcdBacklightValues">
        <item>5</item>
        <item>25</item>
        <item>60</item>
        <item>125</item>
        <item>255</item>
    </integer-array>
Since some MOD (like APM for example) make changes to the framework-res.apk, it is better for you to do your own instead of begging others to do and post here.

Edit1: Updated steps as recommended by LockeOn

Edit2: using more aggressive values now after few days testing
Code:
    <integer-array name="config_autoBrightnessLcdBacklightValues">
        <item>2</item>
        <item>15</item>
        <item>32</item>
        <item>100</item>
        <item>200</item>
    </integer-array>
before this, i was always using minimum brightness instead of auto brightness thus decided to set 32 and below for majority of the values. it works for me when i am indoor and outdoor under low light. when outdoors under brightness, the increase is bright enough for me so I believe i have found my sweet spot :D

note that my environment and preference may diff from everyone so what works for me may not work for you :p
 
Last edited:
Our Apps
Get our official app! (coming soon)
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