public void onTrigger(View v, int target) { final int resId = mGlowPadView.getResourceIdForTarget(target); switch (resId) { case com.android.internal.R.drawable.ic_action_assist_generic: Intent assistIntent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) .getAssistIntent(mContext, UserHandle.USER_CURRENT); if (assistIntent != null) { mActivityLauncher.launchActivity(assistIntent, false, true, null, null); } else { Log.w(TAG, "Failed to get intent for assist activity"); } mCallback.userActivity(0); break; case com.android.internal.R.drawable.ic_lockscreen_camera: mActivityLauncher.launchCamera(null, null); mCallback.userActivity(0); break; case com.android.internal.R.drawable.ic_lockscreen_unlock_phantom: case com.android.internal.R.drawable.ic_lockscreen_unlock: mCallback.userActivity(0); mCallback.dismiss(false); break; } }
protected void verifyPasswordAndUnlock() { String entry = mPasswordEntry.getText().toString(); if (mLockPatternUtils.checkPassword(entry)) { mCallback.reportSuccessfulUnlockAttempt(); mCallback.dismiss(true); } else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) { // to avoid accidental lockout, only count attempts that are long enough to be a // real password. This may require some tweaking. mCallback.reportFailedUnlockAttempt(); if (0 == (mCallback.getFailedAttempts() % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) { long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); handleAttemptLockout(deadline); } mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(), true); } mPasswordEntry.setText(""); }
public void onGrabbed(View v, int handle) { mCallback.userActivity(0); doTransition(mFadeView, 0.0f); }
@Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { if (mCallback != null) { mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); } }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { mCallback.userActivity(0); return false; }