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

Commit e8bae628 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where a fingerprint animation was not running

Previously the fingerprint animation would not run
when we successfully unlocked with the fingerprint,
because we were checking for the wrong state.

Bug: 22483380
Change-Id: I8d3ec303a43323431b8866df29ddd6d668edc1ed
parent d3719ab0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -308,7 +308,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
    boolean showNextSecurityScreenOrFinish(boolean authenticated) {
        if (DEBUG) Log.d(TAG, "showNextSecurityScreenOrFinish(" + authenticated + ")");
        boolean finish = false;
        if (mUpdateMonitor.getUserHasTrust(KeyguardUpdateMonitor.getCurrentUser())) {
        if (mUpdateMonitor.getUserCanSkipBouncer(
                KeyguardUpdateMonitor.getCurrentUser())) {
            finish = true;
        } else if (SecurityMode.None == mCurrentSecuritySelection) {
            SecurityMode securityMode = mSecurityModel.getSecurityMode();
+5 −2
Original line number Diff line number Diff line
@@ -455,9 +455,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                    & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0;
    }

    public boolean getUserCanSkipBouncer(int userId) {
        return getUserHasTrust(userId) || mUserFingerprintAuthenticated.get(userId);
    }

    public boolean getUserHasTrust(int userId) {
        return !isTrustDisabled(userId) && mUserHasTrust.get(userId)
                || mUserFingerprintAuthenticated.get(userId);
        return !isTrustDisabled(userId) && mUserHasTrust.get(userId);
    }

    public boolean getUserTrustIsManaged(int userId) {
+2 −1
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ public class CastTile extends QSTile<QSTile.BooleanState> {

    @Override
    protected void handleUpdateState(BooleanState state, Object arg) {
        state.visible = !(mKeyguard.isSecure() && mKeyguard.isShowing() && !mKeyguard.isTrusted());
        state.visible = !mKeyguard.isSecure() || !mKeyguard.isShowing()
                || mKeyguard.canSkipBouncer();
        state.label = mContext.getString(R.string.quick_settings_cast_title);
        state.value = false;
        state.autoMirrorDrawable = false;
+2 −5
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.statusbar.phone;

import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.Application;
import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -30,8 +29,6 @@ import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.IBinder;
@@ -255,10 +252,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL

    private Intent getCameraIntent() {
        KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
        boolean currentUserHasTrust = updateMonitor.getUserHasTrust(
        boolean canSkipBouncer = updateMonitor.getUserCanSkipBouncer(
                KeyguardUpdateMonitor.getCurrentUser());
        boolean secure = mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser());
        return (secure && !currentUserHasTrust) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
        return (secure && !canSkipBouncer) ? SECURE_CAMERA_INTENT : INSECURE_CAMERA_INTENT;
    }

    private void updateCameraVisibility() {
+2 −2
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ public class LockIcon extends KeyguardAffordanceView {
        } else if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
            return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
        } else if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN
                && !mUnlockMethodCache.isCurrentlyInsecure()) {
                && !mUnlockMethodCache.isTrusted()) {
            return R.drawable.lockscreen_fingerprint_draw_off_animation;
        } else if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
            return R.drawable.lockscreen_fingerprint_draw_on_animation;
@@ -226,7 +226,7 @@ public class LockIcon extends KeyguardAffordanceView {
    private int getState() {
        boolean fingerprintRunning =
                KeyguardUpdateMonitor.getInstance(mContext).isFingerprintDetectionRunning();
        if (mUnlockMethodCache.isCurrentlyInsecure()) {
        if (mUnlockMethodCache.canSkipBouncer()) {
            return STATE_LOCK_OPEN;
        } else if (mTransientFpError) {
            return STATE_FINGERPRINT_ERROR;
Loading