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

Commit 3bfa264f authored by Wu Ahan's avatar Wu Ahan Committed by Android (Google) Code Review
Browse files

Merge "Immediately invoke onFingerDown even if the screen is not ON" into main

parents d244a4f5 2e82f90d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.os.PowerManager;
import android.os.Trace;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.provider.Settings;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
@@ -920,12 +921,21 @@ public class UdfpsController implements DozeReceiver, Dumpable {
                    true /* isAod */);
        };

        if (mScreenOn) {
        if (isScreenOffUnlockEnabled() || mScreenOn) {
            mAodInterruptRunnable.run();
            mAodInterruptRunnable = null;
        }
    }

    private boolean isScreenOffUnlockEnabled() {
        return mContext.getResources().getBoolean(R.bool.config_screen_off_udfps_enabled)
                && Settings.Secure.getIntForUser(
                        mContext.getContentResolver(),
                        Settings.Secure.SCREEN_OFF_UNLOCK_UDFPS_ENABLED,
                        0,
                        mContext.getUserId()) != 0;
    }

    /**
     * Add a callback for fingerUp and fingerDown events
     */