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

Commit b3230cd6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "AutoBrightness: Remove handler's messages before send."

parents 2a24bd30 ea86d713
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -259,10 +259,12 @@ public class BrightnessSynchronizer{
            }
            if (BRIGHTNESS_URI.equals(uri)) {
                int currentBrightness = getScreenBrightnessInt(mContext);
                mHandler.removeMessages(MSG_UPDATE_FLOAT);
                mHandler.obtainMessage(MSG_UPDATE_FLOAT, currentBrightness, 0).sendToTarget();
            } else if (BRIGHTNESS_FLOAT_URI.equals(uri)) {
                float currentFloat = getScreenBrightnessFloat(mContext);
                int toSend = Float.floatToIntBits(currentFloat);
                mHandler.removeMessages(MSG_UPDATE_INT);
                mHandler.obtainMessage(MSG_UPDATE_INT, toSend, 0).sendToTarget();
            }
        }