Merge "AOD: Show fingerprint error messages"
This commit is contained in:
@@ -595,6 +595,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isScreenOn() {
|
||||
return mScreenOn;
|
||||
}
|
||||
|
||||
static class DisplayClientState {
|
||||
public int clientGeneration;
|
||||
public boolean clearing;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4322,6 +4322,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.
|
||||
|
||||
Reference in New Issue
Block a user