diff options
author | 2013-08-14 03:14:32 -0700 | |
---|---|---|
committer | 2013-08-14 03:14:32 -0700 | |
commit | cd786db858e70b561b400ed24bf59c0c4cdffe65 (patch) | |
tree | 7346fd2ee8fa275c7cf026753e44968cde64fbf6 /java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java | |
parent | c8617c00705b4afe4f2115e87f81b68b8197fbfd (diff) | |
parent | ed5582ec651ffc106c8fba64d138adbec359c63e (diff) | |
download | latinime-cd786db858e70b561b400ed24bf59c0c4cdffe65.tar.gz latinime-cd786db858e70b561b400ed24bf59c0c4cdffe65.tar.xz latinime-cd786db858e70b561b400ed24bf59c0c4cdffe65.zip |
am ed5582ec: Merge "Thin out audio and haptic feedback while key repeat"
* commit 'ed5582ec651ffc106c8fba64d138adbec359c63e':
Thin out audio and haptic feedback while key repeat
Diffstat (limited to 'java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java b/java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java index 42c57946d..54bc29559 100644 --- a/java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java +++ b/java/src/com/android/inputmethod/latin/AudioAndHapticFeedbackManager.java @@ -57,10 +57,10 @@ public final class AudioAndHapticFeedbackManager { mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); } - public void hapticAndAudioFeedback(final int primaryCode, + public void performHapticAndAudioFeedback(final int code, final View viewToPerformHapticFeedbackOn) { - vibrateInternal(viewToPerformHapticFeedbackOn); - playKeyClick(primaryCode); + performHapticFeedback(viewToPerformHapticFeedbackOn); + performAudioFeedback(code); } public boolean hasVibrator() { @@ -81,14 +81,14 @@ public final class AudioAndHapticFeedbackManager { return mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL; } - private void playKeyClick(final int primaryCode) { + public void performAudioFeedback(final int code) { // if mAudioManager is null, we can't play a sound anyway, so return if (mAudioManager == null) { return; } if (mSoundOn) { final int sound; - switch (primaryCode) { + switch (code) { case Constants.CODE_DELETE: sound = AudioManager.FX_KEYPRESS_DELETE; break; @@ -106,7 +106,7 @@ public final class AudioAndHapticFeedbackManager { } } - private void vibrateInternal(final View viewToPerformHapticFeedbackOn) { + public void performHapticFeedback(final View viewToPerformHapticFeedbackOn) { if (!mSettingsValues.mVibrateOn) { return; } |