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

Commit fa561d39 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Do not use stableDisplaySize for scale factor" into tm-qpr-dev

parents 668090c0 54a7b623
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -56,6 +56,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;
@@ -118,8 +119,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:
@@ -508,10 +507,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 {
@@ -768,7 +768,6 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba
                    mFingerprintAuthenticatorsRegisteredCallback);
        }

        mStableDisplaySize = mDisplayManager.getStableDisplaySize();
        mActivityTaskManager.registerTaskStackListener(mTaskStackListener);
        mOrientationListener.enable();
        updateSensorLocations();
@@ -1148,7 +1147,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);