|
47 | 47 | import android.util.AttributeSet; |
48 | 48 | import android.util.Log; |
49 | 49 | import android.util.Slog; |
| 50 | +import android.view.HapticFeedbackConstants; |
50 | 51 | import android.view.KeyEvent; |
51 | 52 | import android.view.LayoutInflater; |
52 | 53 | import android.view.MotionEvent; |
@@ -79,6 +80,7 @@ public class KeyguardHostView extends KeyguardViewBase { |
79 | 80 | private KeyguardSecurityViewFlipper mSecurityViewContainer; |
80 | 81 | private KeyguardSelectorView mKeyguardSelectorView; |
81 | 82 | private KeyguardTransportControlView mTransportControl; |
| 83 | + private View mExpandChallengeView; |
82 | 84 | private boolean mIsVerifyUnlockOnly; |
83 | 85 | private boolean mEnableFallback; // TODO: This should get the value from KeyguardPatternView |
84 | 86 | private SecurityMode mCurrentSecuritySelection = SecurityMode.Invalid; |
@@ -250,9 +252,27 @@ protected void onFinishInflate() { |
250 | 252 |
|
251 | 253 | showPrimarySecurityScreen(false); |
252 | 254 | updateSecurityViews(); |
| 255 | + |
| 256 | + mExpandChallengeView = (View) findViewById(R.id.expand_challenge_handle); |
| 257 | + if (mExpandChallengeView != null) { |
| 258 | + mExpandChallengeView.setOnLongClickListener(mFastUnlockClickListener); |
| 259 | + } |
| 260 | + |
253 | 261 | minimizeChallengeIfDesired(); |
254 | 262 | } |
255 | 263 |
|
| 264 | + private final OnLongClickListener mFastUnlockClickListener = new OnLongClickListener() { |
| 265 | + @Override |
| 266 | + public boolean onLongClick(View v) { |
| 267 | + if (mLockPatternUtils.isTactileFeedbackEnabled()) { |
| 268 | + v.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, |
| 269 | + HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); |
| 270 | + } |
| 271 | + showNextSecurityScreenOrFinish(false); |
| 272 | + return true; |
| 273 | + } |
| 274 | + }; |
| 275 | + |
256 | 276 | private int getDisabledFeatures(DevicePolicyManager dpm) { |
257 | 277 | int disabledFeatures = DevicePolicyManager.KEYGUARD_DISABLE_FEATURES_NONE; |
258 | 278 | if (dpm != null) { |
|
0 commit comments