diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 80d4a264cac87..1f58d4c55d1d0 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -595,6 +595,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } + public boolean isScreenOn() { + return mScreenOn; + } + static class DisplayClientState { public int clientGeneration; public boolean clearing; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java index d599ec1a20625..bc992d8219986 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java @@ -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); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 2b335f44b4855..8f63d45e04cd5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -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(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 5da3a101b4bb5..6da9e9022c884 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -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(); } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index cfbcf8c3d95b6..3d6e4b3cd3b58 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -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.