Respect admin disallow fingerprint in ConfirmDeviceCredentials

Bug: 26891832
Change-Id: I4c6377fb79fa31e6059149220c854c47ad53eda7
This commit is contained in:
Clara Bayarri
2016-02-18 15:52:49 +00:00
parent e50ed4ac72
commit bad66071cc

View File

@@ -83,6 +83,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
// Only take this argument into account if it belongs to the current profile.
Intent intent = getActivity().getIntent();
mEffectiveUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin();
mLockPatternUtils = new LockPatternUtils(getActivity());
}
@@ -113,6 +114,13 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
}
}
private boolean isFingerprintDisabledByAdmin() {
DevicePolicyManager dpm = (DevicePolicyManager) getActivity().getSystemService(
Context.DEVICE_POLICY_SERVICE);
final int disabledFeatures = dpm.getKeyguardDisabledFeatures(null, mEffectiveUserId);
return (disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0;
}
@Override
public void onResume() {
super.onResume();