From 07577744419e161bbe6f1ea6a1d493fb8e978c73 Mon Sep 17 00:00:00 2001 From: tunturn Date: Mon, 6 Mar 2017 23:00:15 +1100 Subject: cmhw: update VibratorHW Change-Id: Ib4c5d818439f1df7e01e4dc11dbdfd6b19ecf5cc --- cmhw/org/cyanogenmod/hardware/VibratorHW.java | 16 +++++++--------- 1 file 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)); } } + -- cgit v1.2.3