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

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

Merge "Add new method instead of exposing the udfpsRefreshRateCallback" into main

parents 7245b8fe f16219e8
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.doze.DozeReceiver;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.keyguard.data.repository.BiometricType;
import com.android.systemui.log.core.LogLevel;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.VibratorHelper;
import com.android.systemui.util.concurrency.DelayableExecutor;
@@ -156,7 +157,7 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks,
    @Nullable private UdfpsOverlayParams mUdfpsOverlayParams;
    @Nullable private IUdfpsRefreshRateRequestCallback mUdfpsRefreshRateRequestCallback;
    @Nullable private SideFpsController mSideFpsController;
    @Nullable private UdfpsLogger mUdfpsLogger;
    @NonNull private UdfpsLogger mUdfpsLogger;
    @VisibleForTesting IBiometricSysuiReceiver mReceiver;
    @VisibleForTesting @NonNull final BiometricDisplayListener mOrientationListener;
    @Nullable private final List<FaceSensorPropertiesInternal> mFaceProps;
@@ -926,6 +927,23 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks,
        return mUdfpsRefreshRateRequestCallback;
    }

    /**
     * Requests (or stops requesting) the max refresh rate. This can override user settings
     * for the max refresh rate.
     */
    public void requestMaxRefreshRate(boolean request) throws RemoteException {
        if (mUdfpsRefreshRateRequestCallback == null) {
            mUdfpsLogger.log(
                    "PreAuthRefreshRate",
                    "skip request - refreshRateCallback is null",
                    LogLevel.DEBUG
            );
            return;
        }
        mUdfpsLogger.requestMaxRefreshRate(request);
        mUdfpsRefreshRateRequestCallback.onAuthenticationPossible(mContext.getDisplayId(), request);
    }

    @Override
    public void showAuthenticationDialog(PromptInfo promptInfo, IBiometricSysuiReceiver receiver,
            int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation,
+4 −0
Original line number Diff line number Diff line
@@ -42,4 +42,8 @@ class UdfpsLogger @Inject constructor(@UdfpsLog private val logBuffer: LogBuffer
    fun log(tag: String, @CompileTimeConstant msg: String, level: LogLevel) {
        logBuffer.log(tag, level, msg)
    }

    fun requestMaxRefreshRate(request: Boolean) {
        logBuffer.log("RefreshRate", LogLevel.DEBUG, { bool1 = request }, { "Request max: $bool1" })
    }
}
+4 −1
Original line number Diff line number Diff line
@@ -355,7 +355,10 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
                    && !state.keyguardFadingAway && !state.keyguardGoingAway;
            if (onKeyguard
                    && mAuthController.isUdfpsEnrolled(mUserInteractor.get().getSelectedUserId())) {
                // both max and min display refresh rate must be set to take effect:
                // Requests the max refresh rate (ie: for smooth display). Note: By setting
                // the preferred refresh rates below, the refresh rate will not override the max
                // refresh rate in settings (ie: if smooth display is OFF).
                // Both max and min display refresh rate must be set to take effect:
                mLpChanged.preferredMaxDisplayRefreshRate = mKeyguardPreferredRefreshRate;
                mLpChanged.preferredMinDisplayRefreshRate = mKeyguardPreferredRefreshRate;
            } else {