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

Commit 2515b733 authored by Dil3mm4's avatar Dil3mm4 Committed by LuK1337
Browse files

SystemUI: Don't shift KeyguardSecurityContainer when FOD isn't available

Tests:
    -removed enrolled fp, ensured keyguardsecuritycontainer wasn't shifed
    -removed enrolled fp, rebooted, ensured keyguardsecuritycontainer (on SIM PIN) wasn't shifted

Change-Id: Iccf469fa4fed79ff0edde014ba165eef6ee024e1
parent 46958986
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.app.AlertDialog;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.graphics.Insets;
import android.graphics.Rect;
@@ -79,6 +80,8 @@ import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.InjectionInflationController;

import lineageos.app.LineageContextConstants;

import java.util.List;

public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSecurityView {
@@ -124,6 +127,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
    private InjectionInflationController mInjectionInflationController;
    private boolean mSwipeUpToRetry;
    private AdminSecondaryLockScreenController mSecondaryLockScreenController;
    private boolean mHasFod;

    private final ViewConfiguration mViewConfiguration;
    private final SpringAnimation mSpringAnimation;
@@ -261,6 +265,10 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
        mKeyguardStateController = Dependency.get(KeyguardStateController.class);
        mSecondaryLockScreenController = new AdminSecondaryLockScreenController(context, this,
                mUpdateMonitor, mCallback, new Handler(Looper.myLooper()));

        PackageManager packageManager = mContext.getPackageManager();
        mHasFod = packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT) &&
                packageManager.hasSystemFeature(LineageContextConstants.Features.FOD);
    }

    public void setSecurityCallback(SecurityCallback callback) {
@@ -517,8 +525,9 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe

        // Consume bottom insets because we're setting the padding locally (for IME and navbar.)
        int inset;
        int minBottomMargin = getResources().getDimensionPixelSize(
                R.dimen.kg_security_container_min_bottom_margin);
        int minBottomMargin = mHasFod && mUpdateMonitor.isFingerprintDetectionRunning() ?
                getResources().getDimensionPixelSize(
                        R.dimen.kg_security_container_min_bottom_margin) : 0;

        if (sNewInsetsMode == NEW_INSETS_MODE_FULL) {
            int bottomInset = insets.getInsetsIgnoringVisibility(systemBars()).bottom;