Emit brightnessSupportQueried with the proper value
ClosedPublic

Authored by broulik on Sep 14 2016, 1:22 PM.

Details

Summary

Just because the sysfs helper succeeded, doesn't mean we actually have screen brightness support.
Only if maximum brightness greater than 0 is reported, we'll announce its support.
This fixes the brightness slider showing up in the KCM on desktop computers. The battery monitor already has the same logic and correctly did not show brightness sliders in this case.

Test Plan

On my laptop still works. if I fake xrandr brightness not being supported, goes through sysfs helper. If I fake sysfs helper getting a 0 max brightness, controls stop working and also hide from the KCM

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.
broulik updated this revision to Diff 6735.Sep 14 2016, 1:22 PM
broulik retitled this revision from to Emit brightnessSupportQueried with the proper value.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R122 Powerdevil.
Restricted Application added a project: Plasma. · View Herald TranscriptSep 14 2016, 1:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik edited the test plan for this revision. (Show Details)Sep 14 2016, 7:55 PM
bshah accepted this revision.Sep 15 2016, 5:10 AM
bshah added a reviewer: bshah.
This revision is now accepted and ready to land.Sep 15 2016, 5:10 AM
This revision was automatically updated to reflect the committed changes.