summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-12-22 19:43:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-22 19:43:58 +0000
commit4c6b21ccc913b9a5c18164e92dd85dc4f39feb9c (patch)
treecc812a0d37c16762234a1a3690eeab9721d81cb6
parentb16bc3bb33bb17e0b05e82f085ba4df405d5e201 (diff)
parent1b4b81431922b7546cbf7876e2b98e150a19baff (diff)
Merge "Add haptic vibration feedback on in-call buttons." into lmp-mr1-dev
-rw-r--r--InCallUI/src/com/android/incallui/CallButtonFragment.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java
index 0bfcc80c2..5c67862fc 100644
--- a/InCallUI/src/com/android/incallui/CallButtonFragment.java
+++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java
@@ -27,6 +27,7 @@ import android.graphics.drawable.StateListDrawable;
import android.os.Bundle;
import android.telecom.AudioState;
import android.view.ContextThemeWrapper;
+import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@@ -152,6 +153,7 @@ public class CallButtonFragment
int id = view.getId();
Log.d(this, "onClick(View " + view + ", id " + id + ")...");
+ boolean isClickHandled = true;
switch(id) {
case R.id.audioButton:
onAudioButtonClicked();
@@ -197,9 +199,16 @@ public class CallButtonFragment
mOverflowPopup.show();
break;
default:
+ isClickHandled = false;
Log.wtf(this, "onClick: unexpected");
break;
}
+
+ if (isClickHandled) {
+ view.performHapticFeedback(
+ HapticFeedbackConstants.VIRTUAL_KEY,
+ HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
+ }
}
public void updateColors() {