Fix UDFPS enrolling crash

Bug: b/271208595
Test: 1. adb root
      2. adb shell setprop sys.fflag.override.settings_biometrics2_enrollment true
      3. Record fingerprint
      4. Check setting work normally
Change-Id: I69cc50cd677e80a57bb430a5a295c46b519d7755
This commit is contained in:
Vincent Wang
2023-03-01 06:57:14 +00:00
parent 6113725b61
commit f2db627a7c

View File

@@ -226,6 +226,10 @@ public class UdfpsEnrollView extends FrameLayout {
}
DisplayInfo displayInfo = new DisplayInfo();
if (getDisplay() == null) {
android.util.Log.e(TAG, "Can not get display");
return;
}
getDisplay().getDisplayInfo(displayInfo);
Rect udfpsBounds = mSensorProperties.getLocation().getRect();
float scaleFactor = mUdfpsUtils.getScaleFactor(displayInfo);