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

Commit ae1f829d authored by Sahil Sonar's avatar Sahil Sonar 💬 Committed by Nishith Khanna
Browse files

UdfpsController: Move HBM enable to dispatchOnUiReady()

  - Prevent momentary brightness spike.
parent 9a7ef9c0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {

    private final boolean mIsUdfpsNodeFeatureEnabled;
    private final List<String> mUdfpsSysfsNodePaths;
    private Handler mHandler;

    private void updateUdfpsNodes(String value) {
        if (!mIsUdfpsNodeFeatureEnabled) {
@@ -836,6 +837,7 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        mSessionTracker = sessionTracker;
        mDeviceEntryUdfpsTouchOverlayViewModel = deviceEntryUdfpsTouchOverlayViewModel;
        mDefaultUdfpsTouchOverlayViewModel = defaultUdfpsTouchOverlayViewModel;
        mHandler = new Handler(Looper.getMainLooper());

        mIsUdfpsNodeFeatureEnabled = mContext.getResources().getBoolean(
            com.android.systemui.res.R.bool.config_enableUdfpsSysfsNodes
@@ -1108,6 +1110,9 @@ public class UdfpsController implements DozeReceiver, Dumpable {
        mFingerprintManager.onUdfpsUiEvent(FingerprintManager.UDFPS_UI_READY, requestId,
                mSensorProps.sensorId);
        mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
        mHandler.postDelayed(() -> {
            updateUdfpsNodes("1");
        }, 50);
    }

    private void onFingerDown(
@@ -1168,8 +1173,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
                minor, major, orientation, time, gestureStart, isAod);
        Trace.endAsyncSection("UdfpsController.e2e.onPointerDown", 0);

        updateUdfpsNodes("1");

        final View view = mOverlay.getTouchOverlay();
        if (view != null && isOptical()) {
            if (mIgnoreRefreshRate) {