Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From c6101b53f979cf3e3c85e2c502ebf4f5338908c7 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 20 Sep 2019 18:24:45 +0530
Subject: [PATCH] HAX: Set scaled brightness
---
services/core/java/com/android/server/lights/LightsService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
index 9dee0171683..57e878f45e3 100644
--- a/services/core/java/com/android/server/lights/LightsService.java
+++ b/services/core/java/com/android/server/lights/LightsService.java
@@ -56,7 +56,7 @@ public class LightsService extends SystemService {
int color = brightness & 0x000000ff;
color = 0xff000000 | (color << 16) | (color << 8) | color;
- setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
+ setLightLocked(brightness * 2047 / 255, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
}
}
--
2.17.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment