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

Commit 4456fb95 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Do not use stableDisplaySize for scale factor" into tm-qpr-dev am: fa561d39 am: 88d4577e

parents dc59d4e4 88d4577e
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserManager;
import android.util.DisplayUtils;
import android.util.Log;
import android.util.RotationUtils;
import android.util.SparseBooleanArray;
@@ -120,8 +121,6 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
    private final Provider<UdfpsController> mUdfpsControllerFactory;
    private final Provider<SidefpsController> mSidefpsControllerFactory;

    @NonNull private Point mStableDisplaySize = new Point();

    private final Display mDisplay;
    private float mScaleFactor = 1f;
    // sensor locations without any resolution scaling nor rotation adjustments:
@@ -531,10 +530,11 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
     */
    private void updateSensorLocations() {
        mDisplay.getDisplayInfo(mCachedDisplayInfo);

        final Display.Mode maxDisplayMode =
                DisplayUtils.getMaximumResolutionDisplayMode(mCachedDisplayInfo.supportedModes);
        final float scaleFactor = android.util.DisplayUtils.getPhysicalPixelDisplaySizeRatio(
                mStableDisplaySize.x, mStableDisplaySize.y, mCachedDisplayInfo.getNaturalWidth(),
                mCachedDisplayInfo.getNaturalHeight());
                maxDisplayMode.getPhysicalWidth(), maxDisplayMode.getPhysicalHeight(),
                mCachedDisplayInfo.getNaturalWidth(), mCachedDisplayInfo.getNaturalHeight());
        if (scaleFactor == Float.POSITIVE_INFINITY) {
            mScaleFactor = 1f;
        } else {
@@ -812,7 +812,6 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
            );
        }

        mStableDisplaySize = mDisplayManager.getStableDisplaySize();
        mActivityTaskManager.registerTaskStackListener(mTaskStackListener);
        mOrientationListener.enable();
        updateSensorLocations();
@@ -1196,7 +1195,6 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
    @Override
    public void dump(@NonNull PrintWriter pw, @NonNull String[] args) {
        final AuthDialog dialog = mCurrentDialog;
        pw.println("  stableDisplaySize=" + mStableDisplaySize);
        pw.println("  mCachedDisplayInfo=" + mCachedDisplayInfo);
        pw.println("  mScaleFactor=" + mScaleFactor);
        pw.println("  faceAuthSensorLocationDefault=" + mFaceSensorLocationDefault);