mirror of
https://github.com/yurisieucuti/treble_evolution.git
synced 2024-11-24 12:06:19 +00:00
43 lines
2.1 KiB
Diff
43 lines
2.1 KiB
Diff
From c4c9b6e79c52cb5c3074302cbab27b735899da95 Mon Sep 17 00:00:00 2001
|
|
From: Pierre-Hugues Husson <phh@phh.me>
|
|
Date: Mon, 30 Oct 2023 19:25:27 -0400
|
|
Subject: [PATCH 44/56] Add a prop to use linear backlight control
|
|
|
|
---
|
|
.../settings/brightness/BrightnessController.java | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
|
|
index 6af9b739da52..65e32255dcad 100644
|
|
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
|
|
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
|
|
@@ -346,9 +346,15 @@ public class BrightnessController implements ToggleSlider.Listener, MirroredBrig
|
|
: MetricsEvent.ACTION_BRIGHTNESS;
|
|
minBacklight = mBrightnessMin;
|
|
maxBacklight = mBrightnessMax;
|
|
- final float valFloat = MathUtils.min(
|
|
+ float valFloat = MathUtils.min(
|
|
convertGammaToLinearFloat(value, minBacklight, maxBacklight),
|
|
maxBacklight);
|
|
+ if (android.os.SystemProperties.getBoolean("persist.sys.phh.linear_brightness", false)) {
|
|
+ android.util.Log.e("PHH", "Linear brightness val " + value + " from " + minBacklight + " to " + maxBacklight + " makes " + valFloat);
|
|
+ valFloat = value / 65536.0f;
|
|
+ }
|
|
+ final float finalValFloat = valFloat;
|
|
+
|
|
if (stopTracking) {
|
|
// TODO(brightnessfloat): change to use float value instead.
|
|
MetricsLogger.action(mContext, metric,
|
|
@@ -359,7 +365,7 @@ public class BrightnessController implements ToggleSlider.Listener, MirroredBrig
|
|
if (!tracking) {
|
|
AsyncTask.execute(new Runnable() {
|
|
public void run() {
|
|
- mDisplayManager.setBrightness(mDisplayId, valFloat);
|
|
+ mDisplayManager.setBrightness(mDisplayId, finalValFloat);
|
|
}
|
|
});
|
|
}
|
|
--
|
|
2.25.1
|
|
|