summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-12-18 12:06:22 -0800
committerSantos Cordon <santoscordon@google.com>2014-12-18 12:08:22 -0800
commit4b04dbea40df272740acc61dcf2aa34f443f2299 (patch)
treef60f8234ee7a8130714cabb22cab75ab9c9a1416
parent85e0b443d11f1a6bbac0110d4b139bc62e5a01c0 (diff)
downloadpackages_apps_InCallUI-4b04dbea40df272740acc61dcf2aa34f443f2299.tar.gz
packages_apps_InCallUI-4b04dbea40df272740acc61dcf2aa34f443f2299.tar.bz2
packages_apps_InCallUI-4b04dbea40df272740acc61dcf2aa34f443f2299.zip
Add haptic vibration feedback on in-call buttons.
For buttons which appear an first-class actions in the in-call screen, add haptic feedback. This feedback ignores the system settings, meaning that it vibrates when buttons are touched regardless of the system settings for vibrating on keypress. Bug: 18388068 Change-Id: Ifadc973af9bcdfdfdc9d51b1c927b08d93714a58
-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() {