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

Commit 43921e4c authored by Beverly's avatar Beverly
Browse files

Recalculate max # notifs on keyguard w/ udfps

- By default, show the new lockscreen on devices that have UDFPS
- Hide lock icon if UDFPS is on the device (eventually isUdfpsEnrolled
should check enrollment)
- Don't take into account the lock icon when calculating the clock
position top padding in the KeyguardClockPositionAlgorithm

Bug: 165260390
Test: atest SystemUITests
Change-Id: Ia3c644256a8901144ebc6362df4d9585a6a29165
parent 8c95a519
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@
            android:id="@+id/gradient_clock_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="100dp"
            android:textSize="80dp"
            android:letterSpacing="0.02"
            android:lineSpacingMultiplier=".8"
            android:includeFontPadding="false"
+6 −2
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ import com.android.settingslib.fuelgauge.BatteryStatus;
import com.android.systemui.DejankUtils;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
@@ -235,6 +236,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private final Context mContext;
    private final boolean mIsPrimaryUser;
    private final boolean mIsAutomotive;
    private final AuthController mAuthController;
    private final StatusBarStateController mStatusBarStateController;
    HashMap<Integer, SimData> mSimDatas = new HashMap<>();
    HashMap<Integer, ServiceState> mServiceStates = new HashMap<Integer, ServiceState>();
@@ -1581,7 +1583,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            RingerModeTracker ringerModeTracker,
            @Background Executor backgroundExecutor,
            StatusBarStateController statusBarStateController,
            LockPatternUtils lockPatternUtils) {
            LockPatternUtils lockPatternUtils,
            AuthController authController) {
        mContext = context;
        mSubscriptionManager = SubscriptionManager.from(context);
        mDeviceProvisioned = isDeviceProvisionedInSettingsDb();
@@ -1591,6 +1594,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        mRingerModeTracker = ringerModeTracker;
        mStatusBarStateController = statusBarStateController;
        mLockPatternUtils = lockPatternUtils;
        mAuthController = authController;
        dumpManager.registerDumpable(getClass().getName(), this);

        mHandler = new Handler(mainLooper) {
@@ -1853,7 +1857,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab

    private void updateLockScreenMode() {
        mLockScreenMode = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_NEW_LOCKSCREEN, 0);
                Settings.Global.SHOW_NEW_LOCKSCREEN, mAuthController.isUdfpsEnrolled() ? 1 : 0);
    }

    private final UserSwitchObserver mUserSwitchObserver = new UserSwitchObserver() {
+9 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.graphics.RectF;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricPrompt;
import android.hardware.biometrics.IBiometricSysuiReceiver;
@@ -242,6 +243,13 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
        }
    }

    /**
     * @return where the UDFPS exists on the screen in pixels.
     */
    public RectF getUdfpsRegion() {
        return mUdfpsController == null ? null : mUdfpsController.getSensorLocation();
    }

    /**
     * Requests fingerprint scan.
     *
@@ -475,7 +483,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
   /**
     * Whether the current user has a UDFP enrolled.
     */
    public boolean hasUdfpsEnrolled() {
    public boolean isUdfpsEnrolled() {
        // TODO: (b/171392825) right now only checks whether the UDFPS sensor exists on this device
        //  but not whether user has enrolled or not
        return mUdfpsController != null;
+8 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.RectF;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.hardware.fingerprint.IUdfpsOverlayController;
@@ -244,6 +245,13 @@ class UdfpsController implements DozeReceiver {
        mView.dozeTimeTick();
    }

    /**
     * @return where the UDFPS exists on the screen in pixels.
     */
    public RectF getSensorLocation() {
        return mView.getSensorRect();
    }

    private void setShowOverlay(boolean show) {
        if (show == mIsOverlayRequested) {
            return;
+4 −0
Original line number Diff line number Diff line
@@ -196,6 +196,10 @@ public class UdfpsView extends View implements DozeReceiver,
        canvas.restore();
    }

    RectF getSensorRect() {
        return new RectF(mSensorRect);
    }

    void setHbmSupported(boolean hbmSupported) {
        mHbmSupported = hbmSupported;
    }
Loading