Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f6bec27 authored by Gabriele M's avatar Gabriele M Committed by Steve Kondik
Browse files

Let liblights adjust the brightness of LEDs while previewing it

Each device might use the information about the brightness of LEDs
in a unique way. Currently the slider to adjust the brightness of
LEDs is using an already scaled RGB color to preview the intensity
of the light. Instead of doing this, use a white colored light and
add to it the information about the brightness.

Change-Id: I4dd35944debc744ea6c7f1fcc5dd7a909e8863fa
parent 3b577c45
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -212,9 +212,8 @@ public class NotificationBrightnessController implements ToggleSlider.Listener {
    private void updateNotification() {
        if (mNotificationAllow) {
            // Instead of canceling the notification, force it to update with the color.
            int notificationColor = mCurrentBrightness +
                                    (mCurrentBrightness << 8) +
                                    (mCurrentBrightness << 16);
            // Use a white light for a better preview of the brightness.
            int notificationColor = 0xFFFFFF | (mCurrentBrightness << 24);
            mNotificationBuilder.setLights(notificationColor, 1, 0);
            mNotificationManager.notify(1, mNotificationBuilder.build());
        }