Code Monkey home page Code Monkey logo

Comments (14)

VR-25 avatar VR-25 commented on July 24, 2024 1

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.

Screenshot_20190617-074344

from acc.

VR-25 avatar VR-25 commented on July 24, 2024 1

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?...

  1. When unplugged
  2. When plugged in, charging (acc -e)
  3. When plugged in, NOT charging (acc -d)

from acc.

elem089 avatar elem089 commented on July 24, 2024 1

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":

  1. 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
  2. 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
  3. 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 avatar eugenesan commented on July 24, 2024 1

@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.

elem089 avatar elem089 commented on July 24, 2024

for me (OP6) "su - acpi -a" delivers 3 lines for "Adapter 0", "Adapter 1" and "Adapter 2". Only visible change is in "Adapter 0"

  1. Adapter 0: off-line
  2. Adapter 0: on-line
  3. Adapter 0: off-line

from acc.

VR-25 avatar VR-25 commented on July 24, 2024

@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.

VR-25 avatar VR-25 commented on July 24, 2024

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.

elem089 avatar elem089 commented on July 24, 2024

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.

VR-25 avatar VR-25 commented on July 24, 2024

@elem089, reports on other devices will definitely be helpful - only in regards to acpi -a, though. Forget about dumpsys.

Thanks

from acc.

eugenesan avatar eugenesan commented on July 24, 2024

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.

elem089 avatar elem089 commented on July 24, 2024

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.

elem089 avatar elem089 commented on July 24, 2024

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.

VR-25 avatar VR-25 commented on July 24, 2024

@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.

VR-25 avatar VR-25 commented on July 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.