Related
As more and more people are interested to port roms from other phones to our x10, these 2 features are usually missing and need some modifications to work properly.
Here is a simple guide to enable these 2 features on our x10
Pre-Requisite
1. You need to know how to use apktool or any tool that can decompile/compile apks.
2. You need to know how to use smali/baksmali tool
This is not a tutorial of how to use apktool or smali tool. Please google for the above for downloads and tutorials
Credits to Z&J for their great FreeX10 rom that provides a base for reference.
Enable Hardware LED
You need to modify framework-res.apk (in /system/framework folder)
1. backup the original framework-res.apk
2. use apktool to decode framework-res.apk to a folder
syntax:
Code:
apktool d framework-res.apk
This should create a folder "framework-res" in the current folder
3. use a text editor (eg notepad++) to open the file <foldername>/res/values/array.xml
look for something similar to below:
Code:
<integer-array name="config_autoBrightnessLevels">
<item>200</item>
<item>400</item>
<item>1000</item>
<item>3000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>25</item>
<item>55</item>
<item>70</item>
<item>70</item>
<item>250</item>
</integer-array>
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>255</item>
<item>255</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
<integer-array name="config_autoBrightnessKeyboardBacklightValues">
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
and replace it with:
Code:
<array name="config_autoBrightnessLevels" />
<array name="config_autoBrightnessLcdBacklightValues" />
<array name="config_autoBrightnessButtonBacklightValues" />
<array name="config_autoBrightnessKeyboardBacklightValues" />
4. open the file <foldername>/res/values/bools.xml
looks for the line:
Code:
<bool name="config_automatic_brightness_available">true</bool>
and change the word "true" to "false"
5. compile the apk
syntax:
Code:
apktool b <foldername>
6. replace the resources.arsc in original framework-res.apk with the one in <foldername>/build/apk folder
Note: I use TotalCommander as it has 2 pane windows and can open apk file as folder but there should be many guides in the App & Theme section
that teach you how to replace resources file in framework-res.apk
7. replace the framework-res.apk in /system/framework folder
8. reboot
Enable Camera Flash Light
You need to modify services.jar (in /system/framework folder)
1. backup the original services.jar
2. use winrar to extract classes.dex from services.jar
3. use smali/baksmali tool to decode classes.dex to a folder
syntax:
Code:
java -jar baksmali.jar -o <foldername>/ classes.dex
4. use a text editor (eg notepad++) to open the file <foldername>/com/android/server/LightsService.smali
5. look for lines that contain this (there should be 5 of them):
Code:
"/sys/class/leds/spotlight/brightness"
or
"/sys/class/leds/flashlight/brightness"
and replace it with:
Code:
"/sys/class/leds/lv5219lg:fled/spotlight_enable"
6. use smali/baksmali tool to compile classes.dex
syntax:
Code:
java -Xmx512M -jar smali.jar <foldername>/ -o classes.dex
7. replace classes.dex in services.jar with the new classes.dex using winrar
8. replace the services.jar in /system/framework folder
9. reboot
10. test it with switchpro or LED Light (from market) or vignette (provided camera works)
Notes:
1. If booting fails that'd mean something wrong in compiling / packing the apk. please replace the original file
2. The method may not apply to every rom. Do it at your own risk.
Pls hit "Thanks" if it helps you
This guide was so badly needed,
awesome job bro.... Thumbs up to this awesome guide
@cobrato
thank you for this!!!
it will help many ppl who r porting ROMs
@all
u can find the above mentioned tools in most android kitchens [email protected]
some useful links:
one of the best kitchens available: dsixda's HTC Android Kitchen
for smali/baksmali tool http://code.google.com/p/smali/
EASYapkTOOLcompilerDECOMPILER
can this be used to turn of the keyboard lights?
can someone make a xrec zip for this?
Would a flashable zip be possible?
sent from my gingerbread powered c64 with NO wlod
chiefy009 said:
Would a flashable zip be possible?
sent from my gingerbread powered c64 with NO wlod
Click to expand...
Click to collapse
Of course it will be possible. But it will be rom secific.
Sent from my X10project using XDA Premium App
Ask for patch in TripNreaver Miui 1.0.6
Hi,
Im dumb in commandline, so i ask for someone please to help me in make this patch.
Im ataching the framework_res.apk and services.jar from tripmiui 1.0.6.
http://www.megaupload.com/?d=GK7UQZF0
thanks in advance.
Has anybody checked if this works?
Cobrato appreciate that someone took out a patch for 1.0.63 tripmiui?
Hello, i keep breaking my device...:-( stuck in step 6...
Thanks cobrato , can you make this work in a flashable zip format so we can install it directly to the phone with the no hassle of typing.
flashable zip will be really greatfull...
For flashable zip you'll need to do it for each rom and that's not the purpose of this thread
For those who are interested. Applied to Trip's MIUI 1.07 using this tutorial. (Great COBS! Easy to follow!)
framework - http://dl.dropbox.com/u/11996466/framework-res.apk
Services.jar - http://dl.dropbox.com/u/11996466/services.jar
It works for me!
armic said:
For those who are interested. Applied to Trip's MIUI 1.07 using this tutorial. (Great COBS! Easy to follow!)
framework - http://dl.dropbox.com/u/11996466/framework-res.apk
Services.jar - http://dl.dropbox.com/u/11996466/services.jar
It works for me!
Click to expand...
Click to collapse
Are those the files needed for trips 1.07?
Sent from my X10i TripNMiUI using XDA App
kylec said:
Are those the files needed for trips 1.07?
Sent from my X10i TripNMiUI using XDA App
Click to expand...
Click to collapse
try Trips' without this and observe if there are hardware led and flash using vig.
armic said:
For those who are interested. Applied to Trip's MIUI 1.07 using this tutorial. (Great COBS! Easy to follow!)
framework - http://dl.dropbox.com/u/11996466/framework-res.apk
Services.jar - http://dl.dropbox.com/u/11996466/services.jar
It works for me!
Click to expand...
Click to collapse
hey, great job.
which permissions need to be set for framework-res.apk to work?
can it use for enable flash light for video recording in cm 6.1.3 ?
pedrocel85 said:
hey, great job.
which permissions need to be set for framework-res.apk to work?
Click to expand...
Click to collapse
Both
X X -
X - -
X - -
Sent from my X10i TripNMiUI using XDA Premium App
farzin_silver said:
can it use for enable flash light for video recording in cm 6.1.3 ?
Click to expand...
Click to collapse
As COB said, we need to do it on every ROM separately.
Sent from my X10i TripNMiUI using XDA Premium App
Found it here:
http://forum.xda-developers.com/showthread.php?t=1034743
Sucessfully made it working an my Evo3D.
Should save a lot of battery..
I've used apktool instead of apk manager, doesnt work for me with apk manager.
How to deal with apktool?:
http://forum.xda-developers.com/showthread.php?t=1225558
- Take the steps 1 - 5 (pull the framework-res instead of SystemUI.apk)
- go to the decompiled folder->res->values: array.xml
and edit the valus as described here:
steps 13-15:
http://forum.xda-developers.com/showthread.php?t=1034743
you could just take values of the attached array.xml file.
...on GSM Leedroid I got bootloops when I was using values under 20...
Then take the steps 7 to the end from here:
http://forum.xda-developers.com/showthread.php?t=1225558
use framework-res instead of SystemUI
AND drag&drop the ressources.arsc from new compiled to original framework-res.apk with 7zip.
Turge said:
That worked perfectly. Here's what I did:
Pulled the framework: adb pull /system/framework/framework-res.apk
Pulled the resources: adb pull /system/framework/com.htc.resources.apk
Decompiled the framework-res APK: apktool d framework-res.apk
Edited arrays.xml with the new values
Recompiled the APK: apktool b framework-res framework-res-new.apk
Dragged and dropped resource.arsc from framework-res-new.apk to framework-res.apk
Pushed the modified APK: adb push framework-res.apk /system/framework/
Set the permissions - omitted this step since it has enough permission
Rebooted
I'll need to tweak the settings since it's a little low atm..
Click to expand...
Click to collapse
gl
Awesome sauce!
I used this to mod - http://forum.xda-developers.com/showthread.php?t=1193149
I'm a tiny bit surprised this hasn't gotten more responses with how much people ***** about the auto-brightness. lol
I just did this, waiting for phone to reboot. should it be smoking?....
kidding. anyways, I dropped the 1st half of the values, added more steps to make transitions a little smoother. *cross fingers and wafts smoke away from face*
Or you could skip all that bull**** and just use root explorer and goto
/sys/devices/platform/leds-pm8050/leds/button-backlight/currents. Open currents in text editor and change value 20 to value 2. It will lower them by more than half. Don't forget to save before you exit.
mattfmartin said:
Or you could skip all that bull**** and just use root explorer and goto
/sys/devices/platform/leds-pm8050/leds/button-backlight/currents. Open currents in text editor and change value 20 to value 2. It will lower them by more than half. Don't forget to save before you exit.
Click to expand...
Click to collapse
OK.... I see several references to LED and buttons and such.. you sure this has to do.with the autobrightness of the screen?..
Sent from my PG86100 using Tapatalk
felacio said:
OK.... I see several references to LED and buttons and such.. you sure this has to do.with the autobrightness of the screen?..
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
Nope it doesn't. Read to fÄst. Thought it was another bright capacitive led thread.
Did you managed to get it working felacio? Which rm you are using? If you want I can do it for you..
Sent from my HTC EVO 3D X515m using XDA Premium App
j4n87 said:
Did you managed to get it working felacio? Which rm you are using? If you want I can do it for you..
Click to expand...
Click to collapse
Oh yeah. The sensor is very crude. The other values I added are ignored. It was set for 11 and 41 lux values. I changed the 41 to 31. The phone ignores the 31 value and changes the brightness at 41 still. So. With that in mind. I need to find a brighter brightness for the lowest value because it won't trigger in soft lit conditions. But its just a tad too dark for those soft lit situations. So.....
Anyways. Yeah! It worked. Just gotta work with my values. Lol.
Sent from my PG86100 using Tapatalk
oh, okay..yeah also noticed that the sensivity is a bit slow.
But still better than the standard configuration
felacio said:
Oh yeah. The sensor is very crude. The other values I added are ignored. It was set for 11 and 41 lux values. I changed the 41 to 31. The phone ignores the 31 value and changes the brightness at 41 still. So. With that in mind. I need to find a brighter brightness for the lowest value because it won't trigger in soft lit conditions. But its just a tad too dark for those soft lit situations. So.....
Anyways. Yeah! It worked. Just gotta work with my values. Lol.
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
So what's the exact procedure for this?
1. Use APK Tool to decompile the framework-res APK (apktool d framework-res.apk)
2. Edit arrays.xml with the values
3. Recompile the APK (apktool b framework-res framework-res.apk)
4. Push the APK to /system/framework/
5. Set the permissions
6. Reboot
I obviously screwed up a step because my boot animation kept looping until I pushed the original APK and rebooted. The new APK is also almost half the size as the original...
Turge said:
So what's the exact procedure for this?
1. Use APK Tool to decompile the framework-res APK (apktool d framework-res.apk)
2. Edit arrays.xml with the values
3. Recompile the APK (apktool b framework-res framework-res.apk)
4. Push the APK to /system/framework/
5. Set the permissions
6. Reboot
I obviously screwed up a step because my boot animation kept looping until I pushed the original APK and rebooted. The new APK is also almost half the size as the original...
Click to expand...
Click to collapse
updated op with step 7-end.
j4n87 said:
updated op with step 7-end.
Click to expand...
Click to collapse
Ahh.. this is probably what I was looking for: drag&drop the ressources.arsc from new compiled to original framework-res.apk with 7zip.
Thanks, I'll try it after lunch using WinRAR.
you're welcome
j4n87 said:
you're welcome
Click to expand...
Click to collapse
That worked perfectly. Here's what I did:
Pulled the framework: adb pull /system/framework/framework-res.apk
Pulled the resources: adb pull /system/framework/com.htc.resources.apk
Decompiled the framework-res APK: apktool d framework-res.apk
Edited arrays.xml with the new values
Recompiled the APK: apktool b framework-res framework-res-new.apk
Dragged and dropped resource.arsc from framework-res-new.apk to framework-res.apk
Pushed the modified APK: adb push framework-res.apk /system/framework/
Set the permissions - omitted this step since it has enough permission
Rebooted
I'll need to tweak the settings since it's a little low atm..
Turge said:
That worked perfectly. Here's what I did:
Pulled the framework: adb pull /system/framework/framework-res.apk
Pulled the resources: adb pull /system/framework/com.htc.resources.apk
Decompiled the framework-res APK: apktool d framework-res.apk
Edited arrays.xml with the new values
Recompiled the APK: apktool b framework-res framework-res-new.apk
Dragged and dropped resource.arsc from framework-res-new.apk to framework-res.apk
Pushed the modified APK: adb push framework-res.apk /system/framework/
Set the permissions - omitted this step since it has enough permission
Rebooted
I'll need to tweak the settings since it's a little low atm..
Click to expand...
Click to collapse
yeah, thats the right way
..will add this to the OP
j4n87 said:
yeah, thats the right way
..will add this to the OP
Click to expand...
Click to collapse
Cool.
By the way, you can see the settings used via "adb shell" using the command: logcat | grep lcdValue
D/PowerManagerService( 245): New lightsensor value:90, lcdValue:60
D/PowerManagerService( 245): New lightsensor value:10, lcdValue:20
D/PowerManagerService( 245): New lightsensor value:10, lcdValue:20
D/PowerManagerService( 245): New lightsensor value:160, lcdValue:80
D/PowerManagerService( 245): New lightsensor value:90, lcdValue:60
D/PowerManagerService( 245): New lightsensor value:90, lcdValue:60
D/PowerManagerService( 245): New lightsensor value:90, lcdValue:60
D/PowerManagerService( 245): New lightsensor value:160, lcdValue:80
D/PowerManagerService( 245): New lightsensor value:40, lcdValue:40
Is it safe to assume that this method will work on Sensation?
KrisHilbun said:
Is it safe to assume that this method will work on Sensation?
Click to expand...
Click to collapse
Yep. I did if for a friends sensation. Same process.
Doesn't work
Hi,
I tried doing this and followed the exact steps (used the values from the other posting) and when the phone finishes rebooting, the screen stays in the dimmest value rather then adjusting by itself when I set it to auto brightness.
The only different thing I did was instead of using ADB, I used root explorer to pull out framework-res and com.htc into my SD card then moved that to my apktool folder to extract. Then used root explorer to copy it back into system/framework and applied the same permissions as it was before.
Any ideas?
I jumped to a new rom and ran also to issues. My phone was in a bootloop after editing the array xml. Got a "devide by zero fatal exception" - found out, that the lowest value I can us is 21 - the array.xml in the thread i linked is starting with 5 i think.
My current array.xml:
Code:
</integer-array>
<integer-array name="config_autoBrightnessLevels">
<item>11</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>21</item>
<item>21</item>
<item>41</item>
<item>72</item>
<item>110</item>
<item>145</item>
<item>186</item>
<item>208</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>21</item>
<item>41</item>
<item>88</item>
<item>145</item>
<item>145</item>
<item>145</item>
<item>186</item>
<item>208</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>21</item>
<item>41</item>
<item>88</item>
<item>145</item>
<item>145</item>
<item>186</item>
<item>208</item>
<item>231</item>
<item>255</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>255</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
<integer-array name="config_autoBrightnessKeyboardBacklightValues">
<item>255</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
</integer-array>
..are you also sure, that you have all object tags opend/close correctly?
Sometimes I copied too much/less from one to other xml and also got faulty behaviour.
Thanks To Peetr_ for his Hybrid Rom
Thanks to LockeOn for His detailed guide
If you think the brightness of LCD is high during low light or night, if you think the button back light is not necessary during day time then this mod is for you.
This is a modified framework-res.apk of peetr_'s Hybrid rom. Modified LCD auto brightness
levels and button back light for better battery life.Button back light only illuminate at low brightness level.
I am using this mode for past few days without any issue. Use it at your own risk.
BUILT IN AUTOBRIGHTNESS LEVELS
<item>30</item>
<item>100</item>
<item>200</item>
<item>300</item>
<item>800</item>
<item>1500</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>30</item>
<item>60</item>
<item>100</item>
<item>140</item>
<item>200</item>
<item>225</item>
<item>250</item
MODIFIED AUTOBRIGHTNESS LEVELS
<integer-array name="config_autoBrightnessLevels">
<item>3</item>
<item>10</item>
<item>20</item>
<item>30</item>
<item>60</item>
<item>90</item>
<item>120</item>
<item>180</item>
<item>250</item>
<item>500</item>
<item>800</item>
<item>1200</item>
<item>1800</item>
<item>2500</item>
<item>5000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>13</item>
<item>18</item>
<item>25</item>
<item>30</item>
<item>40</item>
<item>50</item>
<item>60</item>
<item>70</item>
<item>80</item>
<item>90</item>
<item>100</item>
<item>120</item>
<item>150</item>
<item>180</item>
<item>210</item>
<item>240</item>
</integer-array>
Installation
1. Copy your framework-res.apk from system/framework/ to sd card as a backup using Es file explorer or root explorer
2. Copy attached framework-res.apk to System/framework and overwrite it.
3. After overwriting Phone will reboot.
4. After reboot Change the permission of framework-res.apk to rw-r-r
Tested in my Electrify that running Peetr_'s Hybrid locked rom. It may not work with other roms.
Sorry for my English
pradeeppk said:
Thanks To Peetr_ for his Hybrid Rom
Thanks to LockeOn for His detailed guide
If you think the brightness of LCD is high during low light or night, if you think the button back light is not necessary during day time then this mod is for you.
This is a modified framework-res.apk of peetr_'s Hybrid rom. Modified LCD auto brightness
levels and button back light for better battery life.Button back light only illuminate at low brightness level.
I am using this mode for past few days without any issue. Use it at your own risk.
BUILT IN AUTOBRIGHTNESS LEVELS
<item>30</item>
<item>100</item>
<item>200</item>
<item>300</item>
<item>800</item>
<item>1500</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>30</item>
<item>60</item>
<item>100</item>
<item>140</item>
<item>200</item>
<item>225</item>
<item>250</item
MODIFIED AUTOBRIGHTNESS LEVELS
<integer-array name="config_autoBrightnessLevels">
<item>3</item>
<item>10</item>
<item>20</item>
<item>30</item>
<item>60</item>
<item>90</item>
<item>120</item>
<item>180</item>
<item>250</item>
<item>500</item>
<item>800</item>
<item>1200</item>
<item>1800</item>
<item>2500</item>
<item>5000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>13</item>
<item>18</item>
<item>25</item>
<item>30</item>
<item>40</item>
<item>50</item>
<item>60</item>
<item>70</item>
<item>80</item>
<item>90</item>
<item>100</item>
<item>120</item>
<item>150</item>
<item>180</item>
<item>210</item>
<item>240</item>
</integer-array>
Installation
1. Copy your framework-res.apk from system/framework/ to sd card as a backup using Es file explorer or root explorer
2. Copy attached framework-res.apk to System/framework and overwrite it.
3. After overwriting Phone will reboot.
4. After reboot Change the permission of framework-res.apk to rw-r-r
Tested in my Electrify that running Peetr_'s Hybrid locked rom. It may not work with other roms.
Sorry for my English
Click to expand...
Click to collapse
Thanks
MarcquisDale said:
Thanks
Click to expand...
Click to collapse
Please share your experience if you tried it. I am noticed a good improvement in battery life and less strain for my eyes. Actually it will Not harm anything. If you don't like the mod just replace it with the backup framework-res.apk. Or if you need more or less brightness in any levels please report. I will modify and upload another framework-res.apk. You can check the variation of lcd brightness using android sensorbox application.
Sent from my Motorola Electrify using Tapatalk 2
pradeeppk said:
Please share your experience if you tried it. I am noticed a good improvement in battery life and less strain for my eyes. Actually it will Not harm anything. If you don't like the mod just replace it with the backup framework-res.apk. Or if you need more or less brightness in any levels please report. I will modify and upload another framework-res.apk. You can check the variation of lcd brightness using android sensorbox application.
Sent from my Motorola Electrify using Tapatalk 2
Click to expand...
Click to collapse
Its running great so far
pradeeppk said:
Thanks To Peetr_ for his Hybrid Rom
Thanks to LockeOn for His detailed guide
If you think the brightness of LCD is high during low light or night, if you think the button back light is not necessary during day time then this mod is for you.
This is a modified framework-res.apk of peetr_'s Hybrid rom. Modified LCD auto brightness
levels and button back light for better battery life.Button back light only illuminate at low brightness level.
I am using this mode for past few days without any issue. Use it at your own risk.
BUILT IN AUTOBRIGHTNESS LEVELS
<item>30</item>
<item>100</item>
<item>200</item>
<item>300</item>
<item>800</item>
<item>1500</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>30</item>
<item>60</item>
<item>100</item>
<item>140</item>
<item>200</item>
<item>225</item>
<item>250</item
MODIFIED AUTOBRIGHTNESS LEVELS
<integer-array name="config_autoBrightnessLevels">
<item>3</item>
<item>10</item>
<item>20</item>
<item>30</item>
<item>60</item>
<item>90</item>
<item>120</item>
<item>180</item>
<item>250</item>
<item>500</item>
<item>800</item>
<item>1200</item>
<item>1800</item>
<item>2500</item>
<item>5000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>13</item>
<item>18</item>
<item>25</item>
<item>30</item>
<item>40</item>
<item>50</item>
<item>60</item>
<item>70</item>
<item>80</item>
<item>90</item>
<item>100</item>
<item>120</item>
<item>150</item>
<item>180</item>
<item>210</item>
<item>240</item>
</integer-array>
Installation
1. Copy your framework-res.apk from system/framework/ to sd card as a backup using Es file explorer or root explorer
2. Copy attached framework-res.apk to System/framework and overwrite it.
3. After overwriting Phone will reboot.
4. After reboot Change the permission of framework-res.apk to rw-r-r
Tested in my Electrify that running Peetr_'s Hybrid locked rom. It may not work with other roms.
Sorry for my English
Click to expand...
Click to collapse
thanx
did the first 3 steps on my stock, locked, rooted 2.3.4 photon
Installation
1. Copy your framework-res.apk from system/framework/ to sd card as a backup using Es file explorer or root explorer
2. Copy attached framework-res.apk to System/framework and overwrite it.
3. After overwriting Phone will reboot.
Click to expand...
Click to collapse
my phone will hang at the sprint "now" screen at bootup, and then vibrate. It will restart and hang at the sprint "now" screen again, and then shut off. Sometimes it will get past the "now" screen and get into a "starting services" screen, but hang there. How can I fix this? I did make a copy of my original, and it is on my microSD.
Edit: got my phone working again after SBF to stock.
This mode is only for peetr_s hybrid rom
Sent from my Electrify using Tapatalk
Thanks
Sent from my MB855 using XDA Free mobile app
I hope this is the correct forum
I am doing this to Cyanogenmod 11.
I want to add an option to Settings > Interface > Status Bar > Signal Status Style. I am so close to having it done, but there is one thing I am missing, and that is actually getting the radio button to switch the Icon to the correct .java. Here is what I have done so far:
Added to Setting/res/values/cm_strings.xml;
Code:
<string name="status_bar_signal_style_always">Always show type</string>
Added two lines to Settings/res/values/cm_arrays.xml;(marked with *'s)
Code:
<string-array name="entries_status_bar_signal" translatable="false">
<item>@string/status_bar_signal_style_icon</item>
<item>@string/status_bar_signal_style_text</item>
*<item>@string/status_bar_signal_style_always</item>
<item>@string/status_bar_style_hidden</item>
</string-array>
<string-array name="values_status_bar_signal" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
*<item>3</item>
</string-array>
Created a new java file named SignalClusterAlwaysView.java in SystemUI/src/com/android/systemui/statusbar and signal_cluster_always_view.xml in SystemUI/res/layout, respectively;
Added to SystemUI/res/layout/status_bar.xml;
Code:
<include layout="@layout/signal_cluster_always_view"
android:id="@+id/signal_cluster_always"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
Added (changed STYLE_HIDDEN to 3) in SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java.
Code:
public static final int STYLE_ALWAYS = 2;
Really all I am trying to do is create a setting to show network type even while WiFi is connected. This is accomplished by simply clearing this line from SignalClusterView.java,
Code:
mMobileType.setVisibility(
!mWifiVisible ? View.VISIBLE : View.GONE);
and changing android:layout_marginEnd to 3dip in signal_cluster_view.xml.
I can't seem to figure out how the existing setting for a text only network icon sends that to SystemUI. I've explored StatusBar.java in the Settings.apk source, and I think the issue may be in this line,
Code:
int signalStyle = Settings.System.getInt(resolver, Settings.System.STATUS_BAR_SIGNAL_TEXT, 0);
where it is setting the value of the option selected to Settings.System.STATUS_BAR_SIGNAL_TEXT. I think it is properly setting the value to 2, like I want, but it still sees 2 as HIDDEN instead of ALWAYS; or that it does see I want ALWAYS, but doesn't know to refer to SignalClusterAlwaysView.java in SystemUI.
What am I missing? Is there an easier way to do this?
Sorry if this is in the wrong thread.
I just checked, and yes, the value of STATUS_BAR_SIGNAL is changing to my intended values. My one missing link is defining what those values do.
Where is the file that contains the value assignments? i.e. STATUS_BAR_SIGNAL = 1 starts StatusBarTextView.java in systemui, while 2 and 3 don't do anything. I don't care about 3, just need to make 2 start StatusBarAlwaysView.java (or that process, obviously it isn't .java once compiled).
I answered my own question here: http://stackoverflow.com/questions/21869758/adding-a-setting-option-in-android-settings-apk/21881423#21881423
Hello Xperia lovers..
I want to share how to improve image quality. If you like mobile photography, you can try this mod. I have try this on my z3c .232
Requirement:
1. root access to system file
2. Little knowledge for edit code
First step:
Go to system/etc, and find media_profiles.xml
find code:
Code:
<!ATTLIST ImageEncoding quality (90|80|70|60|50|40) #REQUIRED>
Change to:
Code:
<!ATTLIST ImageEncoding quality (100|100|100|100|100|100) #REQUIRED>
---
Then find this code (have 2 line similiar, front cam & back cam):
Code:
<ImageEncoding quality="95" />
<ImageEncoding quality="80" />
<ImageEncoding quality="70" />
Change to:
Code:
<ImageEncoding quality="100" />
<ImageEncoding quality="100" />
<ImageEncoding quality="100" />
---------------------
Now add this code to build.prop , if it already exists no need:
Code:
ro.media.dec.jpeg.memcap=20000000
ro.media.enc.jpeg.quality=100
DONE!!!
don't forget restart
I also attach my media_profiles.xml already modified.
Thanks to:
for Guide -> [GUIDE][CAM] How To Hack SONY Xperia Camera (Bring Higher Bitrate & More Options)
Great. Noce job man. Can you post some pictures taked after this mod?
I moded my media_profiles as the OP instructed and i can see that the pics are now 7+ mb. It's cold and cloudy here where i live so i can't test the quality itself yet,but the compression is definitely lowered and files are bigger now. Thanx for your share
No difference
I see no difference in quality or size - in Superior Auto at 20MP (with xposed module 20MP Superior Auto) .
With or without the mod the pictures have around 7.5Mb (same ISO and Exposure time).
Might be the xposed module ......
currently use the Z5 cam libs [mod]
toke some foto b4 n after the change in media profile. [with same parameter / SA]
in my amateur opinion, there is no significant differences...
but maybe i do some mistakes in the doing...
in what line should i add code in build.prop?
dark.blue said:
but maybe i do some mistakes in the doing...
in what line should i add code in build.prop?
Click to expand...
Click to collapse
You can add the Lines in the build.prop under ADDITIONAL_BUILD_PROPERTIES
My phone keeps restarting after i done this??
Bootloop too
benalouas said:
Bootloop too
Click to expand...
Click to collapse
i think you change or delete something by mistake in build.prop.. i made that change and it`s ok .. no bootloop ..
No no i just did exactly what is written, nothing more nothing less
why the image quality is so bad in this phone?
post results please
Is it right like that?
Hello is it right like that? Thanks so lot I mean inkl that ##?
# Touch
sys.cover_state=0
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.media.dec.jpeg.memcap=20000000
ro.media.enc.jpeg.quality=100
ro.product-res-path=framework/SemcGenericUxpRes/SemcGenericUxpRes.apk
keyguard.no_require_sim=true
ro.com.android.dataroaming=false
ro.com.android.dateformat=MM-dd-yyyy
ro.carrier=unknown
ro.vendor.extension_library=libqti-perfd-client.so]
Any results?
Hy!! Firstly thank you for this tip/mod. Im a newb so my question is do i need to root my z3c first or no need?
@bigdanny3
Yep.
Logger82 said:
Hello is it right like that? Thanks so lot I mean inkl that ##?
# Touch
sys.cover_state=0
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.media.dec.jpeg.memcap=20000000
ro.media.enc.jpeg.quality=100
ro.product-res-path=framework/SemcGenericUxpRes/SemcGenericUxpRes.apk
keyguard.no_require_sim=true
ro.com.android.dataroaming=false
ro.com.android.dateformat=MM-dd-yyyy
ro.carrier=unknown
ro.vendor.extension_library=libqti-perfd-client.so]
Click to expand...
Click to collapse
Any results for my question??
Thanks
Logger82 said:
Any results for my question??
Thanks
Click to expand...
Click to collapse
Yes. "#" without qoutes means it is skipps reading this line (each line with text you dont want to be read has to have # at the beginning). You can also use it to disable code lines. Though you only need it to be like this since the "ADDITIONAL_BUILD_PROPERTIES" doesnt break into the next text row.
# Touch
sys.cover_state=0
# ADDITIONAL_BUILD_PROPERTIES
ro.media.dec.jpeg.memcap=20000000
ro.media.enc.jpeg.quality=100
ro.product-res-path=framework/SemcGenericUxpRes/SemcGenericUxpRes.apk
keyguard.no_require_sim=true
ro.com.android.dataroaming=false
ro.com.android.dateformat=MM-dd-yyyy
ro.carrier=unknown
ro.vendor.extension_library=libqti-perfd-client.so]
Click to expand...
Click to collapse