Fix possible NPE in FingerprintManager.

There's an unsafe use of a @Nullable reference in FingerprintManager.
Add null check.

Bug: 254465749
Test: Manually confirm device doesn't crash during boot.
Change-Id: I26da2e9a2af06e110367fc6f1127df4fddbcc678
This commit is contained in:
Ben Murdoch
2022-10-21 13:11:17 +00:00
parent 298b073242
commit 59f3c0978b

View File

@@ -1080,7 +1080,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
*/
public boolean isPowerbuttonFps() {
final FingerprintSensorPropertiesInternal sensorProps = getFirstFingerprintSensor();
return sensorProps.sensorType == TYPE_POWER_BUTTON;
return sensorProps == null ? false : sensorProps.sensorType == TYPE_POWER_BUTTON;
}
/**