diff options
author | tunturn <arbiter1000@gmail.com> | 2017-03-06 23:00:15 +1100 |
---|---|---|
committer | Max Weffers <rcstar6696@gmail.com> | 2017-03-14 13:15:07 +0100 |
commit | 07577744419e161bbe6f1ea6a1d493fb8e978c73 (patch) | |
tree | 4faa19e3c2f96ac576e7d027264148bfb4ad8633 | |
parent | b2537330bcd883c0c1a61524f36c7c4a4b7e6d2d (diff) |
cmhw: update VibratorHW
Change-Id: Ib4c5d818439f1df7e01e4dc11dbdfd6b19ecf5cc
-rw-r--r-- | cmhw/org/cyanogenmod/hardware/VibratorHW.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cmhw/org/cyanogenmod/hardware/VibratorHW.java b/cmhw/org/cyanogenmod/hardware/VibratorHW.java index 488cca1..c15eadc 100644 --- a/cmhw/org/cyanogenmod/hardware/VibratorHW.java +++ b/cmhw/org/cyanogenmod/hardware/VibratorHW.java @@ -16,11 +16,13 @@ package org.cyanogenmod.hardware; +import java.io.File; + import org.cyanogenmod.internal.util.FileUtils; public class VibratorHW { -// private static String LEVEL_PATH = "/sys/devices/virtual/timed_output/vibrator/vtg_level"; + private static String LEVEL_PATH = "/sys/devices/virtual/timed_output/vibrator/vtg_level"; public static boolean isSupported() { return true; @@ -30,23 +32,19 @@ public class VibratorHW { return 31; } public static int getMinIntensity() { - return 31; + return 21; } public static int getWarningThreshold() { return 31; } public static int getCurIntensity() { -// return Integer.parseInt(FileUtils.readOneLine(LEVEL_PATH)); - return 31; + return Integer.parseInt(FileUtils.readOneLine(LEVEL_PATH)); } public static int getDefaultIntensity() { return 31; } public static boolean setIntensity(int intensity) { -// return FileUtils.writeLine(LEVEL_PATH, String.valueOf(intensity)); - if (intensity == 31) { - return true; - } - return false; + return FileUtils.writeLine(LEVEL_PATH, String.valueOf(intensity)); } } + |