summaryrefslogtreecommitdiffstats
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
commit8c4fed1ee45c080da0799d38c350c03d6c351019 (patch)
tree3823fb652435004228ede49e056fb8927ce8bdee
parent3448dd02cf7682273b57f9157de7a8cc252c938c (diff)
parent4b04dbea40df272740acc61dcf2aa34f443f2299 (diff)
downloadpackages_apps_InCallUI-8c4fed1ee45c080da0799d38c350c03d6c351019.tar.gz
packages_apps_InCallUI-8c4fed1ee45c080da0799d38c350c03d6c351019.tar.bz2
packages_apps_InCallUI-8c4fed1ee45c080da0799d38c350c03d6c351019.zip
Merge "Add haptic vibration feedback on in-call buttons." into lmp-mr1-dev
-rw-r--r--src/com/android/incallui/CallButtonFragment.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/incallui/CallButtonFragment.java b/src/com/android/incallui/CallButtonFragment.java
index 0bfcc80c..5c67862f 100644
--- a/src/com/android/incallui/CallButtonFragment.java
+++ b/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() {