-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xiaomi/Redmi Support #74
Comments
Thanks Emil for your idea. I think this does not only regard Xiaomi and Redmi phones, but all phones which do support flashlight dimming but do not implement the Android API I am using to change that. I still don't have a rooted phone where I could develop this on and test it out. |
Hi @EmilEmilchen again, I plan on implementing some kind of fallback root access, but all development would be by imagining the outcome without being able to test it. Then I would need a user like you who can test it out on their rooted physical devices. For now I have a question: What happens, if you write invalid values to the mentioned path? So writing a value from 1 to 16 in your case would obviously just change the flashlight brightness. But what happens if you write 0, -1, 99 and so on. |
Of course I'd love to help out with testing! From what I can recall I'm pretty confident that if any invalid value is written its just sort of ignored. As this file is part of sysfs it's sort of write-only and you e.g. can't read it's contents at all but writing invalid values definitely doesn't "break" anything. I'll double check the exact behavior in the next few days. One more thing: I don't know whether the file path as well as the range of valid inputs is the same on every device where you need to use this method for brightness control but in assuming it is not perhaps some kind of advanced setting could at least be considered. |
That would be nice, you can check it with your "simpleFlashDimmer" and just set something like 50.
As mentioned by rabaimor in #61 there are path differences. And of course different devices have different max levels, so we would need to be able to adjust that. |
Sorry for my late response. I tried it out and I was partially right: The file isn't strictly speaking read only, it's just that reading it always reads
I also checked with a photoresistor and the maximum brightness where there is a change compared to the next lower number is 15. I don't know why I wrote 16 in my initial post, I mean including 0 that would be 17 but anyway, its 0 - 15 for this device. |
I really love this app but unfortunately it doesn't work with Xiaomi/Redmi devices, for example the Redmi Note 12 Pro Plus 5g. As far as I can tell it is impossible to get this feature working on this device without root permissions. Since I only have access to the Redmi device I mentioned I couldn't check on any other one but on the Note 12 Pro Plus the brightness is controlled by a 0-16 integer value in
/sys/class/leds/torch-light0/brightness
which is only accessible on a rooted device (as far as I can tell anyway). I haven't looked much into the inner workings of FlashDim but I'd love Xiaomi devices to be supported. I wrote a quick and dirty proof of concept (Github Repo) which just doesecho BRIGHTNESS_VALUE > /sys/class/leds/torch-light0/brightness
using theShell.cmd(command).exec()
method provided by the topjohnwu libsu API.The text was updated successfully, but these errors were encountered: