diff options
| author | Moyster <oysterized@gmail.com> | 2016-10-24 13:38:00 +0200 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-10-24 13:38:00 +0200 |
| commit | 6878b6780a2030f16c9c72d92d7396bfd305ed22 (patch) | |
| tree | 03e07291ab8b99c337ac59433364ffaaa673e462 | |
| parent | 3e6618a2dd0bcb9d4ab5aa12d3101669de6f59b8 (diff) | |
add Display Color Calibration cmhw
| -rw-r--r-- | cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java b/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java new file mode 100644 index 0000000..11d3ce1 --- /dev/null +++ b/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2016 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.cyanogenmod.hardware; + +import java.io.File; +import java.util.Scanner; +import org.cyanogenmod.hardware.util.FileUtils; + +public class DisplayColorCalibration { + private static final String COLOR_FILE = "/sys/devices/platform/mtk_disp_mgr.0/rgb"; + + public static boolean isSupported() { + File f = new File(COLOR_FILE); + return f.exists(); + } + + public static int getMaxValue() { + return 2000; + } + + public static int getMinValue() { + return 0; + } + + public static int getDefValue() { + return getMaxValue(); + } + + public static String getCurColors() { + return FileUtils.readOneLine(COLOR_FILE); + } + + public static boolean setColors(String colors) { + return FileUtils.writeLine(COLOR_FILE, colors); + } +} |
