[KERNEL][STOCK 4.2.2][I9195/I257M] Enhanced Kernel #2 - sweep2sleep, fastcharge, etc - Galaxy S 4 Mini Original Android Development

Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
For TouchWiz 4.2.2 only, based on SGH-I257M_NA_JB_Opensource_Update1
Features:
- SELinux permissive mode
- Undervolt (default on for lower frequencies)
- Fast charge
- Max screen off frequency (default on @ 702mhz)
- Sweep2sleep (default on, swipe from right-to-left at the bottom of the screen to turn off)
Download here (Flash in recovery)
Configuration:
Fast charge:
(can also use Trickster Mod or other apps)
Code:
echo 1 > /sys/kernel/fast_charge/force_fast_charge to turn on
echo 0 > /sys/kernel/fast_charge/force_fast_charge to turn off
Undervolt:
Use Trickster Mod or look in /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
Max screen off frequency:
Code:
echo 1 > /sys/kernel/screen_limit/enable to turn on
echo 0 > /sys/kernel/screen_limit/enable to turn off
echo FREQUENCY > /sys/kernel/screen_limit/max_frequency
Valid frequencies for S4 Mini:
384000 486000 594000 702000 810000 918000 1026000 1134000 1242000 1350000 1458000 1566000 1674000 1728000
Sweep2sleep:
Code:
echo 1 > /sys/power_actions/mode to turn on
echo 0 > /sys/power_actions/mode to turn off
Sweep2wake, doubletap2wake (experimental!)
Code:
echo 2 > /sys/power_actions/mode (sweep2wake only)
echo 3 > /sys/power_actions/mode (sweep2sleep, sweep2wake)
echo 4 > /sys/power_actions/mode (doubletap2wake only)
echo 5 > /sys/power_actions/mode (sweep2sleep, doubletap2wake)
Source: Github

..

Flashed successfully on MJ7 and seems to work just fine. :thumbup:
Sent from my GT-I9195 using xda app-developers app

Really looking forward to this kernel...
Mitko said:
Flashed successfully on MJ7 and seems to work just fine. :thumbup:
Sent from my GT-I9195 using xda app-developers app
Click to expand...
Click to collapse
All the features works ok? How's battey life?

Very nice features, i will definitely try this kernel!
I would love to see bln though since samsung is still not convinced notification leds are a good thing...
Should we use the same zip for both supported s4 mini variants?
Thanks for your work!

Doubletap2wake? OMG! Is it working?

lipalok said:
Doubletap2wake? OMG! Is it working?
Click to expand...
Click to collapse
on a big smartphone, which has no physical home button and where it's not that easy to reach the power button (for example htc one)
I can understand the benefit of this feature.
But why would you like to sacrifice battery for something that could be also done by just pressing the home button (or power button) ONCE?

junkyde said:
on a big smartphone, which has no physical home button and where it's not that easy to reach the power button (for example htc one)
I can understand the benefit of this feature.
But why would you like to sacrifice battery for something that could be also done by just pressing the home button (or power button) ONCE?
Click to expand...
Click to collapse
Yes, you're right, it sounds good if there would be an ability to enable/disable this feature in settings. For me it's only a memorial of my times with Nokia.

Initial post updated, kernel #2 is up, stock undervolt + fast charge fixes.
junkyde said:
on a big smartphone, which has no physical home button and where it's not that easy to reach the power button (for example htc one)
I can understand the benefit of this feature.
But why would you like to sacrifice battery for something that could be also done by just pressing the home button (or power button) ONCE?
Click to expand...
Click to collapse
Not sure why you felt the need to post this haha. First of all, I agree, which is why only sweep2sleep is enabled by default. However, everybody's usecase is different and to be blunt, it's none of your business how anybody uses their phone. I could mention broken hardware keys, or about my close friend who is unable to put pressure on his right hand to press down on physical keys. I also enjoyed porting and rewriting parts of the code and simply decided to share my work.

Tried flashing minikernel-2.zip Status 7 installation aborted gt-i9195L
EDIT: nevermind.. tried 2 more time, flashed succesfully! testing now
EDIT2: sweep to sleep works great! but double tap 2 wake doesn't work after typing in terminal with su
echo 4 > /sys/power_actions/mode
or
echo 5 > /sys/power_actions/mode

rob43 said:
Not sure why you felt the need to post this haha.
Click to expand...
Click to collapse
I just quoted a user who seemed to be very excited about this feature, so I asked him why this is so important for him. He gave me an answer and everything is fine. I just wanted to understand why he would like to use this feature.
rob43 said:
However, everybody's usecase is different and to be blunt, it's none of your business how anybody uses their phone.
Click to expand...
Click to collapse
Okay sir, I will never ask someone about how they use their phone, because I understand that this is something very private and intimate

very interesting kernel
how about battery life with new features?

App for kernel features
Because i don't like to use the terminal I created a quick app to enable/disable kernel features.
Supported atm:
Fastcharge & Sleep/Wake options
Apply settings on boot
Not supported (use other apps for this):
Undervolting, frequencies,...
All credits for these functions go to rob43, I only made the interface.
Have fun!
If someone is interested in the source just ask and I will put it on github.

@rob43 Is OTG possible? I mean without external power. Sorry for asking it on almost every thread, but no developer has answered to my request. BTW, are you going to release an AOSP based kernel?
Here's my OTG issue related thread :
http://forum.xda-developers.com/showthread.php?t=2661580&page=4

Hi Rob!
Thanks for sharing your work with us! I'm using this kernel with stock ML4 for a full day now and here's what I experienced:
1) sweep2sleep: works absolutely fine.
2) sweep2wake and doubletap2wake: these features only work for a short while after the screen is off. I'm guessing this is while the device is no in deep sleep.
3) performance: compared to stock kernel it feels a bit laggy. What governors are supported and which one is default?
4) wifi: there is an issue with turning on wifi when coming from stock. Maybe a different driver? Don't know, but I experienced the same with f4ktion kernel last week.

superkoal said:
Hi Rob!
Thanks for sharing your work with us! I'm using this kernel with stock ML4 for a full day now and here's what I experienced:
1) sweep2sleep: works absolutely fine.
2) sweep2wake and doubletap2wake: these features only work for a short while after the screen is off. I'm guessing this is while the device is no in deep sleep.
3) performance: compared to stock kernel it feels a bit laggy. What governors are supported and which one is default?
4) wifi: there is an issue with turning on wifi when coming from stock. Maybe a different driver? Don't know, but I experienced the same with f4ktion kernel last week.
Click to expand...
Click to collapse
Is there a stock kernel anywhere that I could go back to if things were to go wacky, want to do this to the gf phone but if the wireless acts up she will freak haha

Can you mod it for i9192. Thanks for your helps.

What about GT-I9192?

sajid0786 said:
What about GT-I9192?
Click to expand...
Click to collapse
I9192 is version 2 sim of s4 mini. I hope it has OTG, MHL and fast charge.

does it include the Battery drain patches present in SilviuMik kernel? does baseband and compilation number change? i alredy have a flagged knox because i flashed CWM (i dont really know what are the issues with having knox flagged) my baseband is I9192UBUCOC2 and my compilation number is KOT49H.I9192UBUCOC2.
can i use this kernel?

Related

[Q] How to disable "Slide to Turn Off/On" with Capacitive buttons

I am using CoolSense 14a.
I noticed that when the screen is turned off, the capacitive buttons are still active.
And if I slide my finger from left to right on those buttons, the screen will turn on. If i slide it from right to left, the screen will turn off.
I never noticed this feature before, so I dont know if its from CoolSense only.
But I would like to disable this feature, so that the capacitive buttons don't respond anymore when the screen is off, how can I do it?
thanks
I dont think you can toggle that just yet. coolexe posted that hes gonna release an update that will have sweep2wake enabler/disabler
coolexe said:
Plz check ur mail...bt hci still in testing process...
btw bt working fine here.
new kernel on the way with cmdline sweep2wake enabler/disabler and cmdline sweep2wake start/end keys
Click to expand...
Click to collapse
Ok Thanks, I flashed the latest Cool Sense Kernel, there is indeed a new option to turn that feature off when installing it with Aroma.
Or you could have tried this app to toggle it ----> http://forum.xda-developers.com/showthread.php?t=1919965
It works with every cool kernel, also has options to toggle the backlight on/off in Sweep2Wake
There's an option in the kernel tuner app that let's you completely disable it or have it with the lights out too.
Jsparta26 said:
There's an option in the kernel tuner app that let's you completely disable it or have it with the lights out too.
Click to expand...
Click to collapse
That's what I said....
My bad. I guess I didn't look through your post all the way. My mistake. It happens
Thanks for your answers,
I ll take a look at Kernel Tuner, looks very useful.
If you open up terminal emulator, and type the following bash commands, it'll go away
Su
Echo 0 >/sys/android_touch/sweep2wake
Sent from my PG86100 using xda app-developers app
beneath-a-burning-turtle said:
If you open up terminal emulator, and type the following bash commands, it'll go away
Su
Echo 0 >/sys/android_touch/sweep2wake
Sent from my PG86100 using xda app-developers app
Click to expand...
Click to collapse
Nice one I will remember this for in case I have this problem and I can feel all smart :laugh:

Possible workaround for laggy UI response (stock firmware build 6.2.A.0.400)

This post is intended for only rooted users of Xperia go/P/U/sola phones that are currently running the stock firmware build 6.2.A.0.400 / Jelly Bean (or in the case of U/sola, the ported equivalent), and only users who are familiar with the terminal. If you satisfy the above criteria, read on.
Hi all, I've just discovered that disabling the second core of my Xperia go's CPU actually improves overall UI responsiveness in JB rather than the contrary, despite logic dictating otherwise. In fact, it's so smooth now that I can safely say it directly rivals GB's smoothness and response times (and this is from a long term GB user who just recently made the jump to JB, too).
I'm making this thread because I'd like to see if others will experience similar effects from disabling the second CPU core of their NovaThor U8500 SoCs.
Disclaimer: I am not responsible for anything in the unlikely event that you - somehow - break your phone from making this small tweak. Just saying. You should be fine if you follow the instructions, though.
You have to be running on battery power to be able to spot any difference since the UI's sluggishness isn't as noticable when connected to a power source. Oh, and leave your governor / clock speed settings at stock (i.e. interactive governor, 200 MHz min, 1000 MHz max) for a fairer comparison.
Open up a terminal window, then enter Superuser / root mode and enter the following command:
Code:
echo [B]0[/B] > /sys/devices/system/cpu/cpu[B]1[/B]/online
(that's a ZERO immediately after echo and a ONE in /cpu/cpu1)
This should immediately take the second core offline, you can verify it with the following command (do consider first opening an additional new terminal window for this purpose):
Code:
cat /proc/kmsg
Look for something along the lines of:
Code:
<5>[35017.521636] CPU1: shutdown
Now, start testing the responsiveness of the UI, it should be extremely smooth in comparison to what it normally is. Skeptics, please do feel free to drop your jaws at this point, because I sure did when I first tried this. I noticed that the processor's speed seemed to ramp up and down much more aggressively with the second core disabled, but that could just be me seeing things.
To re-enable the secondary core again, use this command:
Code:
echo [B]1[/B] > /sys/devices/system/cpu/cpu[B]1[/B]/online
(that's a ONE immediately after echo and a ONE in /cpu/cpu1)
You can verify that the core is enabled in the dmesg logs (remember the earlier cat /proc/kmsg command?):
Code:
<4>[35155.743408] CPU1: Booted secondary processor
<6>[35155.745011] Switched to NOHz mode on CPU #1
At this point, you're likely to see the sluggishness make a return.
This should be fairly obvious, but don't go doing "smart" (that was sarcasm, in case you missed it the first time) stuff like disabling the first core (or even both) because you'd clearly be asking for trouble.
I suspect that the presence of the second core is preventing the governor from ramping up the processor speed on battery power, leading to the sluggish UI response. It has been noted before that a pair of cores running at a lower clock speed can potentially be more power efficient than a single core running at a higher clock speed, so I'm not too sure how this would affect the phone's battery life. I haven't yet noticed any negative impacts of the change on battery life - if anything, battery life appears to be improved, but I'd like more people to test this out (preferably those on P, U and sola phones).
There is an app to do this.
Enviado desde mi ST25i usando Tapatalk 2
Diego910 said:
There is an app to do this.
Enviado desde mi ST25i usando Tapatalk 2
Click to expand...
Click to collapse
But in Xcore app the second core turns on automatically after sometime..
Does dat happen with the terminal method?!
Sent from my ST25i
In X-Core, after disabling the core, go to superuser app nd toggle permissions for X-Core... Second core doesn't switch on fr me that way...
Press thanks if I helped :thumbup:
dotafan said:
In X-Core, after disabling the core, go to superuser app nd toggle permissions for X-Core... Second core doesn't switch on fr me that way...
Press thanks if I helped :thumbup:
Click to expand...
Click to collapse
Tried it but in vain..
Sent from my ST25i
weired..

[APK]DEEP-SLEEP Fix for CM12

Hi all!
I don't have a lot of free time, but i just fell in love with CM12, and i wanted to use it daily.(and i want to help for those who wants to use it daily aswell)
We all met with the deepsleep problem, it only happens when screen is off, and cpu governor is not powersave.
As in ALL the google API talks about powersaving mode when phone is in sleep mode etc... i think there is a major problem with CM12 framework, that android not going to powersaver mode.(as it should)
So what i have done is just coded a "couple of minute sollution". It is an apk, and it is only uses one service, and one broadcastreceiver to be able to SET CPU to powersave mode when screen is off.(And ofcourse back to interactive when screen is on, to avoid lag)
HOW TO USE: (ROOT NEEDED!!!)
1) Download apk from here(attached down)
2) Install it
3) Start the application from menu
4) Wait until SuperSU(or any root) asks for permission, allow it!
5) Reboot phone.
After the first start of the application, the icon will be removed from menu not to disturb the user
So when you open it, take care for wait SuperSU to ask permission, and when you give it, then reboot.
If you messed up something, just delete app from settings menu, and do steps from 2).
If you want to be sure that it works use adb shell command to check governor:
After reboot turn the screen off and type in adb:
Code:
adb shell
su
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
it will show powersave, and when you turn the screen on it will show interactive!
One more thing! To avoid SuperSU make toasts of granting permission, you can turn it off in SuperSU settings!
Peaceful life with lollipop btw!
WAITING FOR FEEDBACKS
It needs to be performance not power save right?
wooolfgang said:
It needs to be performance not power save right?
Click to expand...
Click to collapse
This can be right but i am using it on powesave and works like a charm.
Btw i make another option then, for those who need perf. Gov.
Even i can make it to 300mhz when sleep via performance governor to avoid battery drain.
trapacska said:
This can be right but i am using it on powesave and works like a charm.
Btw i make another option then, for those who need perf. Gov.
Even i can make it to 300mhz when sleep via performance governor to avoid battery drain.
Click to expand...
Click to collapse
No need bro this first one is good. Not using performance governor and there are no deep sleep problems.:good:
trapacska said:
This can be right but i am using it on powesave and works like a charm.
Btw i make another option then, for those who need perf. Gov.
Even i can make it to 300mhz when sleep via performance governor to avoid battery drain.
Click to expand...
Click to collapse
You made this app? If not where did you find it? Which commands does it do?
trapacska said:
So what i have done is just coded a "couple of minute sollution". It is an apk, and it is only uses one service, and one broadcastreceiver to be able to SET CPU to powersave mode when screen is off.(And ofcourse back to interactive when screen is on, to avoid lag)
Click to expand...
Click to collapse
siracuervo said:
You made this app? If not where did you find it? Which commands does it do?
Click to expand...
Click to collapse
So if you read the actual post he indicates he has indeed made this app.
Sent from my LG-D620 using XDA Free mobile app
steffenbakke said:
So if you read the actual post he indicates he has indeed made this app.
Sent from my LG-D620 using XDA Free mobile app
Click to expand...
Click to collapse
I want to know the intructions that the app implements to make it work natively and fix the issue
siracuervo said:
I want to know the intructions that the app implements to make it work natively and fix the issue
Click to expand...
Click to collapse
Hi.
It is really simple, i don't really think you can fix the issue if you don't know how to set a cpu scaling governor.(it is very basic thing since android is out, and even on PCs)(if you don't mind i am declaring this)
On this site you can find instructions:
http://bamboopuppy.com/android-cpu-frequency-using-cpufreq-ondemand-governor/
What i used is checking screen state(via BroadcastReceiver), and when screen is on i set it to interactive, when screen is off i set it to powersave, that's it really.
I even posted in OP how you can check:
Code:
adb shell
su
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
To write governor:
Code:
adb shell
su
echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Work this app on latest CM12 build ?
simo14 said:
Work this app on latest CM12 build ?
Click to expand...
Click to collapse
yes =)
I've tried but not work
Installed apk but still have problems with deep sleep sometimes. Can I do something else?
this is no longer needed since i fixed deepsleep in the rom
invaderjohn said:
this is no longer needed since i fixed deepsleep in the rom
Click to expand...
Click to collapse
so, with the last release, does the deep sleep work fine?
tecno789 said:
so, with the last release, does the deep sleep work fine?
Click to expand...
Click to collapse
Indeed
invaderjohn said:
Indeed
Click to expand...
Click to collapse
Just another question. Is the ROM incompatible with Ds battery saver? Because, it doesn't work, it can't switch off the network, why? Can i fix it?
tecno789 said:
Just another question. Is the ROM incompatible with Ds battery saver? Because, it doesn't work, it can't switch off the network, why? Can i fix it?
Click to expand...
Click to collapse
Lollipop has a built-in battery saver. U dont need a 3rd party app for that
invaderjohn said:
Lollipop has a built-in battery saver. U dont need a 3rd party app for that
Click to expand...
Click to collapse
But it doesn't work as battery saver..
tecno789 said:
But it doesn't work as battery saver..
Click to expand...
Click to collapse
It does for me. Anyway i have like 1,5-2 days of batt life, and if the batt life gets low i turn on batt saver. And it works. Its not a bug.
invaderjohn said:
It does for me. Anyway i have like 1,5-2 days of batt life, and if the batt life gets low i turn on batt saver. And it works. Its not a bug.
Click to expand...
Click to collapse
But u mean the batt saver that turns on under 15% of battery or other one?

[KERNEL] Modified FrancoKernel w/Wake Gestures

Hey guys, welcome to this thread. I know there are many fans of franco.Kernel and many fans of wake gestures. This combines the best of both.
This kernel is simply a modified version of the official franco.kernel with added wake gestures developed by flar2
Features:
- Always sourced from the latest franco kernel build
- Only added feature is wake gestures
Downloads:
- Boot IMG: http://1drv.ms/1ExnFf5
Installation:
- Flash in TWRP (using the img flash option)
- Flash Manually: fastboot flash boot boot.img
Credits:
@franciscofranco /@amjc14/ @flar2 / @Cl3Kener / @DespairFactor
Source: https://github.com/alan94jimenez/modified-shamu
Enjoy!
Latest Version Base: r28
--
Manual Values:
Sweep2wake:
disable = 0
sweep right = 1
sweep left = 2
sweep up = 4
sweep down = 8
Add them together. For example, to enable sweep2wake in every direction:
echo 15 > /sys/android_touch/sweep2wake
Sweep2sleep:
disable = 0
sweep right = 1
sweep left = 2
sweep left or right = 3
eg: enable sweep2sleep left
echo 2 > /sys/android_touch/sweep2sleep
Doubletap2wake:
enable = 1
disable = 0
eg: enable doubletap2wake:
echo 1 > /sys/android_touch/doubletap2wake
For the noob, what is wake gestures? Double tap to wake is considered a wake gesture?
Nice job bro :thumbup: :thumbup:
JManekia said:
For the noob, what is wake gestures? Double tap to wake is considered a wake gesture?
Click to expand...
Click to collapse
I added it to the OP, but it is stock double tap to wake, sweep2wake, sweep2sleep, and flar2's DT2W
JManekia said:
For the noob, what is wake gestures? Double tap to wake is considered a wake gesture?
Click to expand...
Click to collapse
Sweep 2 wake, sweep 2 sleep and double tap to wake
What is the chance of getting Multirom compatability.
Would you be willing to make a zip? Not to be a pain in the a**!
iainaaldrich said:
Would you be willing to make a zip? Not to be a pain in the a**!
Click to expand...
Click to collapse
I can look into it, but if you are on the latest TWRP you can flash .img files now. So you should be all good to go
gamewarden234 said:
What is the chance of getting Multirom compatability.
Click to expand...
Click to collapse
Don't ask for features that aren't finished
Cannot get sweep to sleep working and tried kernel adiuator but that does not work.
What needs to be done to activate it?
daleski75 said:
Cannot get sweep to sleep working and tried kernel adiuator but that does not work.
What needs to be done to activate it?
Click to expand...
Click to collapse
I'm using the elementalx app to set wake gestures and it is working fine. Let me try kernel adiuator real quick
DespairFactor said:
Don't ask for features that aren't finished
Click to expand...
Click to collapse
my bad. Had no idea. Works great on the kernel I'm using curently. Sorry about that.
Excellent! Is the kernel compatible with flar2's Wake Gestures implementation?
Sorry, I thought you meant the regular wake gestures. I would have to look into it for you.
Phamwich said:
Excellent! Is the kernel compatible with flar2's Wake Gestures implementation?
Click to expand...
Click to collapse
Just installed the apk and I can confirm it is working :highfive:
Thanks! flar2's Wake Gestures implementation and app would be fantastic. Swiping to activate the flashlight is pretty convenient possibility with flar2's implementation.
EDIT: I'll give it a shot!
Phamwich said:
Thanks! flar2's Wake Gestures implementation and app would be fantastic. Swiping to activate the flashlight is pretty convenient possibility with flar2's implementation.
EDIT: I'll give it a shot!
Click to expand...
Click to collapse
I had never tried it, but it is pretty sweet! I like how you can set shortcuts for the gesture from the app.
flar2's Wake Gestures seems to work perfectly. On previous ROMs, I did have issues of ear touches while in calls, so I did have to install flar2's S2W Phone Call Disabler and that seemed to solve the problem.
Right now, I'm pretty happy running stock 5.1 rooted with FK r21, and the Wake Gestures support was a nice addition to keep me satisfied until custom ROMs iron out things out with 5.1. Great work!
Phamwich said:
flar2's Wake Gestures seems to work perfectly. On previous ROMs, I did have issues of ear touches while in calls, so I did have to install flar2's S2W Phone Call Disabler and that seemed to solve the problem.
Right now, I'm pretty happy running stock 5.1 rooted with FK r21, and the Wake Gestures support was a nice addition to keep me satisfied until custom ROMs iron out things out with 5.1. Great work!
Click to expand...
Click to collapse
Glad to hear it! And thanks for pointing me to his app.
Hi could you please make a flashable zip of this ? The reason I'm asking is that I have installed Rastapop (based on Android 5.1) as a secondary ROm and I would prefer to flash a kernel there. I've tried Flashify,but all it does is it flashes boot.img to the primaryROM thus making me lose MULTIROM access. Thanks

Question Flashlight Brightness Mod?

So apparently the 1 III suffers from the same issues as its Sony Predecessors... The Flashlight is very bright when you use it as camera flash, but when you turn on the flashlight, its artifically throttled to idk, prevent overheating?
So for the older Xperias there were ways to modify flashlight configs and librarys. However, I havent found a way to edit the current parameter for the flashlight on the 1 III. For the 5 II the GodlyTorch App seemed to work, according to a report in https://forum.xda-developers.com/t/...ness-fix-torch-light-not-photo-flash.4203293/, but that doesnt want to work on my 1 III (I have Root)
Now the question: Can someone find the parameters to increase Flashlight LED Current via Magisk Module, XPosed/LSPosed Module or manual edit? I'd be even willing to donate to a kind developer who builds a usable flashlight mod for the 1 III.
Thanks in advance.
When flashlight is on and your device is rooted, you can change the value of
Code:
/sys/class/leds/led:torch_0/brightness
/sys/class/leds/led:torch_3/brightness
(There are two flash LEDs)
The max value you can set is given by the max_brightness file in the same directory.
I didn't find a way (yet) to apply this by default, you have to have the flashlight running in order to change its brightness that way.
However, I do warn you that I am not responsible in any way if using your LED at full power causes damage to your device.
MK73DS said:
When flashlight is on and your device is rooted, you can change the value of
Code:
/sys/class/leds/led:torch_0/brightness
/sys/class/leds/led:torch_3/brightness
(There are two flash LEDs)
The max value you can set is given by the max_brightness file in the same directory.
I didn't find a way (yet) to apply this by default, you have to have the flashlight running in order to change its brightness that way.
However, I do warn you that I am not responsible in any way if using your LED at full power causes damage to your device.
Click to expand...
Click to collapse
Thanks for this info, working fine for me!
I played a bit around with this and tested the brightness values with 150; working fine in terms of short term heat development.
Edit 2: After a few days I start to notice a very slight discoloration of the diffusor with a value of 150. Its not affecting anything and barely visible, but I'd recommend to go lower than 150, because I suspect the LED may get too warm for the diffusor. I changed the guide to use 30 for now (which equals double the brightness compared to stock), please test your values for yourself, its probably better to not exaggerate it.
Make sure you type in the values right! Too high values and the LED Diffusor may melt, or the LED might die. Do this modification at your own risk, no matter at which brightness you target! I am not responsible for side effects resulting from the mod.
With Terminal Shortcut Pro and assigned Root Priviliges I made myself a Home Screen Icon that will boost the values for me in the current "Torch session" once the LED is turned on before. Other terminal emulator apps will work too.
In the Shortcut I set Run with Root and used the following command
Code:
echo 30 >> /sys/class/leds/led:torch_0/brightness && echo 30 >> /sys/class/leds/led:torch_3/brightness
Basically just a command that writes the 30 brightness value to the 2 files.
If someone can find a terminal command that turns on the flash in the first place, we could combine the commands to potentially make a simple but working replacement quick settings for the torch.
Edit: Thanks to the XDA Community and a Tool I was able to recreate the Torch experience with a Quick setting
You need https://play.google.com/store/apps/details?id=com.quinny898.app.customquicksettings
You have to buy the premium in app purchase for 1,29€ to unlock Root Command Running. Then you configure your quick setting (choose the Advanced -> Root Command under Preset) and paste the following script (credits to https://forum.xda-developers.com/t/increasing-torch-power-with-root.3637773/post-73098701, modified by me for 1 III)
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 30 > /sys/class/leds/led:torch_0/brightness
echo 30 > /sys/class/leds/led:torch_3/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_3/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
Once again, make sure you type in the values right! Too high values and the LED Diffusor may melt, or the LED might die. Do this modification at your own risk, no matter at which brightness you target! I am not responsible side effects resulting from the mod.
Then you get rename the toggle, give it a nice Torch Icon and set the color to grey. It will function like the normal quick setting: Tap once, it turns on, Tap again, turns off. Even works locked.
Good luck and best regards.
If you want to use the Google Assistant Button as a torch toggle and also have Quick Settings Toggle (sadly its always toggled on) i found an app that can do both.
You need:
LSposed/Xposed
Root Shell access (adb shell)
Xposed Edge pro
Busybox for Android NDK (Magisk Module)
XperiaGAButtonRemap (Magisk Module)
Open a cmd or powershell
execute adb shell
execute su
accept root permissions on your phone
execute vi /bin/torch
press the key i
paste the script:
einhuman197 said:
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 150 > /sys/class/leds/led:torch_0/brightness
echo 150 > /sys/class/leds/led:torch_3/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_3/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
Click to expand...
Click to collapse
press ESC
type :wq and press ENTER
execute chmod +x /bin/torch
Now you can execute /bin/torch as root and it will toggle the torch with higher brightness values.
In Xposed Edge enable "Keys" toggle and open it. Tap on "+ Add" at the bottom, press the Google Assistant Button, it should be recognized as "KEYCODE_PROG_BLUE", then set the action of either click/double click/long press (whatever you prefer as the torch toggle) to execute a Shell command, enter /bin/torch in the input field and enable the "Root access" toggle.
If you want, you can also set other custom things to the Google Assistant button for the other 2 states.
For the quicksettings menu tap on "Quick settings tiles" in the main menu of Xposed Edge and enable the first tile and open the settings for that tile. Set the action, again, to a shell command, input /bin/torch and enable Root Access. You can set the label to "Torch" and choose the Torch icon found in "Built-in icons". As i already said, the toggle will always be turned on for some reason. It just executes a shell command after all.
Good luck
Amazing, thank you everyone.
However, please let me insist that this may damage your phone if you put values too high... trust me. I accidentally put a brightness of 350 instead of 150 while trying the script in a terminal, and a few seconds were enough for the plastic underneath the glass to melt... Thankfully, it is still transparent so I can still use my flashlight, but no doubt it could have done a lot more damage if I let it run for longer. So please, use this with a lot of care (and double check what you write).
That's why in lots of countries, rooting voids your (hardware) warranty, you can do physical damage to your device so again, please be careful. Thankfully, this plastic bit and even the LED underneath are easily replaceable (the plastic bit is separated from the rear glass and the LED is on a separate ribbon cable). However, there don't seem to be a lot of OEM replacement parts for this phone yet.
Seems like a lot of work for little return and added threat of damage to an expensive phone. I agree that the brightness is dimmer than other phones I have had...but I did a test in a completely dark room and it actually is bright enough to find "whatever" you may be looking for. So I can live with it. Maybe Sony will do something to improve it a little?
jaseman said:
Seems like a lot of work for little return and added threat of damage to an expensive phone. I agree that the brightness is dimmer than other phones I have had...but I did a test in a completely dark room and it actually is bright enough to find "whatever" you may be looking for. So I can live with it. Maybe Sony will do something to improve it a little?
Click to expand...
Click to collapse
Sony could definitely improve it. But it seems like they had a history for compareably dim Flashlights.
I edited my explanation post to adapt lower brightness, because 150 as value starts to slightly discolor my diffusor, so I suspect we should run it lower.
MK73DS said:
太棒了,谢谢大家。
但是,请让我坚持,如果您将值设置为高,这可能会损坏您的。......我相信在终端中尝试手机时,我不小心将恢复设置为 350 而不是 150 ,几秒钟就可以让玻璃下面的恢复正常……幸好还是可以的,所以我可以使用我的手电筒,但有疑问,如果我能运行更长时间,它会请小心使用它(并仔细检查你写的内容)。
这就是为什么在国家/地区,root 导致您的许多(硬件)故障,您可能会再次对您的设备造成物理损坏,请小心。值得庆幸的是,塑料钻头甚至下面的 LED 都可以轻松更换(塑料钻头与后玻璃分离,LED 还位于单独的带状电缆上)。
Click to expand...
Click to collapse
darken5404 said:
Click to expand...
Click to collapse
You can't say I didn't warn you!
Indeed flashlight in mark 3 and older xperias is very bad.
I compared it to an iPhone and it's like day and night. Many aspects xperia brand is suffering like front camera, flashlight, no 21:9 pics, missing 4k 60fps recording in main app with stabilization, poor screen brightness, insufficient battery capacity, no any cooling system (especially at this price there should be vapor chamber or any other advanced cooling and not throttling cpu as a solution...), Not to mention regular software apps like Album, email and others :/
MK73DS said:
You can't say I didn't warn you!
Click to expand...
Click to collapse
I got it fixed through sony aftermarket and has ip68,fixed the screen for me by the way
On android 12 after rebooting the function stops working.
So I got to the area of the phone you guys specified, but as of today, the default values are WAY different that what yall found. Let me take a few screen shots
Here is the systems default peramitors. Any idea why they are so different?
Edit- Okay, so extra piece to the puzzle. When torch is off, the brightness file is 0, but when it is on the file is set to 15.
editing the file while the torch is on does nothing.
Edit 2 - Just wanted to note that for those who just want a demonstration of the changes possible, the fallowing app will do just that
Release v1.4.6 · BRoy98/GodlyTorch
Merge pull request #2 from TheDorkKnightRises/patch Fix LED file path for OnePlus One (bacon), proper device names for OP Merge pull request #3 from TheDorkKnightRises/patch Fix default double-...
github.com
this app needs root. Run it as a HTC 10 and it works just fine. However, I would like to recommend NOT going over the half way point. its VERY bright and will probably kill your LED if you do. You have manual control over the brightness. You can add it as a shortcut in the drop down menu of your phone. simply use the standard torch button, and then click the godly torch button to activate whatever preset you gave it.
Edit 3 - setting the brightness in Godly Torch to 50% Intensity sets the brightness to 135. Given that we know damage starts to happen at 150, I set the brightness in Godly to 15% (under the "toggle Intensity" shown in the screen shot), which brings the brightness to a value of 45. Its easily double as bright. I would not recommend going past this point.
I would say by using godly torch as a HTC 10 worked...mind you I double checked the brightness by just hitting the quick toggle and then messing with godly torch. The lower setting is matching just turning on the quick toggle the higher setting is what I'm comfortable with, but idk how long I'm comfortable running it at that brightness.
BlazingKahn35 said:
On android 12 after rebooting the function stops working.
Click to expand...
Click to collapse
For those on stock who use the assistant button :
If it stops working after reboot, copy the binary file to somewhere safe on your sd card, then using XPosed edge just add a long press gesture to your assistant button that recopys the file from your sd card, then sets the permissions again (make sure to check run as root)
cp /sdcard/torch /bin/ | chmod +x /bin/torch

Categories

Resources