mirror of
https://github.com/yurisieucuti/treble_evolution.git
synced 2024-11-24 08:36:19 +00:00
40 lines
1.7 KiB
Diff
40 lines
1.7 KiB
Diff
From 9cc241b77fa8b8c9fc87e4e2a2fda2199e917965 Mon Sep 17 00:00:00 2001
|
|
From: Pierre-Hugues Husson <phh@phh.me>
|
|
Date: Tue, 5 Oct 2021 17:59:16 -0400
|
|
Subject: [PATCH 02/51] Fallback to stupid autobrightness if brightness values
|
|
are broken
|
|
|
|
This is needed because of:
|
|
`ava.lang.IllegalArgumentException: The control points must all have strictly increasing X values.`
|
|
on some Samsung devices
|
|
|
|
Change-Id: Ieb679b34239013a5e31b34cb010b12febd9ef6d9
|
|
---
|
|
.../com/android/server/display/DisplayDeviceConfig.java | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
|
|
index d97127c91fbf..3dcb84dad786 100644
|
|
--- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
|
|
+++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
|
|
@@ -897,9 +897,14 @@ public class DisplayDeviceConfig {
|
|
*/
|
|
public static DisplayDeviceConfig create(Context context, boolean useConfigXml,
|
|
DisplayManagerFlags flags) {
|
|
- final DisplayDeviceConfig config;
|
|
+ DisplayDeviceConfig config;
|
|
if (useConfigXml) {
|
|
- config = getConfigFromGlobalXml(context, flags);
|
|
+ try {
|
|
+ config = getConfigFromGlobalXml(context, flags);
|
|
+ } catch(Exception e) {
|
|
+ android.util.Log.e("PHH", "Failed parsing automatic brightness values, fallbacking", e);
|
|
+ config = getConfigFromPmValues(context, flags);
|
|
+ }
|
|
} else {
|
|
config = getConfigFromPmValues(context, flags);
|
|
}
|
|
--
|
|
2.25.1
|
|
|