Merge "Fix UDFPS enrolling crash" into udc-dev

This commit is contained in:
Vincent Wang
2023-03-01 09:12:38 +00:00
committed by Android (Google) Code Review

View File

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