[upowerbackend] set cached brightness manually in case of led backlight
ClosedPublic

Authored by bshah on Aug 17 2016, 11:43 AM.

Details

Summary

In normal backlight subsystem's drivers typical workflow is,

  • setBrightness gets called
  • it writes to sysfs file using backlight helper
  • kernel sends uevent for brightness change
  • onDeviceChanged is triggered
  • we update cache value

However in case of leds subsystem, kernel doesn't send uevent for
brightness change, hence uevent is never triggered and this doesn't
update cached value of brightness, resulting in DBus signal for
brightnessChanged never being emitted.

Test Plan

Tested on Nexus 5 which uses leds subsystem

Diff Detail

Repository
R122 Powerdevil
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bshah updated this revision to Diff 5998.Aug 17 2016, 11:43 AM
bshah retitled this revision from to [upowerbackend] set cached brightness manually in case of led backlight.
bshah updated this object.
bshah edited the test plan for this revision. (Show Details)
bshah added reviewers: Plasma, broulik.
Restricted Application added a project: Plasma. · View Herald TranscriptAug 17 2016, 11:43 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin added inline comments.
daemon/backends/upower/powerdevilupowerbackend.h
122

I suggest to use a different name. I read it as Controlled and just wanted to complain that the second L is uppercase.

bshah updated this revision to Diff 6004.Aug 18 2016, 5:53 AM
  • more readable variable name
broulik added inline comments.Aug 18 2016, 10:33 AM
daemon/backends/upower/powerdevilupowerbackend.cpp
55–58

Put new var on a new line

196–200

splitRef and QLatin1String

Can't you do contains("/leds/") to reduce the likelihood of false positives? Or can it also be /sys/class/ledsfoo/ or sth like that?

457

Make sure you don't emit if it didn't actually change (dunno what the code does internally so might already check for that)

broulik accepted this revision.Aug 18 2016, 10:34 AM
broulik edited edge metadata.
This revision is now accepted and ready to land.Aug 18 2016, 10:34 AM
bshah updated this revision to Diff 6022.Aug 18 2016, 10:52 AM
bshah marked 2 inline comments as done.
bshah edited edge metadata.

make things simple

This revision was automatically updated to reflect the committed changes.