Fix PIN lock pattern not respecting user settings

The LockPatternView had a boolean attribute mEnableHapticFeedback that
held a copy of the user settings for enabling "Touch feedback"
vibrations. This attribute was used together with
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING deprecated setting to
bypass the user settings in the vibrator service.

This change removes the use of this deprecated flag and lets the
Vibrator service apply the user settings for "Touch feedback" to
vibrations generated for the PIN lock input in LockPatternView.

Fix: 216656312
Test: manual
Change-Id: If9733c059e5059b6e58b6f84d100df2a0abafab6
This commit is contained in:
Lais Andrade
2022-03-22 20:12:40 +00:00
parent c46b5540e1
commit 9bab88b20a
3 changed files with 3 additions and 7 deletions

View File

@@ -35,7 +35,6 @@ import android.graphics.RecordingCanvas;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.Debug;
import android.os.Parcel;
@@ -769,8 +768,7 @@ public class LockPatternView extends View {
}
addCellToPattern(cell);
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING
| HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
return cell;
}
return null;

View File

@@ -76,8 +76,7 @@ public abstract class KeyguardAbsKeyInputView extends KeyguardInputView {
// Cause a VIRTUAL_KEY vibration
public void doHapticKeyClick() {
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING
| HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
}
public void setKeyDownListener(KeyDownListener keyDownListener) {

View File

@@ -219,7 +219,6 @@ public class NumPadKey extends ViewGroup {
// Cause a VIRTUAL_KEY vibration
public void doHapticKeyClick() {
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING
| HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
}
}