public void UnFrozenStartFingerIdentify() { DebugLog.d(LOG_TAG, "startIdentify mIsStartIdentifyState:" + mIsStartIdentifyState); synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { startIdentifyIfNeed(); } }); } }
@Override public void handleMessage(Message msg) { super.handleMessage(msg); readFingerprintSwitchValue(); synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { getIds(); } }); } }
private void onFingerNoMatch(int reason) { if (reason == 2) { // cancel&exception return; } else if (reason == 1) { // timeout synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { startIdentifyIfNeed(); } }); } } else if (reason == 0) { DebugLog.d(LOG_TAG, "onFingerNoMatch mIdentifyFailedTimes: " + mIdentifyFailedTimes); fingerMatchFail(); } }
public void cancel() { synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { DebugLog.d(LOG_TAG, "cancel...." + Thread.currentThread().getId()); DebugLog.d(LOG_TAG, "cancel()-start--"); try { Method cancel = mGnFingerPrintManagerClass.getMethod("cancel"); cancel.invoke(mObj); mIsStartIdentifyState = false; } catch (Exception e) { e.toString(); } finally { resetIdentifyFailedTimes(); } } }); } }
public FingerIdentifyManager(Context context) { mContext = context; sInstance = this; FingerThread.getInstance().init(); registerFingerSwitchObserver(); }
private void fingerMatchFail() { DebugLog.e(LOG_TAG, "fingerMatchFail isSecureFrozen---" + isSecureFrozen()); if (isSecureFrozen()) { cancel(); return; } if (isAtHomePosition()) { DebugLog.d(LOG_TAG, "fingerMatchFail isAtHomePosition : true"); if (mIdentifyFailedTimes < 2) { mIdentifyFailedTimes++; KeyguardViewHostManager.getInstance().shakeFingerIdentifyTip(); VibatorUtil.amigoVibrate( mContext, VibatorUtil.LOCKSCREEN_UNLOCK_CODE_ERROR, VibatorUtil.UNLOCK_ERROR_VIBRATE_TIME); synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { startIdentifyIfNeed(); } }); } } else if (mIdentifyFailedTimes == 2) { mIdentifyFailedTimes = 0; KeyguardViewHostManager.getInstance().shakeFingerIdentifyTip(); VibatorUtil.amigoVibrate( mContext, VibatorUtil.LOCKSCREEN_UNLOCK_CODE_ERROR, VibatorUtil.UNLOCK_ERROR_VIBRATE_TIME); synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { startIdentifyIfNeed(); } }); } KeyguardViewHostManager.getInstance().scrollToUnlockHeightByOther(true); } } else { DebugLog.d(LOG_TAG, "fingerMatchFail isAtHomePosition : false"); mIdentifyFailedTimes = 0; KeyguardViewHostManager.getInstance().fingerPrintFailed(); synchronized (this) { FingerThread.getInstance() .excuteTask( new Runnable() { @Override public void run() { startIdentifyIfNeed(); } }); } } }