Upate face sensor loc as resolution

Update face sensor location when resolution changed.

Bug: 231732980
Test: atest AuthControllerTest
Test: check face unlock animation start point correctness on different
      resolutions
Change-Id: Ie2be96510dc0b7965512800b392b2cdb94d22534
This commit is contained in:
Milton Wu
2022-05-12 18:11:55 +08:00
parent f31b335eb2
commit 7e1bb7ec57

View File

@@ -484,7 +484,13 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
if (mFaceProps == null || mFaceAuthSensorLocation == null) {
return null;
}
return new PointF(mFaceAuthSensorLocation.x, mFaceAuthSensorLocation.y);
DisplayInfo displayInfo = new DisplayInfo();
mContext.getDisplay().getDisplayInfo(displayInfo);
final float scaleFactor = android.util.DisplayUtils.getPhysicalPixelDisplaySizeRatio(
mStableDisplaySize.x, mStableDisplaySize.y, displayInfo.getNaturalWidth(),
displayInfo.getNaturalHeight());
return new PointF(mFaceAuthSensorLocation.x * scaleFactor,
mFaceAuthSensorLocation.y * scaleFactor);
}
/**