Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bad66071 authored by Clara Bayarri's avatar Clara Bayarri
Browse files

Respect admin disallow fingerprint in ConfirmDeviceCredentials

Bug: 26891832
Change-Id: I4c6377fb79fa31e6059149220c854c47ad53eda7
parent e50ed4ac
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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();