robherring / generic_device

A generic android device repository
62 stars 29 forks source link

Lights fixes #4

Closed aleksander0m closed 6 years ago

aleksander0m commented 7 years ago

The following patches make the android brightness settings work properly.

aleksander0m commented 7 years ago

The first patch isn't generic enough probably, now that I see it, as it fixes the sysfs path to the "pic-backlight" directory...

robertfoss commented 6 years ago

@aleksander0m Is this PR still in progress?

aleksander0m commented 6 years ago

@robertfoss @robherring It is in progress, but I didn't spend much more time on this yet.

The two outstanding issues are the ueventd.rc vs init logic to change permissions, and the 'generic' filename used for brightness control (i.e. not always "pic-backlight").

Regarding the first issue, and as far as I understand, setting permissions on ueventd.rc only applies when there's some device file being notified via uevents; if there is none, as in this case with the lights control, the ueventd.rc permissions don't apply (they will never run), and we need the file permissions changed via init rules. But really I'm not that experienced to say this is always the case, especially since the kernel I used for testing where I validated those assumptions is the upstream Linux kernel and not an android-ized one.

aleksander0m commented 6 years ago

@robherring I have now updated this branch, removing the commit that moved the chmod to init.rc, and adding a new one which just removes the ueventd.rc line that changes the max_brightness file permissions. I still left the log updated for when read_int() fails, feel free to leave that out of the merge if you think it really isn't that useful.