Created
September 20, 2019 12:57
-
-
Save TheScarastic/5d2404f4583efbc1a72267babd56fafd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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