Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38950d4b authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Apply padding for UDFPS x/y location when rotated

The padding was taken into account for portrait orientation, but
not updated for rotated orientations

Bug: 179083247
Bug: 177965281

Test: manual
Change-Id: Ibac3c8dda63485ec779f6c2208890274b0f355ce
parent ca389a64
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -260,15 +260,17 @@ public class UdfpsController implements DozeReceiver, HbmCallback {
        // Transform dimensions if the device is in landscape mode.
        // Transform dimensions if the device is in landscape mode.
        switch (mContext.getDisplay().getRotation()) {
        switch (mContext.getDisplay().getRotation()) {
            case Surface.ROTATION_90:
            case Surface.ROTATION_90:
                mCoreLayoutParams.x = mSensorProps.sensorLocationY - mSensorProps.sensorRadius;
                mCoreLayoutParams.x = mSensorProps.sensorLocationY - mSensorProps.sensorRadius
                mCoreLayoutParams.y =
                        - paddingX;
                        p.y - mSensorProps.sensorLocationX - mSensorProps.sensorRadius;
                mCoreLayoutParams.y = p.y - mSensorProps.sensorLocationX - mSensorProps.sensorRadius
                        - paddingY;
                break;
                break;


            case Surface.ROTATION_270:
            case Surface.ROTATION_270:
                mCoreLayoutParams.x =
                mCoreLayoutParams.x = p.x - mSensorProps.sensorLocationY - mSensorProps.sensorRadius
                        p.x - mSensorProps.sensorLocationY - mSensorProps.sensorRadius;
                        - paddingX;
                mCoreLayoutParams.y = mSensorProps.sensorLocationX - mSensorProps.sensorRadius;
                mCoreLayoutParams.y = mSensorProps.sensorLocationX - mSensorProps.sensorRadius
                        - paddingY;
                break;
                break;


            default:
            default: