aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorDClockaN <davor@losinj.com>2015-02-21 16:25:46 +0100
committerLorDClockaN <davor@losinj.com>2015-02-21 17:05:26 +0100
commit42f4fad4911894bac50479ad1fad07597865b60e (patch)
tree32d40f41c1a5a85305db2069b93e8206555937a7
parent659ad439549332932f3f955a69a411be6dc36adb (diff)
Class for gestures vibrations intensitylp5.0
Change-Id: Ic3f1ae6602d0ca999edf810e9db42da1b6c8363d
-rw-r--r--src/org/cyanogenmod/hardware/VibratorWG.java93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/org/cyanogenmod/hardware/VibratorWG.java b/src/org/cyanogenmod/hardware/VibratorWG.java
new file mode 100644
index 0000000..ab40476
--- /dev/null
+++ b/src/org/cyanogenmod/hardware/VibratorWG.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2013 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;
+
+/*
+ * Vibrator for wake gestures intensity adjustment
+ *
+ * Exports methods to get the valid value boundaries, the
+ * default and current intensities, and a method to set
+ * the vibrator.
+ *
+ * Values exported by min/max can be the direct values required
+ * by the hardware, or a local (to VibratorGestures) abstraction that's
+ * internally converted to something else prior to actual use. The
+ * Settings user interface will normalize these into a 0-100 (percentage)
+ * scale before showing them to the user, but all values passed to/from
+ * the client (Settings) are in this class' scale.
+ */
+
+public class VibratorWG {
+
+ /*
+ * All HAF classes should export this boolean.
+ * Real implementations must, of course, return true
+ */
+
+ public static boolean isSupported() { return false; }
+
+ /*
+ * Set the vibrator intensity to given integer input. That'll
+ * be a value between the boundaries set by get(Max|Min)Intensity
+ * (see below), and it's meant to be locally interpreted/used.
+ */
+
+ public static boolean setIntensity(int intensity) {
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * What's the maximum integer value we take for setIntensity()?
+ */
+
+ public static int getMaxIntensity() {
+ return -1;
+ }
+
+ /*
+ * What's the minimum integer value we take for setIntensity()?
+ */
+
+ public static int getMinIntensity() {
+ return -1;
+ }
+
+ /*
+ * Is there a value between the 2 above which is considered
+ * the safe max? If not, return anything < 0
+ */
+
+ public static int getWarningThreshold() {
+ return -1;
+ }
+
+ /*
+ * What's the current intensity value?
+ */
+
+ public static int getCurIntensity() {
+ return -1;
+ }
+
+ /*
+ * What's the shipping intensity value?
+ */
+
+ public static int getDefaultIntensity() {
+ return -1;
+ }
+}