From f65513aff50e57f43c3d618ad7e1eb838cd2ec4e Mon Sep 17 00:00:00 2001 From: Robert Snoeberger Date: Thu, 20 Jun 2019 10:40:13 -0400 Subject: [PATCH] Check for header when restoring default clock. This change tracks the state of the header in the smart space while a custom clock is showing so that the correct digital clock size can be restored when switching back to the default clock face. Fixes: 135534500 Test: visual - take phone of dock and check size of default clock Change-Id: Id4d1d46c94d8480f9675a3cf682a20a9706ba707 --- .../com/android/keyguard/KeyguardClockSwitch.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 3da969c8542e6..7ba2dfe2c3532 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -222,8 +222,13 @@ public class KeyguardClockSwitch extends RelativeLayout { mClockPlugin = null; } if (plugin == null) { - mClockView.setVisibility(View.VISIBLE); - mClockViewBold.setVisibility(View.INVISIBLE); + if (mShowingHeader) { + mClockView.setVisibility(View.GONE); + mClockViewBold.setVisibility(View.VISIBLE); + } else { + mClockView.setVisibility(View.VISIBLE); + mClockViewBold.setVisibility(View.INVISIBLE); + } mKeyguardStatusArea.setVisibility(View.VISIBLE); return; } @@ -401,10 +406,13 @@ public class KeyguardClockSwitch extends RelativeLayout { * these cases. */ void setKeyguardShowingHeader(boolean hasHeader) { - if (mShowingHeader == hasHeader || hasCustomClock()) { + if (mShowingHeader == hasHeader) { return; } mShowingHeader = hasHeader; + if (hasCustomClock()) { + return; + } float smallFontSize = mContext.getResources().getDimensionPixelSize( R.dimen.widget_small_font_size);