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

Commit 25be6577 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Update DisabledUdfpsCtrl to LockIconViewController

Remove the old icon below the status bar on keyguard. Instead, a lock
icon will show beneath the notification shade for devices with either
udfps or face auth enrolled. All other devices will no longer have a
lock icon.

Test: manual, atest SystemUITests
Bug: 183910378
Change-Id: I7eebc363150641b4d63ee0f35b379d163e3a71d5
parent 9a5967ff
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -112,4 +112,9 @@
        android:layout_width="match_parent" />

    <include layout="@layout/status_bar_expanded_plugin_frame"/>

    <com.android.keyguard.LockIconView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/lock_icon_view" />
</com.android.systemui.statusbar.phone.NotificationPanelView>
+3 −13
Original line number Diff line number Diff line
@@ -72,23 +72,13 @@
        sysui:ignoreRightInset="true"
    />

    <LinearLayout
        android:id="@+id/lock_icon_container"
        android:orientation="vertical"
    <!-- Keyguard messages -->
    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/status_bar_height"
        android:layout_gravity="top|center_horizontal"
        android:gravity="center_horizontal">
        <com.android.systemui.statusbar.phone.LockIcon
            android:id="@+id/lock_icon"
            android:layout_width="@dimen/keyguard_lock_width"
            android:layout_height="@dimen/keyguard_lock_height"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="@dimen/keyguard_lock_padding"
            android:contentDescription="@string/accessibility_unlock_button"
            android:src="@*android:drawable/ic_lock"
            android:scaleType="center" />
        <com.android.keyguard.KeyguardMessageArea
            android:id="@+id/keyguard_message_area"
            style="@style/Keyguard.TextView"
@@ -99,7 +89,7 @@
            android:singleLine="true"
            android:ellipsize="marquee"
            android:focusable="true" />
    </LinearLayout>
    </FrameLayout>

    <com.android.systemui.biometrics.AuthRippleView
        android:id="@+id/auth_ripple"
+7 −0
Original line number Diff line number Diff line
@@ -649,4 +649,11 @@
        <!-- sensorLocationY -->
        <!--sensorRadius -->
    </integer-array>

    <!-- The properties of the lock icon in pixels. -->
    <integer-array name="config_lock_icon_props">
        <!-- X -->
        <!-- Y -->
        <!-- radius -->
    </integer-array>
</resources>
+15 −13
Original line number Diff line number Diff line
@@ -315,6 +315,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private boolean mLogoutEnabled;
    // cached value to avoid IPCs
    private boolean mIsUdfpsEnrolled;
    private boolean mIsFaceEnrolled;
    // If the user long pressed the lock icon, disabling face auth for the current session.
    private boolean mLockIconPressed;
    private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
@@ -1944,15 +1945,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId);
    }

    /**
     * Whether to show the lock icon on lock screen and bouncer.
     */
    public boolean canShowLockIcon() {
        if (mLockScreenMode == LOCK_SCREEN_MODE_LAYOUT_1) {
            return isFaceAuthEnabledForUser(KeyguardUpdateMonitor.getCurrentUser())
                    && !isUdfpsEnrolled();
        }
        return true;
    private void updateFaceEnrolled(int userId) {
        mIsFaceEnrolled = whitelistIpcs(
                () -> mFaceManager != null && mFaceManager.isHardwareDetected()
                        && mFaceManager.hasEnrolledTemplates(userId)
                        && mFaceSettingEnabledForUser.get(userId));
    }

    /**
@@ -1962,6 +1959,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        return mIsUdfpsEnrolled;
    }

    /**
     * @return true if there's at least one face enrolled
     */
    public boolean isFaceEnrolled() {
        return mIsFaceEnrolled;
    }

    private final UserSwitchObserver mUserSwitchObserver = new UserSwitchObserver() {
        @Override
        public void onUserSwitching(int newUserId, IRemoteCallback reply) {
@@ -2279,10 +2283,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
     * If face hardware is available, user has enrolled and enabled auth via setting.
     */
    public boolean isFaceAuthEnabledForUser(int userId) {
        // TODO(b/140034352)
        return whitelistIpcs(() -> mFaceManager != null && mFaceManager.isHardwareDetected()
                && mFaceManager.hasEnrolledTemplates(userId)
                && mFaceSettingEnabledForUser.get(userId));
        updateFaceEnrolled(userId);
        return mIsFaceEnrolled;
    }

    private void stopListeningForFingerprint() {
+1 −2
Original line number Diff line number Diff line
@@ -182,7 +182,6 @@ public interface KeyguardViewController {
     * @param container
     * @param notificationPanelViewController
     * @param biometricUnlockController
     * @param lockIconContainer
     * @param notificationContainer
     * @param bypassController
     */
@@ -190,6 +189,6 @@ public interface KeyguardViewController {
            ViewGroup container,
            NotificationPanelViewController notificationPanelViewController,
            BiometricUnlockController biometricUnlockController,
            ViewGroup lockIconContainer, View notificationContainer,
            View notificationContainer,
            KeyguardBypassController bypassController);
}
Loading