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

Commit 91ba307d authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Show fingerprint error messages

Change-Id: I6570bffed1632b5e42ad5f82f7e0ab6192e04e1d
Fixes: 34902351
Test: Enable fingerprint, get notification on Ambient Display, try to unlock with wrong finger. Verify that the fingerprint not recognized message shows
parent 0bb70091
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -595,6 +595,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        }
    }

    public boolean isScreenOn() {
        return mScreenOn;
    }

    static class DisplayClientState {
        public int clientGeneration;
        public boolean clearing;
+22 −2
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public class KeyguardIndicationController {
    private KeyguardUpdateMonitorCallback mUpdateMonitor;

    private final DevicePolicyManager mDevicePolicyManager;
    private boolean mDozing;

    public KeyguardIndicationController(Context context, ViewGroup indicationArea,
            LockIcon lockIcon) {
@@ -139,7 +140,7 @@ public class KeyguardIndicationController {
            return;
        }

        if (mDevicePolicyManager.isDeviceManaged()) {
        if (!mDozing && mDevicePolicyManager.isDeviceManaged()) {
            final CharSequence organizationName =
                    mDevicePolicyManager.getDeviceOwnerOrganizationName();
            if (organizationName != null) {
@@ -224,6 +225,18 @@ public class KeyguardIndicationController {
        if (mVisible) {
            // Walk down a precedence-ordered list of what should indication
            // should be shown based on user or device state
            if (mDozing) {
                // If we're dozing, never show a persistent indication.
                if (!TextUtils.isEmpty(mTransientIndication)) {
                    mTextView.switchIndication(mTransientIndication);
                    mTextView.setTextColor(mTransientTextColor);

                } else {
                    mTextView.switchIndication(null);
                }
                return;
            }

            if (!mUserManager.isUserUnlocked(ActivityManager.getCurrentUser())) {
                mTextView.switchIndication(com.android.internal.R.string.lockscreen_storage_locked);
                mTextView.setTextColor(Color.WHITE);
@@ -319,6 +332,12 @@ public class KeyguardIndicationController {
        }
    };

    public void setDozing(boolean dozing) {
        mDozing = dozing;
        updateIndication();
        updateDisclosure();
    }

    protected class BaseKeyguardCallback extends KeyguardUpdateMonitorCallback {
        private int mLastSuccessiveErrorMessage = -1;

@@ -349,7 +368,8 @@ public class KeyguardIndicationController {
            int errorColor = mContext.getResources().getColor(R.color.system_warning_color, null);
            if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
                mStatusBarKeyguardViewManager.showBouncerMessage(helpString, errorColor);
            } else if (updateMonitor.isDeviceInteractive()) {
            } else if (updateMonitor.isDeviceInteractive()
                    || mDozing && updateMonitor.isScreenOn()) {
                mLockIcon.setTransientFpError(true);
                showTransientIndication(helpString, errorColor);
                mHandler.removeMessages(MSG_CLEAR_FP_MSG);
+19 −2
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
    private IntentButton mLeftPlugin;
    private String mLeftButtonStr;
    private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
    private boolean mDozing;

    public KeyguardBottomAreaView(Context context) {
        this(context, null);
@@ -361,7 +362,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
            // Things are not set up yet; reply hazy, ask again later
            return;
        }
        mRightAffordanceView.setVisibility(mRightButton.getIcon().isVisible
        mRightAffordanceView.setVisibility(!mDozing && mRightButton.getIcon().isVisible
                ? View.VISIBLE : View.GONE);
    }

@@ -375,7 +376,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL

    private void updateLeftAffordanceIcon() {
        IconState state = mLeftButton.getIcon();
        mLeftAffordanceView.setVisibility(state.isVisible ? View.VISIBLE : View.GONE);
        mLeftAffordanceView.setVisibility(!mDozing && state.isVisible ? View.VISIBLE : View.GONE);
        mLeftAffordanceView.setImageDrawable(state.drawable, state.tint);
        mLeftAffordanceView.setContentDescription(state.contentDescription);
    }
@@ -846,6 +847,22 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
        }
    };

    public void setDozing(boolean dozing, boolean animate) {
        mDozing = dozing;

        updateCameraVisibility();
        updateLeftAffordanceIcon();

        if (dozing) {
            mLockIcon.setVisibility(INVISIBLE);
        } else {
            mLockIcon.setVisibility(VISIBLE);
            if (animate) {
                startFinishDozeAnimation();
            }
        }
    }

    private class DefaultLeftButton implements IntentButton {

        private IconState mIconState = new IconState();
+3 −6
Original line number Diff line number Diff line
@@ -1151,9 +1151,7 @@ public class NotificationPanelView extends PanelView implements
                    .start();
        } else if (statusBarState == StatusBarState.KEYGUARD
                || statusBarState == StatusBarState.SHADE_LOCKED) {
            if (!mDozing) {
            mKeyguardBottomArea.setVisibility(View.VISIBLE);
            }
            mKeyguardBottomArea.setAlpha(1f);
        } else {
            mKeyguardBottomArea.setVisibility(View.GONE);
@@ -2103,13 +2101,12 @@ public class NotificationPanelView extends PanelView implements
    private void updateDozingVisibilities(boolean animate) {
        if (mDozing) {
            mKeyguardStatusBar.setVisibility(View.INVISIBLE);
            mKeyguardBottomArea.setVisibility(View.INVISIBLE);
            mKeyguardBottomArea.setDozing(mDozing, animate);
        } else {
            mKeyguardBottomArea.setVisibility(View.VISIBLE);
            mKeyguardStatusBar.setVisibility(View.VISIBLE);
            mKeyguardBottomArea.setDozing(mDozing, animate);
            if (animate) {
                animateKeyguardStatusBarIn(DOZE_ANIMATION_DURATION);
                mKeyguardBottomArea.startFinishDozeAnimation();
            }
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -4320,6 +4320,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        mNotificationPanel.setDozing(mDozing, animate);
        mStackScroller.setDark(mDozing, animate, mWakeUpTouchLocation);
        mScrimController.setDozing(mDozing);
        mKeyguardIndicationController.setDozing(mDozing);

        // Immediately abort the dozing from the doze scrim controller in case of wake-and-unlock
        // for pulsing so the Keyguard fade-out animation scrim can take over.