From 460d897c3fdaffb53f590064bbcd707603a2d56f Mon Sep 17 00:00:00 2001 From: Hawkwood Glazier Date: Thu, 29 Dec 2022 19:17:08 +0000 Subject: [PATCH] Add logging to KeyguardVisibilityHelper This also cleans up an edge case where VISIBLE isn't always set to the view by the callback runnable. This shouldn't be nessecary though and shouldn't cause a user-facing change. Bug: 262112441 Test: Manually checked the transitions Change-Id: I9b275720ad8b7a108328197833b12efd6951371a --- .../KeyguardStatusViewController.java | 7 +++-- .../keyguard/KeyguardVisibilityHelper.java | 31 ++++++++++++++++++- .../keyguard/logging/KeyguardLogger.kt | 2 +- .../KeyguardQsUserSwitchController.java | 2 +- .../KeyguardUserSwitcherController.java | 2 +- .../KeyguardStatusViewControllerTest.java | 6 +++- 6 files changed, 43 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java index aec30632c41e6..b53b868025e82 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java @@ -20,6 +20,7 @@ import android.graphics.Rect; import android.util.Slog; import com.android.keyguard.KeyguardClockSwitch.ClockSize; +import com.android.keyguard.logging.KeyguardLogger; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.plugins.ClockAnimations; @@ -62,14 +63,16 @@ public class KeyguardStatusViewController extends ViewController { mKeyguardViewVisibilityAnimating = false; mView.setVisibility(View.INVISIBLE); + log("Callback Set Visibility to INVISIBLE"); }; private final Runnable mAnimateKeyguardStatusViewGoneEndRunnable = () -> { mKeyguardViewVisibilityAnimating = false; mView.setVisibility(View.GONE); + log("CallbackSet Visibility to GONE"); }; private final Runnable mAnimateKeyguardStatusViewVisibleEndRunnable = () -> { mKeyguardViewVisibilityAnimating = false; + mView.setVisibility(View.VISIBLE); + log("Callback Set Visibility to VISIBLE"); }; } diff --git a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardLogger.kt b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardLogger.kt index b84fb08d53a8d..b106fec11eb5e 100644 --- a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardLogger.kt +++ b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardLogger.kt @@ -34,7 +34,7 @@ private const val TAG = "KeyguardLog" * temporary logs or logs for smaller classes when creating whole new [LogBuffer] wrapper might be * an overkill. */ -class KeyguardLogger @Inject constructor(@KeyguardLog private val buffer: LogBuffer) : +class KeyguardLogger @Inject constructor(@KeyguardLog val buffer: LogBuffer) : ConstantStringsLogger by ConstantStringsLoggerImpl(buffer, TAG) { fun logException(ex: Exception, @CompileTimeConstant logMsg: String) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java index f63d65246d9b7..c8ee647cf8a84 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java @@ -160,7 +160,7 @@ public class KeyguardQsUserSwitchController extends ViewController mStatusBarStateController = statusBarStateController; mKeyguardVisibilityHelper = new KeyguardVisibilityHelper(mView, keyguardStateController, dozeParameters, - screenOffAnimationController, /* animateYPos= */ false); + screenOffAnimationController, /* animateYPos= */ false, /* logBuffer= */ null); mUserSwitchDialogController = userSwitchDialogController; mUiEventLogger = uiEventLogger; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java index c1506541229d1..e9f0dcb4eb51a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherController.java @@ -173,7 +173,7 @@ public class KeyguardUserSwitcherController extends ViewController mKeyguardUpdateMonitorCallbackCaptor; + @Mock + KeyguardLogger mKeyguardLogger; private KeyguardStatusViewController mController; @@ -81,7 +84,8 @@ public class KeyguardStatusViewControllerTest extends SysuiTestCase { mConfigurationController, mDozeParameters, mFeatureFlags, - mScreenOffAnimationController); + mScreenOffAnimationController, + mKeyguardLogger); } @Test