Comments (14)
Interesting
This requires a dedicated charger plugin event listener that would communicate with accd via flag/lock files.
A major issue would be the reliability of such events. I'll think more about that.
Currently, you can run acc -f
to charge once without limitations.
With Tasker, "double-pressing the power button to open camera" can be reprogrammed to run that command.
from acc.
I may have found a way to reliably detect plug in events, and run acc --full
accordingly - to charge fully once, then restart the daemon with regular settings.
Here's a little homework for you - to test that possibility:
What's the output of su -c acpi -a
?...
- When unplugged
- When plugged in, charging (
acc -e
) - When plugged in, NOT charging (
acc -d
)
from acc.
ok, didn't know that, good that I mentioned the device ;)
here we go: "dumpsys batteryproperties" is always empty so the results are for "dumpsys battery":
- unplugged:
:/ $ su -c dumpsys battery Current Battery Service state: AC powered: false USB powered: false Wireless powered: false Max charging current: 0 Max charging voltage: 0 Charge counter: 2425142 status: 3 health: 2 present: true level: 84 scale: 100 voltage: 4146 temperature: 269 technology: Li-ion fastChargeStatus: false
- plugged, charging:
:/ $ su -c acc -e (i) Charging enabled :/ $ su -c dumpsys battery Current Battery Service state: AC powered: false USB powered: true Wireless powered: false Max charging current: 500000 Max charging voltage: 5000000 Charge counter: 2417090 status: 2 health: 2 present: true level: 83 scale: 100 voltage: 4184 temperature: 299 technology: Li-ion fastChargeStatus: false
- plugged, not charging (did that before forcing to charge through 'acc -e'):
:/ $ su -c dumpsys battery Current Battery Service state: AC powered: false USB powered: false Wireless powered: false Max charging current: 0 Max charging voltage: 0 Charge counter: 2415756 status: 3 health: 2 present: true level: 83 scale: 100 voltage: 4140 temperature: 293 technology: Li-ion fastChargeStatus: false
from acc.
@eugenesan, unfortunately none of these two devices would support the plug in event listener based on
acpi -a
.Poor driver implementations...
I'll keep looking for alternatives.Thanks
@VR-25
I understand.
Thank you for your efforts.
Maybe one day we will find the solution.
from acc.
for me (OP6) "su - acpi -a" delivers 3 lines for "Adapter 0", "Adapter 1" and "Adapter 2". Only visible change is in "Adapter 0"
- Adapter 0: off-line
- Adapter 0: on-line
- Adapter 0: off-line
from acc.
@elem089, acpi -a
won't be useful for OP6.
Now, what are the outputs of su -c dumpsys battery
and su -c dumpsys batteryproperties
, respectively, in the 3 scenarios above?
Thanks
from acc.
Since the first output is pretty much the same as the last, this is just as unreliable as acpi -a
.
This also means the latest prerelease won't work for you, @elem089.
It's one of those things that only work for some (it does for me).
Perhaps, instead of killing the potential usability of acpi, I will write a testing algorithm - so that acpi -a
is only used if it actually works.
At least we're not back to ground zero (more like ground 0.5).
Thanks!
from acc.
Understand: you expected to see some kind of status change between "unplugged" and "plugged, not charging"
Tonight I can run that test on my 2 well-aged Xperias, unless you feel that this is useless.
This also means the latest prerelease won't work for you
Installed it anyway (before I started testing). But shouldn't do any harm, so I'll leave it at that
from acc.
@elem089, reports on other devices will definitely be helpful - only in regards to acpi -a
, though. Forget about dumpsys
.
Thanks
from acc.
Nexus 5X (acpi -a):
- un plugged:
Adapater 0: off-line
- plugged charging:
Adapater 0: on-line
- plugged not charging:
Adapater 0: off-line
Pixel 3a (acpi -a):
- un plugged:
Adapater 0: off-line
Adapater 1: off-line
Adapater 2: off-line
- plugged charging:
Adapater 0: off-line
Adapater 1: off-line
Adapater 2: on-line
- plugged not charging:
Adapater 0: off-line
Adapater 1: off-line
Adapater 2: off-line
from acc.
Sony Xperia Z1 Compact (amami), LineageOS 16.0, acc build 20190709:
- unplugged:
:/ # acpi -a
Adapter 0: off-line
Adapter 1: off-line
Adapter 2: off-line
- plugged, charging:
:/ # acc -e
(i) Charging enabled
:/ # acpi -a
Adapter 0: on-line
Adapter 1: off-line
Adapter 2: off-line
- plugged, not charging:
:/ # acc -d
(i) Charging disabled
:/ # acpi -a
Adapter 0: on-line
Adapter 1: off-line
Adapter 2: off-line
from acc.
Sony Xperia TabletZ (pollux_windy), LineageOS 15.1, acc build 20190709:
- unplugged:
pollux_windy:/ # acpi -a
Adapter 0: off-line
Adapter 1: off-line
- plugged, charging:
pollux_windy:/ # acc -e
(i) Charging enabled
pollux_windy:/ # acpi -a
Adapter 0: off-line
Adapter 1: on-line
- plugged, not charging:
pollux_windy:/ # acc -d
(i) Charging disabled
pollux_windy:/ # acpi -a
Adapter 0: off-line
Adapter 1: on-line
from acc.
@eugenesan, unfortunately none of these two devices would support the plug in event listener based on acpi -a
.
Poor driver implementations...
I'll keep looking for alternatives.
Thanks
from acc.
@elem089, that's great!
Just like Motorola, Sony got us covered on this.
Both Xperia devices support what I have in mind.
-
Unplugged (external power supply status: disconnected )
-
Plugged in, charging (external power supply status: connected )
-
Plugged in, not charging (external power supply status: still connected - here's where other devices fail)
This also means that both devices probably support battery idle mode .
Thanks
from acc.
Related Issues (20)
- Battery jump between idle and charging during idle mode HOT 4
- How exactly does native battery idle mode work? HOT 1
- nexus 10 (manta) failed to install acc HOT 1
- Update app on F-droid or upload to IzzyOnDroid HOT 1
- Fast charging & Mar 2024 update HOT 6
- Pixel 5 Idle Configuration Help HOT 4
- Redmi 7 issues HOT 6
- resetBsOnPause and resetBsOnUnplug not working on Pixel 8 / Android 14 HOT 1
- Charging Does Not Stop At Pause Capacity HOT 9
- Battery is slowly draining with Idle mode enabled HOT 10
- Xiaomi Poco X4 Issues HOT 1
- v2024.4.7-rc fails with segfault HOT 15
- Charge % limit not working with wireless charging on OnePlus 12 HOT 4
- Pixel 6 latest version intermittent charging HOT 3
- damon stopped with exit code 1 pixel 8 A14 HOT 13
- "Charge once" becomes permanent until restarting acc HOT 3
- Can you add support for APatch? Installation failed in APatch. HOT 1
- acca crashes with latest build HOT 2
- OnePlus 9 Pro
- Nothing phone 2a HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acc.