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

Commit 2e82f90d authored by Wu Ahan's avatar Wu Ahan
Browse files

Immediately invoke onFingerDown even if the screen is not ON

Flag: EXEMPT bugfix
Bug: 397557151
Test: manually
Test: atest UdfpsControllerTest
Change-Id: If2ba1652fdc531bcb4dcc5b0a31b7c9a241c0a0d
parent f66a357b
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
     */