summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-05-11 09:01:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-05-11 09:01:29 +0000
commit6accbd850bd29c85950a1f5b5540656e53b299a6 (patch)
treeebec6f13c84dbd59441680439a0ee7c6c0105589
parentf5f7b7db5d7857c3bb7dcae4174b37cdc0e25119 (diff)
parent6bd5b99ca6ac1640baa95715940bf2f2e392c223 (diff)
downloadNfc-6accbd850bd29c85950a1f5b5540656e53b299a6.tar.gz
Merge "Change vibration type to USAGE_HARDWARE_FEEDBACK" into tm-dev
-rw-r--r--src/com/android/nfc/NfcService.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 5cdd148f..6f96bb9a 100644
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -74,6 +74,7 @@ import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
+import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.provider.Settings;
@@ -242,6 +243,9 @@ public class NfcService implements DeviceHostListener {
// Timeout to re-apply routing if a tag was present and we postponed it
private static final int APPLY_ROUTING_RETRY_TIMEOUT_MS = 5000;
+ private static final VibrationAttributes HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES =
+ VibrationAttributes.createForUsage(VibrationAttributes.USAGE_HARDWARE_FEEDBACK);
+
private final UserManager mUserManager;
private static int nci_version = NCI_VERSION_1_0;
@@ -3107,7 +3111,8 @@ public class NfcService implements DeviceHostListener {
if (readerParams != null) {
try {
if ((readerParams.flags & NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS) == 0) {
- mVibrator.vibrate(mVibrationEffect);
+ mVibrator.vibrate(mVibrationEffect,
+ HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES);
playSound(SOUND_END);
}
if (readerParams.callback != null) {
@@ -3176,7 +3181,7 @@ public class NfcService implements DeviceHostListener {
PowerManager.USER_ACTIVITY_EVENT_OTHER, 0);
}
mDispatchFailedCount = 0;
- mVibrator.vibrate(mVibrationEffect);
+ mVibrator.vibrate(mVibrationEffect, HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES);
playSound(SOUND_END);
}
} catch (Exception e) {