[Q] Looking for the shutdown command - Droid Incredible Q&A, Help & Troubleshooting

I have been using Tasker to automate my Incredible. One automation that I really would like to setup is a shutdown command to run when the battery reaches capacity during the night. Currently, root options are still on the to do list for Tasker so the shutdown command is unavailable. Tasker does have the ability to launch scripts setup through SL4A so I was considering writing a simple bash script that would shutoff the phone. Only problem is that SL4A doesn't support root scripts yet though there is a workaround. Also, I have attempted to run a standard shutdown command which froze the phone (Had to remove the battery). So here is the question... Does anyone know what the bash command to shutoff the phone? Or possibly another way to do this?
The Hybrid Tech
HTC Inc | Virtuous v3.0.1 | 2.6.32.15-adrynalyne-virtuous-v1 | 2.15.00.07.28

I just discovered tasker. Can you make a list of your most creative tasker things?

TheHybridTech said:
I have been using Tasker to automate my Incredible. One automation that I really would like to setup is a shutdown command to run when the battery reaches capacity during the night. Currently, root options are still on the to do list for Tasker so the shutdown command is unavailable. Tasker does have the ability to launch scripts setup through SL4A so I was considering writing a simple bash script that would shutoff the phone. Only problem is that SL4A doesn't support root scripts yet though there is a workaround. Also, I have attempted to run a standard shutdown command which froze the phone (Had to remove the battery). So here is the question... Does anyone know what the bash command to shutoff the phone? Or possibly another way to do this?
The Hybrid Tech
HTC Inc | Virtuous v3.0.1 | 2.6.32.15-adrynalyne-virtuous-v1 | 2.15.00.07.28
Click to expand...
Click to collapse
Looking into it as well, when I get free time (which probably won't be for a while, honestly). Running the shutdown command in terminal does freeze the phone, but you can reboot it via adb without a battery pull.

i used:
Code:
shutdown -r now
This rebooted my phone and it went idle, and did not power back on until i hit the power button.
I dont know of a termnal command though to initiate a shutdown like android does when choosing power off

Hehehehehe...
Well, when you don't have a USB cable lying around, kinda get stuck with the battery pull to restore functionality.
My next run through will be to see how the init levels are set in Android.
As to tasker, here is a list of my profiles...
-- GPS on/off depending application (Navigation, Maps)
-- Wifi enabled depending on application (Wifi Tethering, Wifi Analyzer)
-- Location to enable Wifi
-- Schedule/Location to silence phone at work
-- Schedule for Auto-Brightness during day and min screen brightness at night
-- Headset Plugin to enable a menu of applications
-- Mobile Data off when Wifi connected, screen off
-- Display Rotation off while screen is off (Stops screen freezes when unlocking)
-- Shut off power-hungry hardware when battery is low

/system/bin/shutdown but it is converted so it can't be edited on the phone directly.

Related

Battery Life 'Tips and Tricks' thread. Make your LG Nitro battery last!

Better Battery Life Tips
I've been using (and tweaking) Android devices since the original HTC Dream (aka G1, Android Dev Phone) was released, and I've had devices that are both good and bad at power consumption. In this thread I will share what I have learned and invite you to share what you have learned as well so that we can all get the most out of our devices.
Please note that I like to keep my smartphones "smart" and don't like to be manually toggling things on and off throughout the day. If you like to geek out 24x7 you can manually turn on/off every feature of your phone every time you use it to conserve juice... that's not me though!
Here we go...
-Consider a Different Browser
It seems like Opera Mobile and Mini are the kings of battery conservation. I tried Dolphin, Boat, Firefox, Chrome, the stock browser, and about 10 others... I didn't see significant differences in battery with any of them, but with Opera I noticed the difference. It makes sense since Opera renders the pages and optimizes the images remotely and then sends the bare minimum amount of data to your device to display the page.
-Location, Location, Location
Android's location related services can be a big drain. There are 3 different location settings you need to know about.
1) Location Access (Settings -> Location access): For maximum savings, you can turn off "Access to my location". However, there are many apps that make good use of your location. If you don't want to cripple them, leave this option turned on but at the very least uncheck "GPS Satellites" to save some juice.
2) Google Apps Location Settings (Settings -> Accounts:Google -> Location settings): Allows Google apps, such as Google Maps, to access your location. Why this needs to be separate from #1 above is beyond me, but turning it on requires the above setting to be on as well. If you don't use Google Maps, Now, Plus, or any other Google services that use your location you can turn this off.
3) Location Reporting aka Latitude (Settings -> Accounts:Google -> Maps & Latitude -> Location Reporting): This is the bad one. Really bad. Wakelock and battery drain city. I don't even know why anybody would want this. Kill it with fire. Set it so that it does not update or report your location.
-Turn off stuff you don't use
This should be common knowledge by now... if you aren't using GPS, Bluetooth, or even 4G... turn them off. If you don't need instant notifications and app updates you can even turn off Auto-Sync. If you decide to do that, I recommend the Synker widget from the Play Store. It is nice and configurable so that you can sync on demand with one touch.
-ROMs and Kernels
I'm not going to go into these too much here... there's a whole development section devoted to them with tons of info. Generally you get the best life from the stock based ROMs. Liquid Nitro and HO!NO!'s v20f (+Wind kernel) are quite good. Next best is probably HO!NO!'s CM9. The CM10.1 ROMS and kernels have a bit of catching up to do at battery consumption, but they keep getting better.
-Kill Google Talk!
If you don't use this program, disable it. It is always trying to do something on the network. Even if you turn off data and wifi you can still get NetworkConnectivity wakelocks from this app trying to do its business! Killing it is the first thing I do after flashing a ROM, especially CM10.1. From home hit: Menu -> Manage Apps -> All -> Talk -> Disable.
*Some report that disabling apps through the Android OS might not stick. If this is a concern for you, download NoBloat or Titanium Backup and freeze this app. Or if you're a nerd like me, use a root file explorer and move or rename the .apk file in /system/app
-Kill Google+ (Plus)
Just like the above, if you don't use it, deactivate it. It also uses data and location services pretty regularly. Disable it in the same way, or use NoBloat or Titanium.
-Kill Google Now
If you don't use it, deactivate it. It uses data and location services pretty regularly. I like its features and keep it enabled on my N7, but leave it off on my phone. To turn it off, go into the Google Search app (long-touch menu/search button), hit Menu -> Settings -> Google Now. You'll see the option to disable it.
-Data-Toggling Battery Saver Apps
These are pretty controversial, almost as much as app-killers were when they were very popular. In a nutshell they turn your data connections on or off based on whether your screen is on or off. They usually will check to see if you are downloading or streaming anything before they shut off the connection. Then, they periodically turn the connection on while the screen is off so that the device can perform a sync to get emails, etc.
Should you use one? If you are running CM10/10.1/AOKP4x then YES USE ONE!! EDIT: THE LATEST VERSIONS OF QUATTRIMUS AND WIND FOR CM10.1 HAVE RESOLVED THE BATTERY DRAIN ISSUE. Use of a battery saver is no longer essential. If you still want to use one, read on...
Whether or not you use a battery saver depends on how you use your phone, and if you are willing to accept the trade-offs. These apps get their savings from maximizing deep sleep time for extended periods with zero data concerns or interruptions. If your usage habits allow the app to do its job, use it. If not, don't use it.
[What follows here is some long drawn out jibber jabber about the pros/cons of these apps. Read it if you like]
Some people love these battery saver apps and swear by them; others hate them. The reason some like them is because they get a few more hours of battery life. The reason why some people hate them is because:
1) They wake the device periodically to do their job... which negates some of the power savings you get from having them. To some people these tiny wakelocks are the most horrible thing ever... even if their impact is quite small compared to the power being saved. These people are usually the ones who live and die by their BBS logs. I'll admit, I was one of those people
2) Syncs are delayed, so messages and notifications do not arrive instantly but when either of the following conditions are met-
a) The screen gets turned on (which triggers data on and autosync)
b) The program hits a scheduled time trigger (usually at user selectable intervals)
3) There's a small lag while data connects when the screen gets turned on. If the screen gets turned on very frequently the constant on/off/syncing can actually hurt the battery more than it helps.
But, if you are ok with the delayed syncs and you set up the sync intervals long enough apart you WILL see a gain in battery life. Your phone will sleep much more soundly as well. With one of these apps my Nitro HD on CM10.1 can sleep all night and will only lose maybe a percent or two.
*Note that these will NOT help you at all when the screen is on, which is a bummer because the Nitro screen sucks down a LOT of power. Also, your usage patterns may make them ineffective for you... in which case you are probably better off without them.
Personally I get about an hour or 2 of extra life if I use one, but it's a trade-off since I lose instant notifications and a there's a slight delay while it reconnects to the network when the screen gets turned on. And the more you turn your screen on/off, the more it disconnects/reconnects/syncs... meaning it is using a bit MORE power than usual for those seconds.
[/jibberjabber]
The following are my favorite data-toggling battery-saver apps. All of them have "free" versions and more advanced "pro/prime/advanced/whatever" paid-for versions. These are not the only ones out there; feel free to report back on ones you prefer. If you find one that you really like, I suggest buying the pro version not only for the additional customization they offer, but to support the devs for a job well done.
1) DS Battery Saver - Super easy to configure and since it kills background tasks before sleeping it puts your device into a nice deep sleep. Also combines the feature of CPU Sleeper if you are rooted... it'll shut off a CPU core when sleeping.
2) Green Power - Works really well. The interface is simple and well laid out. I used it for years before I discovered DSBS.
3) Juice Defender - Another decent app, similar to Green Power. I personally preferred the options and the interface of GP better, but you may not.
4) CleverConnectivity +++Battery - The interface is a bit weak, and I had problems with the full data on/off features working on my P930 w/CM10.1... BUT this program has one very cool feature- it has an option for dropping the connection speed down to 2G/EDGE when the screen is off instead of disabling it completely. This allows syncs to still occur while still saving some power in 2G. I've even streamed Pandora on 2G, so in theory you could do stuff like that too. This feature worked fine on my P930 dispite the normal data on/off failing intermittently. There is a moment of zero data while it toggles between 2G/3G. I think this app might be awesome when development advances some more.
-Underclocking (rooted users)
Capping your max CPU frequency at a lower limit can save power. Quite honestly, for 99% of my daily use I can't tell the difference between the CPU clocked at 1.2ghz and 1.8ghz except that at 1.8ghz my battery bar laughs at me and gives me a wedgie. On custom ROMs there is often a built-in method to set the CPU clock frequency (Settings -> Performance -> Processor). On stock-based ROMs you'll need a 3rd party app like Kernel Tuner, SetCPU, or any of the other 50 options in the Play Store. You can usually safely set your minimum frequency to 192mhz, but some phone/ROM/kernel/voltage combos will cause stability or lag issues with doing this. YMMV.
*If you are using a CPU controlling app like SetCPU that allows for profiles, you might be tempted to set the screen-off frequencies to the absolute lowest setting of 192/192... be careful! This setting could end up costing more power consumption because the CPU has to work for a much longer time to handle the tasks at hand at such a low clock speed. If it was allowed to ramp up a bit the task would be done more quickly and efficiently. Honestly I gave up on setting screen-off profiles. I just use governors based on smartass which have their own screen-off settings integrated. Less adjustments needed, similar results. This leads us to...
-Changing governors (rooted users with custom kernel)
There's about 50 different governors floating around out there. If you don't know what a governor is or what each one does, read this thread: http://forum.xda-developers.com/showthread.php?t=1736168
In short: Any governor that is based on smartass, ondemand or interactive is going to be pretty light on battery, and you may not be able to tell the difference between them in normal use. I like smartassv2 and badass, which are both based on smartass. Conservative may sound the most battery friendly, but usually ondemand does better and is less laggy.
Try some out. Have fun with it. Eventually you'll want to start tinkering with the I/O Scheduler... that's a topic for another thread. There's not much battery life to be gained there anyway.
-Undervolting (rooted users with custom kernel)
WARNING: This can cause instability if done improperly. MAKE A CWM BACKUP BEFORE TINKERING WITH UNDERVOLTING!!! I've never seen *drastic* gains on any device, but you do get a little bit more life, and every little bit helps, right?
So if you want to do it, read this: http://bigfatreality.blogspot.com/2012/03/guide-to-undervolt-android-safely.html and then proceed with caution.
Generally you can aggressively undervolt at lower frequencies, but be careful at higher frequencies because your device needs more power under load and will not like it if it can't get it. If you're a car guy this is like running too lean of a fuel mixture
Kernel Tuner and IncrediControl have nice GUIs for fiddling with voltages. Remember, adjust in tiny increments, followed by thorough testing! If you get a crash or reboot then you've gone too far. DO NOT ENABLE "SET ON BOOT" UNTIL YOU ARE SURE YOU'VE GOT STABLE VOLTAGES!!!
-Screen dimming
Screen backlights use lots of power. This ain't no AMOLED where you can save power by using dark backgrounds- LCDs light up the entire display regardless of what is on them.
I suggest turning off auto-adjust and set your brightness at a level that is just bright enough to be comfortable. I keep mind around 30-40%. Auto-adjust periodically polls the sensor to get light data, and uses a small bit of power to do it each time.
Turn on the 'Status Bar Brightness Control' if your ROM supports it so that you can easily swipe your finger along the top of the screen to brighten or dim the display on the fly. In CM9/10(.1) this option is under Menu -> Settings -> System -> Status Bar -> Brightness Control.
If you MUST use the auto-adjust, consider adjusting the levels that it uses. Make them as dim as is comfortable for you. For stock-based ROMs you'll need a third party app like this: https://play.google.com/store/apps/...wsMSwyLDEsImNvbS52aXRvY2Fzc2lzaS5sdXhsaXRlIl0.
For CM/AOKP based ROMs this can be done from the Display -> Brightness sub-menu of your device's settings area. CM10.1 has an excellent and simple adjustment interface.
-Build.prop Tweaks (rooted users)
You can add the tweaks below into your build.prop file that may or may not help with battery life. Download BuildProp Editor from the Play Store and add them. They seem to help a bit, but it could be placebo effect. They certainly don't hurt anything so give them a shot and report back what you get. These seem to work with ICS and JB:
ro.config.hw_fast_dormancy=1
ro.ril.fast.dormancy.rule=0
ro.ril.disable.power.collapse=1
pm.sleep_mode=1
wifi.supplicant_scan_interval=180
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
^ this forum keeps adding a space near the 16384... there shouldn't be any spaces. I think they get disregarded anyway if they are put in the file, so no biggy.
^some of these have presets in BuildProp Editor, some you have to enter yourself. I copy/paste them individually. Don't paste the "=" signs though. Everything before the "=" goes under "Property Name", everything after it goes under "Property Value". If you are experienced you can edit the build.prop file directly using a text editor. Just back it up first and don't screw with the permissions.
-Some other useful apps that help with battery life:
*CPU Sleeper (root users)- Shuts off all but one cpu core when the screen is off. This probably isn't required with a good kernel and governor setup (and a stable phone that sleeps well), and if you are running DS Battery Saver this feature is built-in to it. It uses barely any resources whatsoever, so give it a shot.
*Greenify (root users)- This essentially freezes selected apps when they are not in use. They cannot do background tasks or wake your phone when they are not active. When you attempt to open one of the apps it instantly thaws them for use. After you are done with them it freezes them back up. It is quite brilliant really! It eliminates a lot of wakelocks and battery drain from apps trying to update, gather location data, etc. Use with caution though- don't greenify apps that you actually need to have a data flow from or ones that you use widgets for.
*RootDim (root users) - You know how when you are using your phone in bed at night and the screen is just too bright, even on the dimmest setting? This app lets you go even dimmer. Less brightness means less power, so it will reduce battery usage in the process.
-Apps that help diagnose battery drains
*Better Battery Stats - Good for discovering the cause of battery-draining wakelocks. Just uninstall it when you're done using it to diagnose- otherwise it is constantly doing its thing which is not going to help battery life any!
*OS Monitor - See if your CPU is settling down like it should and see what is keeping it busy. It also has a ton of other advanced options and features.
...there's too many apps to list here! Share the ones you like I'll add more later.
-Adjust your advanced Wifi settings
Go to Settings -> Wifi, then hit Menu -> Advanced
Most people agree that Network Notification should be UNCHECKED, Keep WiFi during sleep should be 'Always', and 'Avoid poor connections' and 'WiFi optimization' should be CHECKED.
If you have a noisy wifi router (some Netgears are guilty) that keeps waking your device from sleep with wifi packets you may get better results if you change Wifi During Sleep to 'Never' or 'Only when plugged in'.
-Watch the reboots!
Every time your phone reboots, Android checks the SD card for errors and then runs the Media Scanner to take inventory of all media files. Both processes consume power, so try to limit unplugged reboots. The more files on your SD card, the longer Media Scanner has to work, so get rid of unnecessary files cluttering up your card. You may have some luck using .nomedia files to tag directories to be skipped during scanning. You can also use an app like this to disable the automatic Media Scanning Service. It also lets you scan on demand. Caution- If you don't ever do a scan, then new pictures won't appear in your gallery nor will new music appear in your player.
I'm sure I'll think of some things later that I have forgotten, and I'll discover new things... I'll update this when I do.
Please share your findings so that this can be the best battery saving thread... In the world.
Very interesting and helpful info.
Thank you very much !!! :good::good::good:
Couple things I'd add, especially if you're running a CM-based ROM
Get NoBloat and disable the following:
SuperUser - Get SuperSU instead, less battery drain.
CM Update Checker - Every time I use my phone to go online (I don't have data on 24/7) this thing pops up and wants to check for updates, but never properly gets flushed. Disabling this one app dropped my hourly drain by about 1.5% on CM10
jekostas said:
Couple things I'd add, especially if you're running a CM-based ROM
Get NoBloat and disable the following:
SuperUser - Get SuperSU instead, less battery drain.
CM Update Checker - Every time I use my phone to go online (I don't have data on 24/7) this thing pops up and wants to check for updates, but never properly gets flushed. Disabling this one app dropped my hourly drain by about 1.5% on CM10
Click to expand...
Click to collapse
Thanks for this- I just disabled CM Updater.
BTW with JB there's no need to download NoBloat- you can disable most apps (including this one) from the built-in App manager. Settings -> Apps -> All -> CM Updater -> Disable
Here's another trick for a specific type of battery drain: (you don't apply the fix in on your phone though)
Symptoms:
1) Your phone drains its battery while doing basically nothing while connected to your wifi router.
2) BBS shows massive amounts of wlan_rx_wake wakelocks
3) Android OS seems to be a high contributor to battery use
Fix #1: (Found HERE) "Change DTIM value in your router configuration from 1 (default) to 255. This value is usually in Advanced->Wireless tab on most routers."
^Seems to help a lot.
Fix #2: Set a static IP on your phone for your home network. The easiest way to do this is to find out what address range your router uses when it hands out IP address via DHCP, then hard-set an IP on your phone that is not in that range so that there won't be any conflicts with other devices that connect to your network. You'll need to consult your internets and googles to figure out how to get this information from your router, if you don't know how. Once you know a clear address you can use, go into your phones Wifi Settings, long-touch your network name, hit 'Modify', 'Advanced', punch in the static IP you wish to use. This might not be an option on corporate or shared housing wireless routers.
Fix #3: Check ALL computers on your network for the presence of the Dropbox software. Mac, Windows and Linux computers alike. If it is running in the system tray, click it, go into preferences, turn off 'LAN Sync'. This little booger wreaks havoc with wifi locks on some Android devices.
mpsantiago said:
Thanks for this- I just disabled CM Updater.
BTW with JB there's no need to download NoBloat- you can disable most apps (including this one) from the built-in App manager. Settings -> Apps -> All -> CM Updater -> Disable
Click to expand...
Click to collapse
I've found that for whatever reason the built-in app disabler doesn't always work. I still like using NoBloat better.
Second to this, once you do disable a bunch of apps it's good to boot back in to recovery and wipe dalvik/fix permissions.
jekostas said:
I've found that for whatever reason the built-in app disabler doesn't always work. I still like using NoBloat better.
Second to this, once you do disable a bunch of apps it's good to boot back in to recovery and wipe dalvik/fix permissions.
Click to expand...
Click to collapse
I agree.
Thanks for all the info it is very interesting! I'll be trying this
---------- Post added at 01:17 PM ---------- Previous post was at 12:59 PM ----------
Thanks for all the info it is very interesting! I'll be trying this
thanks you. it greats:good:
LTE battery drain
Any good tips for reducing battery drain in LTE and Wifi for 20c?
Updated the OP... from now on I'll just put new tips at the top of the list.
frankshi said:
Any good tips for reducing battery drain in LTE and Wifi for 20c?
Click to expand...
Click to collapse
What ROM are you using and is LTE available in your area?
Awesome guide man, +thanks:good:
Oh this is kinda off-topic but Mattman86 I wanted to ask you, I just installed your Hono CM9 Full Throttle rom and I'm having some issues putting the apps onto my SD-Card. Whenever I move them (through titanium backup or just standard move to sd in settings) whenever my phone restarts the apps disappear and or say "app not installed" then they are a green default android icon and just don't work :\ Also does Wind Kernal work with your 4.0.4 Rom?
alainmona said:
Awesome guide man, +thanks:good:
Oh this is kinda off-topic but Mattman86 I wanted to ask you, I just installed your Hono CM9 Full Throttle rom and I'm having some issues putting the apps onto my SD-Card. Whenever I move them (through titanium backup or just standard move to sd in settings) whenever my phone restarts the apps disappear and or say "app not installed" then they are a green default android icon and just don't work :\ Also does Wind Kernal work with your 4.0.4 Rom?
Click to expand...
Click to collapse
I haven't done anything with CM9.
I currently have the ROM in my signature with Wind Kernel 3.5 and Battery Guru along with SetCPU installed and I get roughly 23 hours of battery.
mattman86 said:
I haven't done anything with CM9.
I currently have the ROM in my signature with Wind Kernel 3.5 and Battery Guru along with SetCPU installed and I get roughly 23 hours of battery.
Click to expand...
Click to collapse
Oh then I'm tripping then haha, I have a question though. I tried installing Liquid Nitro and every time I tend to wipe data, wipe cache, wipe dalvik, and wipe system. It just hangs at the LG logo and I haven't had the ability to try out your v7 or for that matter any of the other previous Liquid Nitro. I'll send you a PM since I can't really post in the development section due to my lack of postage xD :cyclops:
On the CM 10.1M3 with wind kernel 1.8, after one day of normal use with WiFi off and Data Off and Location services off I got Google Maps being the worst offender battery wise, the weird part is that I didn't really used maps that day. So even with everything off some service is still eating bat in background.
Sent from my Nexus 4 using xda app-developers app

Here's my workaround for the annoying WiFi battery drain bug on CM10.1

This is no longer needed! The bug is fixed with the new quattrimus and the Wind kernels... and probably an upcoming official one as well. 3-30-13
This is for those of you on CM10.1 (or ROMs based on it) who use wifi and need a way to work around the Wifi battery draining bug. If you didn't know, the wifi bug will cause your device to lose power at at rate of 6-10% per hour while just sitting idle with wifi turned on. This is aggravating for those of us who use wifi a lot and are used to just leaving it on because normally wifi uses LESS power than other connections!
I was formerly using DS Battery Saver or Green Power to toggle my connections, but I like the following method better because it is a bit smarter (you'll see what I mean). Also, sometimes those connection toggler apps would screw up my autosyncing and messages wouldn't show up for hours.
I tried the wifi timeout hack, which kind of sucked because wifi still stayed on in areas with no wifi.
After trying a ton of apps and combinations of apps, I've found a solution that works pretty well. Here it is:
1) Install the app "Better Wifi On/Off" by Sven Knispel
2) Open it up and hit the settings button. Put a check on "Expert Mode", then back out of the settings and go back in.
3) Place check marks next to the following settings options only:
- Enable when user turns wifi on
- Start on boot
- On when screen unlocked
- On when plugged in
- Only if connected
- If wakelock is held
- If network activity
- If plugged in
- Off when unplugged
- Off when screen off
4) Now find the option marked 'Delay - Time to wait before checking Wifi status' and set it to 10s. 0s may also work well, but I haven't tested it.
5) Profit.
*If you have problems with the program stopping, you can go back into Settings and put a check on 'Run as foreground service'.
**The program has a widget you can add to a homescreen so you can quickly disable/enable it if you have to.
With this setup, Wifi simply turns on when I need it and automatically turns off when I don't. It checks for traffic and won't kill the connection until your download or stream is done. It checks for access points, and if there are none available it turns wifi off... something that DSBS and other similar apps don't do all that well.
I'm getting battery life similar to if I had DSBS, Juice Defender or Green Power running- but I never lose autosync and nothing is ever delayed, because mobile data never turns off. I tested my hotspot function and it worked just fine with no interference.
Hope this helps until (if) we ever get a real fix for the wifi drain bug.
I'm not sure if I had something set wrong or it was an interaction with another program or something else, but I tried it and it locked up my phone hard. Not even the buttons light or feedback goes off but no screen. Had to use the hold power to reset.
I hope they're able to get the power issues taken care of in CM10. With the newer nightlies and the wind kernel it's honestly about as stable as CM9 for me. Power usage is my only major issue now.
SeriousGeorge said:
I'm not sure if I had something set wrong or it was an interaction with another program or something else, but I tried it and it locked up my phone hard. Not even the buttons light or feedback goes off but no screen. Had to use the hold power to reset.
I hope they're able to get the power issues taken care of in CM10. With the newer nightlies and the wind kernel it's honestly about as stable as CM9 for me. Power usage is my only major issue now.
Click to expand...
Click to collapse
Yeah it must have been something else at play- the above app doesn't really do anything unusual that would cause a hang. It's been doing well for me today- I've been using my phone pretty steady since 7am and I'm at 40% battery (now almost 4pm). I'm currently on miroslav_mm's CM10.1 build.

[ROOT]Faster Wireless Charging using Automate

Untested on the Q Beta!
For information about the way the mod functions read this.
This mod is possibly dangerous given its nature of modifying the safeguards built into your phone by Google. I am not responsible for your actions using this mod. This mod is meant only for Pixel 3 and 3 XL devices, I would recommend against trying this on other devices.
All that being said I use this mod daily and decided to share. Attached is a ".flo" file used by the app "Automate," link to download from play store, to import the flowchart for the mod. The reason I used automate instead of the typical Advanced Charging Control Magisk module is due to the module having much more functionality that I didn't need or want. Examples include weird charging behavior with USB-PD chargers and overall charging instability. This also allows the mod to be disabled by booting in safe mode.
Details about the mod:
This mod may stop working after any android update
This mod seems to even allow non "fast charge" wireless chargers to be faster
This mod allows a max of 9v to be accepted through wireless charging instead of stock 5v without Google Certification.
This mod reverts whenever the phone stops charging (this is the part that this Automate Flow automates)
Details about the Flow:
This Flow requires 2 apps (Automate and Automate superuser permissions plugin) be installed from Google Play Store
This Flow requires superuser permission on the device (Magisk recommended)
This Flow does NOT modify /system
The file that is modified by the Flow is reset upon unplugging/lifting off a wireless charger so uninstalling Automate will undo the mod completely
The Flow runs like this:
Wait for wireless charging state to change
If wireless charging connected: run shell command then Go to 1
If wireless charging disconnected: Go to 1
So if the phone is not charging or cable charging there isn't an endless loop running.
Instructions:
Download and extract the .flo file
Download Automate app if you have not already
Open Automate app and go through its first time setup
Use the 3 dots menu in the top right to select "import"
Navigate to where you extracted the .flo file and select it
Select the new Flow that just appeared
Under Privileges check the checkbox "full (superuser) access..."
Google play store will prompt you to download the superuser permission app for automate
Grant superuser to automate
Press Start, you'll get a persistent notification about the flow running
OPTIONAL: Go back to Automate app's settings and check the "run on system startup" to enable the mod on boot
You can verify success based on the log in Automate or by observing the charging text on the lockscreen/ambient display. If it says "charging slowly" then the mod failed if it says "charging" then the mod succeeded. You can also check in apps such as Ampere, the charging current pre-mod for me was always <600ma and up to 1200ma after. Note after ~70% charge the Pixel 3(xl) seem to slow charging speed so have a <50% battery for a good comparison.
To uninstall the mod just uninstall Automate or open the Flow and then in the 3 dots menu press delete.
EDIT: Now available in Tasker flavor for those of you who use Tasker and don't want a second automation app running on your phone. Just open the .XML file and select open with in the top right and then Tasker on the pop-up.
@StykerB
Thanks for your work, but i use the App "Automagic" https://play.google.com/store/apps/details?id=ch.gridvision.ppam.androidautomagic
Attached is the flow for Automagic. Need also Root permissions.
Procedure:
1. wireless power connected
2. send command
I just installed this on my Pixel 3 XL and will try it out with my Choetech wireless car charger. Typically I was seeing < 500maH of current with this stock charger. I hope to see over 1A with this patch.
Thanks,
So we have finally found away around the google certified fast chargers?
Works great for me, Thanks.
Would be great to get the assistant features of the pixel stand working too.
I got 850mA when using this MOD and a Choetech wireless charger. Now I can top off my battery while streaming audio and running waze. Previously, I can only stay flat on my batter charge.
Well done!
I used the Automagic version. Worked good. Was seeing 500mA before then it bumped it up to 850mA - 1A range.
Thank you for this
Other Apps Charge money
Has anyone had an issue where it start charging and the 2 seconds later it stops and then starts again and keeps repeating?
Cozzeck said:
Has anyone had an issue where it start charging and the 2 seconds later it stops and then starts again and keeps repeating?
Click to expand...
Click to collapse
I've noticed this behavior with one of my old nokia wireless chargers or if i have a charging speed reading app open while the battery is >70% (when the battery management locks charging speed to 7.5w or less). But for me it seems to either go away after a minute or two or re-situating the phone on the charger.
Works great with my Samsung fast wireless charger! Goes from 600 ma to 1000+
Sent from my Pixel 3 XL using Tapatalk
Get this error using tasker. Any ideas? On April update. Was working previously.
01.07.14/E Run Shell: ->
01.07.14/E Run Shell: ->
01.07.14/E Run Shell: ->
01.07.14/Shell runBackground echo 9000000 > /sys/class/power_supply/wireless/voltage_max root: true timeout: -1
01.07.14/Shell start process-thread ID 263
01.07.14/E add wait type Shell1 time 2147483647
01.07.14/E add wait type Shell1 done
01.07.14/E add wait task
01.07.14/E Error: 1
PLEASE IGNORE THIS POST. I GOT MY ANSWER. SORRY.
Hm I'm trying to understand the exact shell command that is sent as I use Macrodroid.
What is the exact command I should use?
Also does this method still work on Android 10?

Surface RT Windows 10 brightness issue "FIX"

[Edited 07/01/2021]
The issue is inconsisten, and so the solution as I've been unable to repeat -consistently- the failure of the RT.
It's been described as "brightness control breaks if you do not se it manually right after boot, before suspension/sleep", but this is not accurate, as I've been able to use it normally even without tweaks or manually changing after boot. And sometimes the same (repeated and confirmed) steps produce the issue. So, it's not clear, not consistent, not repeateable 100% each time.
The brightness issue IS NOT SPECIFIC OF Windows 10 on ARM32 (Surface RT), as it's been present since Windows 8.1 on diff computer brands. While it affects desktop computers as well, it seems to hit harder on laptops, specially if the "sleep when you close the lid" is activated.
After reading quite a bit, many users report solving this issue on their computers (non Surface RT) removing the sleep when you close the lid, removing the stock display drivers and updating them, remove dimming the display to save power, and removing the automatic brightness adjustment. However none of this seems to work on the Surface.
I created some scripts / instructions for powershell (below) to change the brightness at startup, but it doesn't work 100% as expected, not all the times. So there is a difference between changing the brightness manually, VS doing the same with a script.
I managed to clear this issue after restarting the display driver manually, it works. It's a simple "disable / enable" display (NVIDIA Tegra 3), and you will hear the beep of detected hardware, that's it. Also created some script/instructions to do this and it works, but it shuts down the audio. I removed the -like on the device get to avoid affecting similarly named devices, but it's not that... as I also used -eq (equal), getting the device that exactly matches the name given, and it also shuts down the audio. It shouldn't but it does.
That's all I know for now, it's some strange issue.
************************************
[solution found, the first post keeps the first attempt. If the following doesn't work for you, then try the new one at the end.]
I managed to upgrade my Surface RT 1 to Windows 10 and yes, things work better this way, BUT the brightness control has some issues.
Problem:
The tablet starts from off state with brightness at 100% regardless of the last state.
While this has happened on most cases, I noticed sometimes it starts at 0% without user intervention.
Yes you can perform brightness adjustments BUT, if you don't do so, it breaks when the devices goes to sleep and you won't be able to change the brightness until restart.
Your experience might be different, I asked here and there, and it seems some users had a diff experience, but they seem to be just rare exceptions.
Runaround: right after first boot from off state, perform whatever adjustment and you will keep the freedom of changing the brightness at any time even after sleep. This is what I was told and tested myself, it works, but I'm not fully sure about this as I would need more time to test my tablet.
My fix:
Create a powershell script with this code inside:
Code:
$tempov = Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness;
$original = $tempov.CurrentBrightness *1
$valt=11
if($original -gt 30){
$blink=$original-$valt
}else{
$blink=$original+$valt
}
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,$blink)
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,$original)
You will have to enable running powershell scripts, in my case I opened a window, tried and was asked to enable it or not, I said yes, that's it. And you can run this script at any time. But the idea is adding it to the Task Scheduler and set it to run right after booting, this mean "at startup".
Originally I made the script set the brightness to 30% this way:
Code:
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,30)
But if the tablet wakes up at 100% or 0%, it won't be pretty. So I changed it to the code posted at the beginning of the thread. What it does is...
It gets the current brightness value
Then perform a simple calculation to know if it can add or substract
Then applies the new value (thus a change in brightness)
And then goes back to the original value applying the original percentage
This provides a more pleasant visual experience, a slight blink, almost unnoticeable.
Why those values on the code? long story, I don't think you want to know the details, what? ok, 10 doesn't always work, 1, 2, 3, 4, 5, etc don't work, on some ranges changes of 1, 2 values don't work (I don't know why), and the most safe way is to do so using 10 as the base units for change in brightness (don't ask me why, I tested over and over), so 11 is the safest value. I could explain more about my tests but I don't want too, it's too long and boring and wouldn't make a difference, the code above works, if you want something different then you are free to play with the code yourself.
IMPORTANT: to avoid seeing a window opening while running the script, set the task scheduler to "Run wether user is logged on or not". This would require your password, if you don't have one on your account then I don't know what to do, I tried but the thing insisted so there you go.
I'm not an expert on Task Scheduler so please don't ask, research yourself, don't want to be rude, I just don't know enough details to guide you, what I posted here WORKS.
Already tested (and will continue testing) and it works, the tablet does a light and almost unnoticeable fade-blink and the brightness control is preserved after sleep.
IF... you manage to add this feature to your Surface RT without errors, then report how the code helps or not your brightness control. My case = perfect. Will continue testing.
I think this is THE BEST method because even if you modify the brightness yourself, the code will be executed and it would be just slightly noticeable, so it's the best option regardless of the current brightness value.
Previous script works at times, don't blame me, I took my time to read, research and test, it's not that simple as "brightness gets broken after suspension", and it's not as easy to solve as "set your custom brightness level right after first boot", at least testing over and over prooves it.
But this one is bullet proof (PowerShell)
Code:
$d = Get-PnpDevice| where {$_.friendlyname -like "NVIDIA Tegra 3*"};
$d | Disable-PnpDevice -Confirm:$false;$d | Enable-PnpDevice -Confirm:$false
What it does is, it gets the screen device and disabled it and enables it again, the screen will just blink but the brighness control is fully restored, you can run it at any time it gets stuck. Not pretty but efficient. You could even set it on the task scheduler to run after wake up (I prefer not to).
Is this method still work?

Themes / Apps / Mods [MOD/magisk/root] Set charging limit to 90%

Based on: https://forum.xda-developers.com/t/limit-charge.4355851/
All credits to @rickysidhu_
Attached a simple Magisk module to set the charging limit to 90% at boot time.
If you want to "undo", just remove the Magisk module and reboot.
foobar66 said:
Based on: https://forum.xda-developers.com/t/limit-charge.4355851/
All credits to @rickysidhu_
Attached a simple Magisk module to set the charging limit to 90% at boot time.
If you want to "undo", just remove the Magisk module and reboot.
Click to expand...
Click to collapse
I really appreciate you uploading this, man. However, not sure the masses realize that ACCA magisk module can not only do exactly this, but it also has a litany of far more features.
Not only that, but it can actually increase the charging speed slightly. Cool stuff.
Just flash the module, and then install the APK. Then going to settings and set the parameters/limit, or increased charging speed you want.
I can't seem to get this to work on my P6P.
I am running Magisk 23014
The module is installed and "on"
The Damon is running in the App and In settings only temperature control and automatically cycle through switches are selected.
But, it always charged to 100%
Any suggestions?
biTToe said:
I can't seem to get this to work on my P6P.
I am running Magisk 23014
The module is installed and "on"
The Damon is running in the App and In settings only temperature control and automatically cycle through switches are selected.
But, it always charged to 100%
Any suggestions?
Click to expand...
Click to collapse
I have the same experience.
I suspect we can use it but have to change something manually like setting what the control file is, based on the thread that's referenced in the OP:
rickysidhu_ said:
If anyone is wondering how to stop the Pixel from charging at a certain percentage, it's the following command:
Code:
echo 90 > /sys/devices/platform/google,charger/charge_stop_level
Replace 90 with whatever percentage you want to stop charging at!
Click to expand...
Click to collapse
biTToe said:
I can't seem to get this to work on my P6P.
I am running Magisk 23014
The module is installed and "on"
The Damon is running in the App and In settings only temperature control and automatically cycle through switches are selected.
But, it always charged to 100%
Any suggestions?
Click to expand...
Click to collapse
Until the correct switches are implemented in acc, you can make it work by using the current & voltage controls as the charging switch.
> Click on the gear icon for Custom settings
> Click the pencil icon next to Charging switch
> Change the value to 0 mA & Save
> Save the custom settings (save icon in the top right corner)
> Restart ACC daemon
craigacgomez said:
Until the correct switches are implemented in acc, you can make it work by using the current & voltage controls as the charging switch.
> Click on the gear icon for Custom settings
> Click the pencil icon next to Charging switch
> Change the value to 0 mA & Save
> Save the custom settings (save icon in the top right corner)
> Restart ACC daemon
Click to expand...
Click to collapse
Everything is good, until i restart the daemon. then the app crashes. When i restart the settings in charging switch have reverted to automatic.
... test charging switch hangs.
Have disabled pixel battery stuff.
Have force closed and deleted all data for app.
with no luck
biTToe said:
Everything is good, until i restart the daemon. then the app crashes. When i restart the settings in charging switch have reverted to automatic.
... test charging switch hangs.
Have disabled pixel battery stuff.
Have force closed and deleted all data for app.
with no luck
Click to expand...
Click to collapse
Yeah, I don't know why the "Test Charging Switch" hangs in the app. But I'm not sure why restarting the daemon causes the app to crash for you.. You can try to set the charging switch to 0mA, save and reboot
Question from a noob, but why would I want to have my battery at 90% instead of 100%? Does it have something to do with battery health?
batpoil said:
Question from a noob, but why would I want to have my battery at 90% instead of 100%? Does it have something to do with battery health?
Click to expand...
Click to collapse
Correct.
batpoil said:
Question from a noob, but why would I want to have my battery at 90% instead of 100%? Does it have something to do with battery health?
Click to expand...
Click to collapse
Yep. For the last five years, I never quick charge, I charge as soon as my phone gets to 25% and I try to only charge to 75%. That 50% take still lasts me about a day.
Good battery health is also a selling point when I sell my old phones on Swappa.
craigacgomez said:
Yeah, I don't know why the "Test Charging Switch" hangs in the app. But I'm not sure why restarting the daemon causes the app to crash for you.. You can try to set the charging switch to 0mA, save and reboot
Click to expand...
Click to collapse
I finally got it working after multiple uninstall/reinstall/reboot cycles...
Or at least I thought I did. I changed the AccA version from Developer to Master.
That seems to have stopped the crashes and everything seemed to be working correctly. I plugged it in at 75% charge when I went to bed, but when i woke-up this morning I was at 40% charge -Status indicated discharging.
After a few more app and phone reboots it began charging again and now seems to be working: charge to 80%, discharge to 70%...
One thing I did notice was, if I set my Superuser access to "ask every time" I am constantly asks to grant permission every 20-30 seconds.
If it continues to be an issue I will post the log files if you can tell me where they can be found.
biTToe said:
I finally got it working after multiple uninstall/reinstall/reboot cycles...
Or at least I thought I did. I changed the AccA version from Developer to Master.
That seems to have stopped the crashes and everything seemed to be working correctly. I plugged it in at 75% charge when I went to bed, but when i woke-up this morning I was at 40% charge -Status indicated discharging.
After a few more app and phone reboots it began charging again and now seems to be working: charge to 80%, discharge to 70%...
One thing I did notice was, if I set my Superuser access to "ask every time" I am constantly asks to grant permission every 20-30 seconds.
If it continues to be an issue I will post the log files if you can tell me where they can be found.
Click to expand...
Click to collapse
After some time, I realised that the current/voltage switch was not working reliably, especially if you switch between chargers with different capacitites.
But I did find a better way to make acc work on the Pixel 6 / Pro. It uses the same charging switch that the modules above uses, but it will work with the acc pause/resume charging.
I do not know how to set this up using the app becuase it actually uses a combination of two switches the charge_stop_level and charge_start_level.
What you need:
Root (Magisk)
acc magisk modules (AccA app installs this. Tested with acc v2021.11.3)
Terminal emulator app
Steps:
Connect the phone to a charger
Open the terminal emulator app
Elevate to root
Code:
$ su
Reset acc to default (to eleminate any potential conflicts with previous configs)
Code:
# acc -s r
Set your pause (pc) and resume (rc) charge levels
Code:
# acc -s pc=80 rc=70
Specify the control switch
Code:
# acc -s s="/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --"
Validate the config. Check the values for resume_capacity, pause_capacity and charging_switch
Code:
# acc -s
Restart accd (acc daemon)
Code:
# accd
(Optional) Reboot
After that, you can tweak using AccA. Just leave the Charging switch & automatically cycle through switches" options untouched.
Further explanantion about the switch configuration
Code:
/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --
- set charge_start_level to 0 when below the "resume capacity" so that the phone will charge
- set charge_start_level to 95 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only start charging if the battery is 95%)
- set charge_stop_level to 95 when below the "resume capacity" so that the phone will charge
- set charge_stop_level to 5 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only stop charging if the battery is 5%)
- the double hyphen at the end disables the "automatically cycle through switches" to guarantee that the specified switch is the only one that will be used.
It doesn't work for me neither way. Hmmm
Burt Squirtz said:
I really appreciate you uploading this, man. However, not sure the masses realize that ACCA magisk module can not only do exactly this, but it also has a litany of far more features.
Not only that, but it can actually increase the charging speed slightly. Cool stuff.
Just flash the module, and then install the APK. Then going to settings and set the parameters/limit, or increased charging speed you want.
Click to expand...
Click to collapse
Hiya. What's the best method to keep up with more recent AccA Magisk Module versions? Asking for a friend who doesn't compile stuff. Seriously, I see it on GitHub https://github.com/Magisk-Modules-Repo/acc and I see instructions for building and installing, but is there any easy way for us lazy folks who never compile? i.e. is there any easy way for us non-developers to get files such as "Advanced_Charging_Controller_(ACC)-v2021.11.3(202111030).zip" out of the GitHub entry? Thanks.
@foobar66
I've changed the prefix of this thread from "Development" to "Themes / Apps / Mods" as it didn't qualify for the first one. Please review the stuck guidances at the top of the forum and do not change the prefix back.
Regards
Oswald Boelcke
Senior Moderator
I have the latest ACCA from August and the Dec version of ACC which is installed under the latest Magisk and the December update. I am also running the Kirisa kernel.
My issue is that the settings for "Apply on plug" never stick. The capacity control settings seem to stick.
I made the edit to the default profile which seems to work.
Hey.
Is it possible to make this module work on every charge without reboot?
craigacgomez said:
After some time, I realised that the current/voltage switch was not working reliably, especially if you switch between chargers with different capacitites.
But I did find a better way to make acc work on the Pixel 6 / Pro. It uses the same charging switch that the modules above uses, but it will work with the acc pause/resume charging.
I do not know how to set this up using the app becuase it actually uses a combination of two switches the charge_stop_level and charge_start_level.
What you need:
Root (Magisk)
acc magisk modules (AccA app installs this. Tested with acc v2021.11.3)
Terminal emulator app
Steps:
Connect the phone to a charger
Open the terminal emulator app
Elevate to root
Code:
$ su
Reset acc to default (to eleminate any potential conflicts with previous configs)
Code:
# acc -s r
Set your pause (pc) and resume (rc) charge levels
Code:
# acc -s pc=80 rc=70
Specify the control switch
Code:
# acc -s s="/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --"
Validate the config. Check the values for resume_capacity, pause_capacity and charging_switch
Code:
# acc -s
Restart accd (acc daemon)
Code:
# accd
(Optional) Reboot
After that, you can tweak using AccA. Just leave the Charging switch & automatically cycle through switches" options untouched.
Further explanantion about the switch configuration
Code:
/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --
- set charge_start_level to 0 when below the "resume capacity" so that the phone will charge
- set charge_start_level to 95 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only start charging if the battery is 95%)
- set charge_stop_level to 95 when below the "resume capacity" so that the phone will charge
- set charge_stop_level to 5 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only stop charging if the battery is 5%)
- the double hyphen at the end disables the "automatically cycle through switches" to guarantee that the specified switch is the only one that will be used.
Click to expand...
Click to collapse
hi! I'm quite new to ACC(A) and was wondering how to better keep my phone's battery healthy. I was wondering about battery idle mode and saw that Roll3r found a working battery idle mode for use with Kirisakura kernel which I'm on. However, I'm just a noob with all the terminal things and don't know how to implement it myself. it's this one:
Just an FYI (because others have asked), the only ACC (Advanced Charging Controller) charging switch with working battery idle mode is:
gcpm/constant_charge_current_max 1866420 0
Several other switches tested as supported idle, but they'd all crash ACC when idle priority is enabled. You may have to add it manually.
Edit: I shouldn't say "only" - this is the only switch (supported by this kernel) that I found get the phone to idle with. There might be others out there, too.
Click to expand...
Click to collapse
was wondering if you could list the terminal commands for this and what options am I not to touch afterwards (since in your example, which I have been using, you said not to touch the cycling option anymore)
As someone who doesn't like touching command lines/terminals, I just did these commands following craigacgomez and hoped for the best, but this time using Roll3r's switch that they found that allowed battery idle mode
su
acc -s r
acc -s pc=80 rc=70
acc -s s="gcpm/constant_charge_current_max 1866420 0 --"
accd
edit: ironically, idk how you add this switch using ACCA itself because entering the switch then the start and stop values just kicks me back to the previous dialogue, the one that says if I should choose auto or add a switch
craigacgomez's switch ( "/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --" ) oddly stops charging when I enable the cooldown cycle feature on ACCA. So if I set the cooldown cycle to start at 45%, my phone stops charging at 45%.
I'm testing Roll3r's switch ( "gcpm/constant_charge_current_max 1866420 0 --" ) now, which passed the battery idle mode test. I've stayed on 80% since reaching it and ACCA reports a -10 current every so often so definitely staying on that battery idle mode. I also have the cooldown feature enabled, also set to 45% and it was working well with no premature paused charging / battery idling.
Quick question, if it says charging speed goes from -10 to +10, does that already signify battery idle mode? That's what happens to either switch so I'm assuming it is since I know my phone would have dropped in battery by now
Delete

Categories

Resources