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

Unverified Commit 40a20f74 authored by Zhao Wei Liew's avatar Zhao Wei Liew Committed by Michael Bestas
Browse files

SystemUI: statusbar: Fix status bar brightness control feature

Bring in the missing fixes from CM 13.

This commit squashes the following commits from CM 13.0:
6397527c SystemUI: fix status bar brightness slider eating events
bbef4227 SystemUI : fix brightness slider for automatic brightness

Change-Id: I85e0b99dc33468b36222128660707fe481cf8b33
parent 924c42ba
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -3203,7 +3203,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                    ServiceManager.getService("power"));
            if (power != null) {
                if (mAutomaticBrightness) {
                    float adj = (value * 100) / (BRIGHTNESS_ADJ_RESOLUTION / 2f) - 1;
                    float adj = (2 * value) - 1;
                    adj = Math.max(adj, -1);
                    adj = Math.min(adj, 1);
                    final float val = adj;
@@ -3325,19 +3325,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
        if (mBrightnessChanged && upOrCancel) {
            mBrightnessChanged = false;
            if (mJustPeeked) {
                /**
                 * if we were just peeking, eat the event and collapse the status bar, otherwise
                 * the event gets passed down and a full expand might happen.
                 */
            if (mJustPeeked && mExpandedVisible) {
                mNotificationPanel.fling(10, false);
                if (mExpandedVisible) {
                    mExpandedVisible = false;
                    visibilityChanged(false);
                    setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
                }
                disable(mDisabledUnmodified1, mDisabledUnmodified2, true /* animate */);
                return true;
            }
        }
        return false;