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

Commit d7bde7e3 authored by TheScarastic's avatar TheScarastic Committed by Łukasz Patron
Browse files

Don't start fingerprint for FOD devices early

commit 5cece533 causes fingerprint to start early
while going to sleep and this is not the expected behaviour for devices
with FOD since we have to apply DIM and HBM simultaneously which causes
device to give flicker effect while putting phone to sleep.

Change-Id: I67b4cdbc92556b54c6e865f2332732a35f2eec57
parent 42bf6752
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
import android.hardware.biometrics.BiometricSourceType;
import android.media.AudioAttributes;
@@ -100,6 +101,8 @@ import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.util.DeviceConfigProxy;
import com.android.systemui.util.InjectionInflationController;

import lineageos.app.LineageContextConstants;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -380,6 +383,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable {
    private IKeyguardDrawnCallback mDrawnCallback;
    private CharSequence mCustomMessage;

    private boolean mHasFod;

    private final DeviceConfig.OnPropertiesChangedListener mOnPropertiesChangedListener =
            new DeviceConfig.OnPropertiesChangedListener() {
            @Override
@@ -748,6 +753,8 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable {
                QuickStepContract.isGesturalMode(navigationModeController.addListener(mode -> {
                    mInGestureNavigationMode = QuickStepContract.isGesturalMode(mode);
                }));
        PackageManager packageManager = context.getPackageManager();
        mHasFod = packageManager.hasSystemFeature(LineageContextConstants.Features.FOD);
    }

    public void userActivity() {
@@ -878,7 +885,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable {
            // explicitly DO NOT want to call
            // mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false)
            // here, since that will mess with the device lock state.
            if (!mHasFod) {
                mUpdateMonitor.dispatchKeyguardGoingAway(false);
            }

            // Lock immediately based on setting if secure (user has a pin/pattern/password).
            // This also "locks" the device when not secure to provide easy access to the