diff options
| author | Steve Kondik <steve@cyngn.com> | 2016-04-18 15:04:12 -0700 |
|---|---|---|
| committer | Steve Kondik <steve@cyngn.com> | 2016-04-18 19:25:22 -0700 |
| commit | 39638c00c66e0fc83edec734d8f8d9039bedf73c (patch) | |
| tree | 726bacebca27dd97a11a70ed58802f2b7003e981 | |
| parent | d3ceb184ba72e5f63d5ae5e10ed43bf6c2ffa3ae (diff) | |
| download | android_hardware_lineage_lineagehw-39638c00c66e0fc83edec734d8f8d9039bedf73c.tar.gz android_hardware_lineage_lineagehw-39638c00c66e0fc83edec734d8f8d9039bedf73c.tar.bz2 android_hardware_lineage_lineagehw-39638c00c66e0fc83edec734d8f8d9039bedf73c.zip | |
cmhw: Fix DisplayColorCalibration GPU-mode issues
* Make the fallback more robust
* Fix method to return current values
Change-Id: I13d31ed3994684ebaee9394d740c1c55aaf800ba
| -rw-r--r-- | src/org/cyanogenmod/hardware/DisplayColorCalibration.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/cyanogenmod/hardware/DisplayColorCalibration.java b/src/org/cyanogenmod/hardware/DisplayColorCalibration.java index f405281..04b0c57 100644 --- a/src/org/cyanogenmod/hardware/DisplayColorCalibration.java +++ b/src/org/cyanogenmod/hardware/DisplayColorCalibration.java @@ -43,7 +43,8 @@ public class DisplayColorCalibration { static { // We can also support GPU transform using RenderEngine. This is not // preferred though, as it has a high power cost. - sUseGPUMode = !(new File(COLOR_FILE).exists()) || + final File sysfs = new File(COLOR_FILE); + sUseGPUMode = (!sysfs.exists() || !sysfs.canWrite()) || SystemProperties.getBoolean("debug.livedisplay.force_gpu", false); } @@ -69,8 +70,8 @@ public class DisplayColorCalibration { return FileUtils.readOneLine(COLOR_FILE); } - return String.format("%d %d %d", sCurColors[0] * MAX, - sCurColors[1] * MAX, sCurColors[2] * MAX); + return String.format("%d %d %d", sCurColors[0], + sCurColors[1], sCurColors[2]); } public static boolean setColors(String colors) { |
