summaryrefslogtreecommitdiffstats
path: root/src/com/android/phone/common/HapticFeedback.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/phone/common/HapticFeedback.java')
-rw-r--r--src/com/android/phone/common/HapticFeedback.java33
1 files changed, 1 insertions, 32 deletions
diff --git a/src/com/android/phone/common/HapticFeedback.java b/src/com/android/phone/common/HapticFeedback.java
index e667ad6..f19b8a6 100644
--- a/src/com/android/phone/common/HapticFeedback.java
+++ b/src/com/android/phone/common/HapticFeedback.java
@@ -61,8 +61,6 @@ import android.util.Log;
*/
public class HapticFeedback {
- private static final int VIBRATION_PATTERN_ID =
- com.android.internal.R.array.config_virtualKeyVibePattern;
/** If no pattern was found, vibrate for a small amount of time. */
private static final long DURATION = 10; // millisec.
/** Play the haptic pattern only once. */
@@ -93,9 +91,7 @@ public class HapticFeedback {
// We don't rely on getSystemService(Context.VIBRATOR_SERVICE) to make sure this
// vibrator object will be isolated from others.
mVibrator = new SystemVibrator(context);
- if (!loadHapticSystemPattern(context.getResources())) {
- mHapticPattern = new long[] {0, DURATION, 2 * DURATION, 3 * DURATION};
- }
+ mHapticPattern = new long[] {0, DURATION, 2 * DURATION, 3 * DURATION};
mSystemSettings = new Settings.System();
mContentResolver = context.getContentResolver();
}
@@ -141,31 +137,4 @@ public class HapticFeedback {
mVibrator.vibrate(mHapticPattern, NO_REPEAT);
}
}
-
- /**
- * @return true If the system haptic pattern was found.
- */
- private boolean loadHapticSystemPattern(Resources r) {
- int[] pattern;
-
- mHapticPattern = null;
- try {
- pattern = r.getIntArray(VIBRATION_PATTERN_ID);
- } catch (Resources.NotFoundException nfe) {
- Log.e(TAG, "Vibrate pattern missing.", nfe);
- return false;
- }
-
- if (null == pattern || pattern.length == 0) {
- Log.e(TAG, "Haptic pattern is null or empty.");
- return false;
- }
-
- // int[] to long[] conversion.
- mHapticPattern = new long[pattern.length];
- for (int i = 0; i < pattern.length; i++) {
- mHapticPattern[i] = pattern[i];
- }
- return true;
- }
}