@@ -0,0 +1,1683 @@
+/*%0A * Copyright (C) 2016 The CyanogenMod Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.cyanogenmod.hardware;%0A%0Aimport org.cyanogenmod.hardware.util.FileUtils;%0A%0Aimport java.io.File;%0A%0Apublic class VibratorHW %7B%0A%0A    private static String LEVEL_PATH = %22/sys/class/timed_output/vibrator/intensity%22;%0A%0A    public static boolean isSupported() %7B%0A        File f = new File(LEVEL_PATH);%0A        return f.exists();%0A    %7D%0A%0A    public static int getMaxIntensity()  %7B%0A        return 10000;%0A    %7D%0A%0A    public static int getMinIntensity()  %7B%0A        return 0;%0A    %7D%0A%0A    public static int getWarningThreshold()  %7B%0A        return 9000;%0A    %7D%0A%0A    public static int getCurIntensity()  %7B%0A        File f = new File(LEVEL_PATH);%0A        String actualIntensity = FileUtils.readOneLine(LEVEL_PATH).replace(%22intensity: %22, %22%22);%0A%0A        return f.exists() ? Integer.parseInt(actualIntensity) : 0;%0A    %7D%0A%0A    public static int getDefaultIntensity()  %7B%0A        return 7500;%0A    %7D%0A%0A    public static boolean setIntensity(int intensity)  %7B%0A        File f = new File(LEVEL_PATH);%0A%0A        return f.exists() && FileUtils.writeLine(LEVEL_PATH, String.valueOf(intensity));%0A    %7D%0A%7D%0A

Allow for vibration intensity to be configured