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

Commit f137667c authored by Rupesh Bansal's avatar Rupesh Bansal Committed by Automerger Merge Worker
Browse files

Merge "Fix the isUserSetBrightness flag being sent to BrightnessTracker" into...

Merge "Fix the isUserSetBrightness flag being sent to BrightnessTracker" into udc-dev am: 6c4a780b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21607519



Change-Id: Id7870767d1a95e950fe691ea1a039bc8eefa3260
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 38a0bcf6 6c4a780b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ public class BrightnessTracker {
     * Notify the BrightnessTracker that the user has changed the brightness of the display.
     */
    public void notifyBrightnessChanged(float brightness, boolean userInitiated,
            float powerBrightnessFactor, boolean isUserSetBrightness,
            float powerBrightnessFactor, boolean wasShortTermModelActive,
            boolean isDefaultBrightnessConfig, String uniqueDisplayId, float[] luxValues,
            long[] luxTimestamps) {
        if (DEBUG) {
@@ -328,7 +328,7 @@ public class BrightnessTracker {
        }
        Message m = mBgHandler.obtainMessage(MSG_BRIGHTNESS_CHANGED,
                userInitiated ? 1 : 0, 0 /*unused*/, new BrightnessChangeValues(brightness,
                        powerBrightnessFactor, isUserSetBrightness, isDefaultBrightnessConfig,
                        powerBrightnessFactor, wasShortTermModelActive, isDefaultBrightnessConfig,
                        mInjector.currentTimeMillis(), uniqueDisplayId, luxValues, luxTimestamps));
        m.sendToTarget();
    }
@@ -342,7 +342,7 @@ public class BrightnessTracker {
    }

    private void handleBrightnessChanged(float brightness, boolean userInitiated,
            float powerBrightnessFactor, boolean isUserSetBrightness,
            float powerBrightnessFactor, boolean wasShortTermModelActive,
            boolean isDefaultBrightnessConfig, long timestamp, String uniqueDisplayId,
            float[] luxValues, long[] luxTimestamps) {
        BrightnessChangeEvent.Builder builder;
@@ -367,7 +367,7 @@ public class BrightnessTracker {
            builder.setBrightness(brightness);
            builder.setTimeStamp(timestamp);
            builder.setPowerBrightnessFactor(powerBrightnessFactor);
            builder.setUserBrightnessPoint(isUserSetBrightness);
            builder.setUserBrightnessPoint(wasShortTermModelActive);
            builder.setIsDefaultBrightnessConfig(isDefaultBrightnessConfig);
            builder.setUniqueDisplayId(uniqueDisplayId);

@@ -995,7 +995,7 @@ public class BrightnessTracker {
                    BrightnessChangeValues values = (BrightnessChangeValues) msg.obj;
                    boolean userInitiatedChange = (msg.arg1 == 1);
                    handleBrightnessChanged(values.brightness, userInitiatedChange,
                            values.powerBrightnessFactor, values.isUserSetBrightness,
                            values.powerBrightnessFactor, values.wasShortTermModelActive,
                            values.isDefaultBrightnessConfig, values.timestamp,
                            values.uniqueDisplayId, values.luxValues, values.luxTimestamps);
                    break;
@@ -1026,7 +1026,7 @@ public class BrightnessTracker {
    private static class BrightnessChangeValues {
        public final float brightness;
        public final float powerBrightnessFactor;
        public final boolean isUserSetBrightness;
        public final boolean wasShortTermModelActive;
        public final boolean isDefaultBrightnessConfig;
        public final long timestamp;
        public final String uniqueDisplayId;
@@ -1034,11 +1034,11 @@ public class BrightnessTracker {
        public final long[] luxTimestamps;

        BrightnessChangeValues(float brightness, float powerBrightnessFactor,
                boolean isUserSetBrightness, boolean isDefaultBrightnessConfig,
                boolean wasShortTermModelActive, boolean isDefaultBrightnessConfig,
                long timestamp, String uniqueDisplayId, float[] luxValues, long[] luxTimestamps) {
            this.brightness = brightness;
            this.powerBrightnessFactor = powerBrightnessFactor;
            this.isUserSetBrightness = isUserSetBrightness;
            this.wasShortTermModelActive = wasShortTermModelActive;
            this.isDefaultBrightnessConfig = isDefaultBrightnessConfig;
            this.timestamp = timestamp;
            this.uniqueDisplayId = uniqueDisplayId;
+6 −6
Original line number Diff line number Diff line
@@ -1538,10 +1538,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        // user, or is a temporary adjustment.
        boolean userInitiatedChange = (Float.isNaN(brightnessState))
                && (autoBrightnessAdjustmentChanged || userSetBrightnessChanged);
        boolean hadUserBrightnessPoint = false;
        boolean wasShortTermModelActive = false;
        // Configure auto-brightness.
        if (mAutomaticBrightnessController != null) {
            hadUserBrightnessPoint = mAutomaticBrightnessController.hasUserDataPoints();
            wasShortTermModelActive = mAutomaticBrightnessController.hasUserDataPoints();
            mAutomaticBrightnessController.configure(autoBrightnessState,
                    mBrightnessConfiguration,
                    mLastUserSetScreenBrightness,
@@ -1824,7 +1824,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
                    userInitiatedChange = false;
                }
                notifyBrightnessTrackerChanged(brightnessState, userInitiatedChange,
                        hadUserBrightnessPoint);
                        wasShortTermModelActive);
            }

            // We save the brightness info *after* the brightness setting has been changed and
@@ -1866,7 +1866,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        mTempBrightnessEvent.setRbcStrength(mCdsi != null
                ? mCdsi.getReduceBrightColorsStrength() : -1);
        mTempBrightnessEvent.setPowerFactor(mPowerRequest.screenLowPowerBrightnessFactor);
        mTempBrightnessEvent.setWasShortTermModelActive(hadUserBrightnessPoint);
        mTempBrightnessEvent.setWasShortTermModelActive(wasShortTermModelActive);
        // Temporary is what we use during slider interactions. We avoid logging those so that
        // we don't spam logcat when the slider is being used.
        boolean tempToTempTransition =
@@ -2635,7 +2635,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
    }

    private void notifyBrightnessTrackerChanged(float brightness, boolean userInitiated,
            boolean hadUserDataPoint) {
            boolean wasShortTermModelActive) {
        final float brightnessInNits = convertToNits(brightness);
        if (mUseAutoBrightness && brightnessInNits >= 0.0f
                && mAutomaticBrightnessController != null && mBrightnessTracker != null) {
@@ -2646,7 +2646,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
                    ? mPowerRequest.screenLowPowerBrightnessFactor
                    : 1.0f;
            mBrightnessTracker.notifyBrightnessChanged(brightnessInNits, userInitiated,
                    powerFactor, hadUserDataPoint,
                    powerFactor, wasShortTermModelActive,
                    mAutomaticBrightnessController.isDefaultConfig(), mUniqueDisplayId,
                    mAutomaticBrightnessController.getLastSensorValues(),
                    mAutomaticBrightnessController.getLastSensorTimestamps());
+6 −6
Original line number Diff line number Diff line
@@ -1250,10 +1250,10 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
        // user, or is a temporary adjustment.
        boolean userInitiatedChange = (Float.isNaN(brightnessState))
                && (autoBrightnessAdjustmentChanged || userSetBrightnessChanged);
        boolean hadUserBrightnessPoint = false;
        boolean wasShortTermModelActive = false;
        // Configure auto-brightness.
        if (mAutomaticBrightnessController != null) {
            hadUserBrightnessPoint = mAutomaticBrightnessController.hasUserDataPoints();
            wasShortTermModelActive = mAutomaticBrightnessController.hasUserDataPoints();
            mAutomaticBrightnessController.configure(autoBrightnessState,
                    mBrightnessConfiguration,
                    mDisplayBrightnessController.getLastUserSetScreenBrightness(),
@@ -1538,7 +1538,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
                    userInitiatedChange = false;
                }
                notifyBrightnessTrackerChanged(brightnessState, userInitiatedChange,
                        hadUserBrightnessPoint);
                        wasShortTermModelActive);
            }

            // We save the brightness info *after* the brightness setting has been changed and
@@ -1580,7 +1580,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
        mTempBrightnessEvent.setRbcStrength(mCdsi != null
                ? mCdsi.getReduceBrightColorsStrength() : -1);
        mTempBrightnessEvent.setPowerFactor(mPowerRequest.screenLowPowerBrightnessFactor);
        mTempBrightnessEvent.setWasShortTermModelActive(hadUserBrightnessPoint);
        mTempBrightnessEvent.setWasShortTermModelActive(wasShortTermModelActive);
        mTempBrightnessEvent.setDisplayBrightnessStrategyName(displayBrightnessState
                .getDisplayBrightnessStrategyName());
        // Temporary is what we use during slider interactions. We avoid logging those so that
@@ -2221,7 +2221,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
    }

    private void notifyBrightnessTrackerChanged(float brightness, boolean userInitiated,
            boolean hadUserDataPoint) {
            boolean wasShortTermModelActive) {
        final float brightnessInNits = convertToNits(brightness);
        if (mUseAutoBrightness && brightnessInNits >= 0.0f
                && mAutomaticBrightnessController != null && mBrightnessTracker != null) {
@@ -2232,7 +2232,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
                    ? mPowerRequest.screenLowPowerBrightnessFactor
                    : 1.0f;
            mBrightnessTracker.notifyBrightnessChanged(brightnessInNits, userInitiated,
                    powerFactor, hadUserDataPoint,
                    powerFactor, wasShortTermModelActive,
                    mAutomaticBrightnessController.isDefaultConfig(), mUniqueDisplayId,
                    mAutomaticBrightnessController.getLastSensorValues(),
                    mAutomaticBrightnessController.getLastSensorTimestamps());