diff options
author | 2019-05-30 18:26:54 -0700 | |
---|---|---|
committer | 2019-05-30 18:31:22 -0700 | |
commit | 71d2fb230e47f183ed0398cb2824b0b2a5610c45 (patch) | |
tree | 7b35e5418b26816a87515263282eeddbf92b9d30 | |
parent | a124cdd7cc6abb944818f37966788094607ddc67 (diff) |
Clearer scanning state and debug logs
Always show scanning state, even on lock screen.
Also added some logs to make it easier to debug face auth.
Fixes: 133342103
Fixes: 133873875
Test: logcat
Test: manual
Change-Id: I1e5c1825a3fc33b5c9862b4f72a7652a89779514
3 files changed, 11 insertions, 28 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 873874f30875..26d3d86778e4 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -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); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index 25bde3bbe2fa..812c1bb54472 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -741,13 +741,5 @@ public class KeyguardIndicationController implements StateListener, updateIndication(false); } } - - @Override - public void onKeyguardBouncerChanged(boolean bouncer) { - if (mLockIcon == null) { - return; - } - mLockIcon.setBouncerVisible(bouncer); - } - }; + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java index c7f778d37914..3143971241d8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java @@ -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(); |