Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.internal.policy.impl.keyguard; import android.content.Context; import android.util.AttributeSet; import android.view.HapticFeedbackConstants; import android.view.View; import android.view.ViewParent; Loading Loading @@ -61,6 +62,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected TextView mPasswordEntry; protected LockPatternUtils mLockPatternUtils; protected SecurityMessageDisplay mSecurityMessageDisplay; protected boolean mEnableHaptics; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading @@ -80,6 +82,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout public void setLockPatternUtils(LockPatternUtils utils) { mLockPatternUtils = utils; mEnableHaptics = mLockPatternUtils.isTactileFeedbackEnabled(); } @Override Loading Loading @@ -110,7 +113,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout // We always set a dummy NavigationManager to avoid null checks mSecurityMessageDisplay = new KeyguardNavigationManager(null); mLockPatternUtils = new LockPatternUtils(mContext); // TODO: use common one mLockPatternUtils = new LockPatternUtils(mContext); mPasswordEntry = (TextView) findViewById(R.id.passwordEntry); mPasswordEntry.setOnEditorActionListener(this); Loading Loading @@ -240,5 +243,14 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout mSecurityMessageDisplay = display; reset(); } // Cause a VIRTUAL_KEY vibration public void doHapticKeyClick() { if (mEnableHaptics) { performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING | HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); } } } policy/src/com/android/internal/policy/impl/keyguard/KeyguardPINView.java +9 −2 Original line number Diff line number Diff line Loading @@ -103,6 +103,14 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView if (str.length() > 0) { mPasswordEntry.setText(str.subSequence(0, str.length()-1)); } doHapticKeyClick(); } }); pinDelete.setOnLongClickListener(new View.OnLongClickListener() { public boolean onLongClick(View v) { mPasswordEntry.setText(""); doHapticKeyClick(); return true; } }); } Loading @@ -118,4 +126,3 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView public void showUsabilityHint() { } } No newline at end of file policy/src/com/android/internal/policy/impl/keyguard/NumPadKey.java +15 −0 Original line number Diff line number Diff line Loading @@ -21,12 +21,14 @@ import android.content.res.TypedArray; import android.text.SpannableStringBuilder; import android.text.style.TextAppearanceSpan; import android.util.AttributeSet; import android.view.HapticFeedbackConstants; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import com.android.internal.R; import com.android.internal.widget.LockPatternUtils; public class NumPadKey extends Button { // list of "ABC", etc per digit, starting with '0' Loading @@ -35,6 +37,7 @@ public class NumPadKey extends Button { int mDigit = -1; int mTextViewResId; TextView mTextView = null; boolean mEnableHaptics; private View.OnClickListener mListener = new View.OnClickListener() { @Override Loading @@ -50,6 +53,7 @@ public class NumPadKey extends Button { if (mTextView != null) { mTextView.append(String.valueOf(mDigit)); } doHapticKeyClick(); } }; Loading @@ -70,6 +74,8 @@ public class NumPadKey extends Button { setOnClickListener(mListener); mEnableHaptics = new LockPatternUtils(context).isTactileFeedbackEnabled(); SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(String.valueOf(mDigit)); if (mDigit >= 0) { Loading Loading @@ -99,4 +105,13 @@ public class NumPadKey extends Button { mTextView = null; mTextViewResId = resId; } // Cause a VIRTUAL_KEY vibration public void doHapticKeyClick() { if (mEnableHaptics) { performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING | HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); } } } Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.internal.policy.impl.keyguard; import android.content.Context; import android.util.AttributeSet; import android.view.HapticFeedbackConstants; import android.view.View; import android.view.ViewParent; Loading Loading @@ -61,6 +62,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected TextView mPasswordEntry; protected LockPatternUtils mLockPatternUtils; protected SecurityMessageDisplay mSecurityMessageDisplay; protected boolean mEnableHaptics; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading @@ -80,6 +82,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout public void setLockPatternUtils(LockPatternUtils utils) { mLockPatternUtils = utils; mEnableHaptics = mLockPatternUtils.isTactileFeedbackEnabled(); } @Override Loading Loading @@ -110,7 +113,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout // We always set a dummy NavigationManager to avoid null checks mSecurityMessageDisplay = new KeyguardNavigationManager(null); mLockPatternUtils = new LockPatternUtils(mContext); // TODO: use common one mLockPatternUtils = new LockPatternUtils(mContext); mPasswordEntry = (TextView) findViewById(R.id.passwordEntry); mPasswordEntry.setOnEditorActionListener(this); Loading Loading @@ -240,5 +243,14 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout mSecurityMessageDisplay = display; reset(); } // Cause a VIRTUAL_KEY vibration public void doHapticKeyClick() { if (mEnableHaptics) { performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING | HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); } } }
policy/src/com/android/internal/policy/impl/keyguard/KeyguardPINView.java +9 −2 Original line number Diff line number Diff line Loading @@ -103,6 +103,14 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView if (str.length() > 0) { mPasswordEntry.setText(str.subSequence(0, str.length()-1)); } doHapticKeyClick(); } }); pinDelete.setOnLongClickListener(new View.OnLongClickListener() { public boolean onLongClick(View v) { mPasswordEntry.setText(""); doHapticKeyClick(); return true; } }); } Loading @@ -118,4 +126,3 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView public void showUsabilityHint() { } } No newline at end of file
policy/src/com/android/internal/policy/impl/keyguard/NumPadKey.java +15 −0 Original line number Diff line number Diff line Loading @@ -21,12 +21,14 @@ import android.content.res.TypedArray; import android.text.SpannableStringBuilder; import android.text.style.TextAppearanceSpan; import android.util.AttributeSet; import android.view.HapticFeedbackConstants; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import com.android.internal.R; import com.android.internal.widget.LockPatternUtils; public class NumPadKey extends Button { // list of "ABC", etc per digit, starting with '0' Loading @@ -35,6 +37,7 @@ public class NumPadKey extends Button { int mDigit = -1; int mTextViewResId; TextView mTextView = null; boolean mEnableHaptics; private View.OnClickListener mListener = new View.OnClickListener() { @Override Loading @@ -50,6 +53,7 @@ public class NumPadKey extends Button { if (mTextView != null) { mTextView.append(String.valueOf(mDigit)); } doHapticKeyClick(); } }; Loading @@ -70,6 +74,8 @@ public class NumPadKey extends Button { setOnClickListener(mListener); mEnableHaptics = new LockPatternUtils(context).isTactileFeedbackEnabled(); SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(String.valueOf(mDigit)); if (mDigit >= 0) { Loading Loading @@ -99,4 +105,13 @@ public class NumPadKey extends Button { mTextView = null; mTextViewResId = resId; } // Cause a VIRTUAL_KEY vibration public void doHapticKeyClick() { if (mEnableHaptics) { performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING | HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); } } }