Only acquire FPM if feature is available

Test: Boot non-fp device, observe no wtf
Change-Id: If32b2370413f8bfe1477af52809c76e8c892cafa
Fixes: 32976626
This commit is contained in:
Jorim Jaggi
2016-11-22 13:45:17 +01:00
parent 683ed6c356
commit 3f12426d00

View File

@@ -1112,7 +1112,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
mTrustManager.registerTrustListener(this);
new LockPatternUtils(context).registerStrongAuthTracker(mStrongAuthTracker);
mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
mFpm = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
}
updateFingerprintListeningState();
if (mFpm != null) {
mFpm.addLockoutResetCallback(mLockoutResetCallback);