summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristine Chen <christinech@google.com>2013-10-16 14:40:13 -0700
committerChristine Chen <christinech@google.com>2013-10-16 14:40:13 -0700
commit16f62c5ab5c21981e63d678187ad4b44e686332b (patch)
tree99ba08066620c6cb6aba2c715cbf3eeb311cace2
parent180de3514a800df7b9ca8f1c3da23287a709f61b (diff)
downloadandroid_packages_apps_PhoneCommon-16f62c5ab5c21981e63d678187ad4b44e686332b.tar.gz
android_packages_apps_PhoneCommon-16f62c5ab5c21981e63d678187ad4b44e686332b.tar.bz2
android_packages_apps_PhoneCommon-16f62c5ab5c21981e63d678187ad4b44e686332b.zip
Removes dependency on framework constants.
Bug: 11244110 Change-Id: I44bca3977c0740935c11b0dff7ef6397607c664a
-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;
- }
}