Face Unlock由PASSWORD_QUALITY_BIOMETRIC_WEAK
標誌控制,並與setPasswordQuality
一起使用。
例如,下面的代碼將要求用戶擁有人臉解鎖密碼(或更好)集,並在需要時將提示他們更新密碼:
DevicePolicyManager mDPM = (DevicePolicyManager)
context.getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName mPolicyAdmin = new ComponentName(context, PolicyAdmin.class);
// Enforce Face Unlock or better for new passwords
mDPM.setPasswordQuality(mPolicyAdmin,
DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK);
// Prompt user to upgrade password if necessary
if (!mDPM.isActivePasswordSufficient()) {
Intent intent = new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
startActivity(intent);
}
它的工作原理,謝謝。 – Naga 2012-09-28 14:31:21