summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Piotr WilczyƄski <wilczynskip@google.com> 2023-03-13 10:13:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-03-13 10:13:01 +0000
commit3568b128c13c57073dc95bb1e5df655c086db49e (patch)
treecfa0ecbc216a4693908ec0024d67e4d577cf1ea1
parentd65e51b3a4f43f58b980ad5f9dd395b680060f96 (diff)
parent3ad58186022a8ed919c9c68a9b18bab3af7c3632 (diff)
Merge "Don't overlog BrightnessEvents" into udc-dev
-rw-r--r--services/core/java/com/android/server/display/DisplayPowerController.java5
-rw-r--r--services/core/java/com/android/server/display/DisplayPowerController2.java5
-rw-r--r--services/core/java/com/android/server/display/brightness/BrightnessEvent.java2
3 files changed, 4 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index e40f3e7255d4..e12cd8c9a43b 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -1887,6 +1887,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
? mCdsi.getReduceBrightColorsStrength() : -1);
mTempBrightnessEvent.setPowerFactor(mPowerRequest.screenLowPowerBrightnessFactor);
mTempBrightnessEvent.setWasShortTermModelActive(wasShortTermModelActive);
+ mTempBrightnessEvent.setAutomaticBrightnessEnabled(mUseAutoBrightness);
// 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 =
@@ -1895,9 +1896,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
== BrightnessReason.REASON_TEMPORARY;
if ((!mTempBrightnessEvent.equalsMainData(mLastBrightnessEvent) && !tempToTempTransition)
|| brightnessAdjustmentFlags != 0) {
- float lastBrightness = mLastBrightnessEvent.getBrightness();
- mTempBrightnessEvent.setInitialBrightness(lastBrightness);
- mTempBrightnessEvent.setAutomaticBrightnessEnabled(mUseAutoBrightness);
+ mTempBrightnessEvent.setInitialBrightness(mLastBrightnessEvent.getBrightness());
mLastBrightnessEvent.copyFrom(mTempBrightnessEvent);
BrightnessEvent newEvent = new BrightnessEvent(mTempBrightnessEvent);
// Adjustment flags (and user-set flag) only get added after the equality checks since
diff --git a/services/core/java/com/android/server/display/DisplayPowerController2.java b/services/core/java/com/android/server/display/DisplayPowerController2.java
index 7b1a24680885..fbc354eb4c11 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController2.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController2.java
@@ -1597,6 +1597,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
mTempBrightnessEvent.setWasShortTermModelActive(wasShortTermModelActive);
mTempBrightnessEvent.setDisplayBrightnessStrategyName(displayBrightnessState
.getDisplayBrightnessStrategyName());
+ mTempBrightnessEvent.setAutomaticBrightnessEnabled(mUseAutoBrightness);
// 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 =
@@ -1605,9 +1606,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
== BrightnessReason.REASON_TEMPORARY;
if ((!mTempBrightnessEvent.equalsMainData(mLastBrightnessEvent) && !tempToTempTransition)
|| brightnessAdjustmentFlags != 0) {
- float lastBrightness = mLastBrightnessEvent.getBrightness();
- mTempBrightnessEvent.setInitialBrightness(lastBrightness);
- mTempBrightnessEvent.setAutomaticBrightnessEnabled(mUseAutoBrightness);
+ mTempBrightnessEvent.setInitialBrightness(mLastBrightnessEvent.getBrightness());
mLastBrightnessEvent.copyFrom(mTempBrightnessEvent);
BrightnessEvent newEvent = new BrightnessEvent(mTempBrightnessEvent);
// Adjustment flags (and user-set flag) only get added after the equality checks since
diff --git a/services/core/java/com/android/server/display/brightness/BrightnessEvent.java b/services/core/java/com/android/server/display/brightness/BrightnessEvent.java
index aff80de0011d..a3bca9accb81 100644
--- a/services/core/java/com/android/server/display/brightness/BrightnessEvent.java
+++ b/services/core/java/com/android/server/display/brightness/BrightnessEvent.java
@@ -142,8 +142,6 @@ public final class BrightnessEvent {
&& Float.floatToRawIntBits(mLux) == Float.floatToRawIntBits(that.mLux)
&& Float.floatToRawIntBits(mPreThresholdLux)
== Float.floatToRawIntBits(that.mPreThresholdLux)
- && Float.floatToRawIntBits(mInitialBrightness)
- == Float.floatToRawIntBits(that.mInitialBrightness)
&& Float.floatToRawIntBits(mBrightness)
== Float.floatToRawIntBits(that.mBrightness)
&& Float.floatToRawIntBits(mRecommendedBrightness)