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

Commit f9f2ed0d authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Clearer scanning state and debug logs" into qt-r1-dev

am: 3f555e98

Change-Id: Ib1ec47752575f2cae1dda526039a643b25c8ab96
parents deeeea8f 3f555e98
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private static final String TAG = "KeyguardUpdateMonitor";
    private static final boolean DEBUG = KeyguardConstants.DEBUG;
    private static final boolean DEBUG_SIM_STATES = KeyguardConstants.DEBUG_SIM_STATES;
    private static final boolean DEBUG_FACE = true;
    private static final int LOW_BATTERY_THRESHOLD = 20;

    private static final String ACTION_FACE_UNLOCK_STARTED
@@ -182,6 +183,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
     * Prudently disable lockscreen.
     */
    public static final boolean CORE_APPS_ONLY;

    static {
        try {
            CORE_APPS_ONLY = IPackageManager.Stub.asInterface(
@@ -734,6 +736,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        if (acquireInfo != FaceManager.FACE_ACQUIRED_GOOD) {
            return;
        }
        if (DEBUG_FACE) Log.d(TAG, "Face acquired");
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
@@ -760,6 +763,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                Log.d(TAG, "Face authentication disabled by DPM for userId: " + userId);
                return;
            }
            if (DEBUG_FACE) Log.d(TAG, "Face auth succeeded for user " + userId);
            onFaceAuthenticated(userId);
        } finally {
            setFaceRunningState(BIOMETRIC_STATE_STOPPED);
@@ -768,6 +772,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    }

    private void handleFaceHelp(int msgId, String helpString) {
        if (DEBUG_FACE) Log.d(TAG, "Face help received: " + helpString);
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
@@ -786,6 +791,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    };

    private void handleFaceError(int msgId, String errString) {
        if (DEBUG_FACE) Log.d(TAG, "Face error received: " + errString);
        if (msgId == FaceManager.FACE_ERROR_CANCELED
                && mFaceRunningState == BIOMETRIC_STATE_CANCELLING_RESTARTING) {
            setFaceRunningState(BIOMETRIC_STATE_STOPPED);
+1 −9
Original line number Diff line number Diff line
@@ -741,13 +741,5 @@ public class KeyguardIndicationController implements StateListener,
                updateIndication(false);
            }
        }

        @Override
        public void onKeyguardBouncerChanged(boolean bouncer) {
            if (mLockIcon == null) {
                return;
    }
            mLockIcon.setBouncerVisible(bouncer);
        }
    };
}
+4 −19
Original line number Diff line number Diff line
@@ -90,11 +90,9 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    private int mDensity;
    private boolean mPulsing;
    private boolean mDozing;
    private boolean mBouncerVisible;
    private boolean mDocked;
    private boolean mLastDozing;
    private boolean mLastPulsing;
    private boolean mLastBouncerVisible;
    private int mIconColor;
    private float mDozeAmount;
    private int mIconRes;
@@ -252,9 +250,9 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        int state = getState();
        mIsFaceUnlockState = state == STATE_SCANNING_FACE;
        if (state != mLastState || mLastDozing != mDozing || mLastPulsing != mPulsing
                || mLastScreenOn != mScreenOn || mLastBouncerVisible != mBouncerVisible || force) {
                || mLastScreenOn != mScreenOn || force) {
            @LockAnimIndex final int lockAnimIndex = getAnimationIndexForTransition(mLastState,
                    state, mLastPulsing, mPulsing, mLastDozing, mDozing, mBouncerVisible);
                    state, mLastPulsing, mPulsing, mLastDozing, mDozing);
            boolean isAnim = lockAnimIndex != -1;

            int iconRes = isAnim ? getThemedAnimationResId(lockAnimIndex) : getIconForState(state);
@@ -302,7 +300,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
            mLastScreenOn = mScreenOn;
            mLastDozing = mDozing;
            mLastPulsing = mPulsing;
            mLastBouncerVisible = mBouncerVisible;
        }

        boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked);
@@ -371,8 +368,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
    }

    private int getAnimationIndexForTransition(int oldState, int newState,
            boolean wasPulsing, boolean pulsing, boolean wasDozing, boolean dozing,
            boolean bouncerVisible) {
            boolean wasPulsing, boolean pulsing, boolean wasDozing, boolean dozing) {

        // Never animate when screen is off
        if (dozing && !pulsing && !mWasPulsingOnThisFrame) {
@@ -391,7 +387,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
            return UNLOCK;
        } else if (justLocked) {
            return LOCK;
        } else if (newState == STATE_SCANNING_FACE && bouncerVisible) {
        } else if (newState == STATE_SCANNING_FACE) {
            return SCANNING;
        } else if ((nowPulsing || turningOn) && newState != STATE_LOCK_OPEN) {
            return LOCK_IN;
@@ -496,17 +492,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
        setImageTintList(ColorStateList.valueOf(color));
    }

    /**
     * If bouncer is visible or not.
     */
    public void setBouncerVisible(boolean bouncerVisible) {
        if (mBouncerVisible == bouncerVisible) {
            return;
        }
        mBouncerVisible = bouncerVisible;
        update();
    }

    @Override
    public void onDensityOrFontScaleChanged() {
        ViewGroup.LayoutParams lp = getLayoutParams();