Code Monkey home page Code Monkey logo

indicator-power's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

indicator-power's Issues

torch/flaslight availabilty to all devices

currently the flashlight toggle is not available on all devices
there is, however an app that can serve the same function on many devices in the store "utorch"
can the implementation from utorch be used to make the toggle available on more devices?

Brightness slider movable, does not change while moving with auto on.

Device: BQ E4.5
Channel: rc
Build: 2020-w49

Description:
The brightness slider on the indicator screen can be moved when auto adjustment is on. Under System Settings -> Brightness the brightness slider cannot be moved when auto adjustment is set.

Expected behavior:
The brightness slider on the indicator screen also cannot be moved when auto adjustment is on.

Thanks

Originally posted by @josevidalrt in ubports/system-settings#204 (comment)

It is still movable here:
screenshot20201128_101931328

BQ E5, after “update 634" (dev ch) -- today.

Originally posted by @FlavioMala in ubports/system-settings#204 (comment)

This is the wrong place to implement flashlight handling

indicator-power currently handles turning device flashlights on and off in https://github.com/ubports/indicator-power/blob/xenial/src/flashlight.c. To do this, it finds a valid sysfs path from its list of paths and writes a brightness value into it.

This does not seem like an appropriate place to handle finding and setting these values. It would be preferable to have a service which uses IPC to ask to enable and disable the flashlight. This service could better handle per-device quirks than this indicator.

Incicator not disappearing after uninstall

I recently installed this app on my Redmi Note 7 but the indicator in the top menu didn't work (just showed a blank page). So I turned off the permission to show notifications and removed the app but the indicator stays and i've tried multiple times reinstalling the app and uninstalling again, without any luck...

Torch toggle doesn't change `torch_0/brightness` value

The torch toggle doesn't work on my Redmi Note 9 Pro as it doesn't manage to change the value of /sys/class/leds/led:torch_0/brightness. Manually setting the value of the node and toggling the torch from the Power menu works just fine, but without doing this manually it fails with flashv2: qpnp_flash_led_brightness_set: Failed to get flash driver data.

Due to this working manually it makes me thing the problem it's from the indicator itself rather than my kernel.

Thanks.

Strace of the service:

) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\0\0\0\0\0\0\0", 16)         = 8
faccessat(AT_FDCWD, "/sys/class/leds/torch-light/brightness", F_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/sys/class/leds/led:flash_torch/brightness", F_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/sys/class/leds/flashlight/brightness", F_OK) = 0
faccessat(AT_FDCWD, "/sys/class/leds/led:switch/brightness", F_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/sys/class/leds/led:switch_0/brightness", F_OK) = 0
openat(AT_FDCWD, "/sys/class/leds/flashlight/brightness", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 9
faccessat(AT_FDCWD, "/sys/class/leds/led:switch_0/brightness", F_OK) = 0
openat(AT_FDCWD, "/sys/class/leds/led:switch_0/brightness", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 10
fstat(9, {st_mode=S_IFREG|0664, st_size=4096, ...}) = 0
fstat(10, {st_mode=S_IFREG|0664, st_size=4096, ...}) = 0
write(9, "255", 3)                      = 3
close(9)                                = 0
write(10, "1", 1)                       = 1
close(10)                               = 0
ppoll([{fd=3, events=POLLIN}], 1, {0, 0}, NULL, 0) = 0 (Timeout)
read(3, 0x7fe8eb18d8, 16)               = -1 EAGAIN (Resource temporarily unavailable)
write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x7f9c00d8a0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f90004d50, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x2ebc21c8, FUTEX_WAKE_PRIVATE, 1) = 1
ppoll([{fd=3, events=POLLIN}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLIN}])
ppoll([{fd=3, events=POLLIN}], 1, {0, 0}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {0, 0})
read(3, "\1\0\0\0\0\0\0\0", 16)         = 8
futex(0x2ebca190, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x2ebca190, FUTEX_WAKE_PRIVATE, 1) = 0
write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x7f9c00d8a0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f90004d50, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x2ebc21c8, FUTEX_WAKE_PRIVATE, 1) = 1
ppoll([{fd=3, events=POLLIN}], 1, {0, 0}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {0, 0})
read(3, "\1\0\0\0\0\0\0\0", 16)         = 8
clock_gettime(CLOCK_MONOTONIC, {3473, 16240249}) = 0
gettimeofday({1636225547, 891175}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {3473, 16521915}) = 0
ppoll([{fd=3, events=POLLIN}], 1, {0, 500000000}, NULL, 0) = 1 ([{fd=3, revents=POLLIN}], left {0, 491037084})
read(3, "\1\0\0\0\0\0\0\0", 16)         = 8
clock_gettime(CLOCK_MONOTONIC, {3473, 28884468}) = 0
clock_gettime(CLOCK_MONOTONIC, {3473, 29287176}) = 0
ppoll([{fd=3, events=POLLIN}], 1, {0, 487000000}, NULL, 0) = 0 (Timeout)
read(3, 0x7fe8eb18d8, 16)               = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {3473, 518737905}) = 0

Project is missing proper po/gettext setup

This project is missing the usual po/gettext setup - a subdirectory named po with .pot and .po files inside. As long as this issue is not fixed we cannot integrate it into Weblate.

Different devices with the same kernel might have multiple nodes present

The way the flashlight sysfs node is detected at the moment breaks on the miatoll devices because they use the same kernel but the sysfs nodes are different.

In my case the devices seem to have a different flashlight drivers but all the drivers nodes to be present on the device, making indicator-power to stop at the first node that it finds in the device based on the qcom_sysfs array even if that respective sysfs node isn't the correct one to be used on the respective driver present on the device.

One workaround I did to fix it was to try to echo to the specific node, and check dmesg after if the following error and do mount -o bind on the correct node: flashv2: qpnp_flash_led_brightness_set: Failed to get flash driver data.

This trick worked fine as the flashlight didn't turned on because it was not switched but I suppose indicator-power can make use of the newer deviceconfig to override the checks with predefined paths.

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.