Respect admin disallow fingerprint in ConfirmDeviceCredentials
Bug: 26891832 Change-Id: I4c6377fb79fa31e6059149220c854c47ad53eda7
This commit is contained in:
@@ -83,6 +83,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr
|
|||||||
// Only take this argument into account if it belongs to the current profile.
|
// Only take this argument into account if it belongs to the current profile.
|
||||||
Intent intent = getActivity().getIntent();
|
Intent intent = getActivity().getIntent();
|
||||||
mEffectiveUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
|
mEffectiveUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
|
||||||
|
mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin();
|
||||||
mLockPatternUtils = new LockPatternUtils(getActivity());
|
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
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
Reference in New Issue
Block a user