From 62df49271f809c72fba844c68a0a23cf4cbb14de Mon Sep 17 00:00:00 2001 From: Alejandro Nijamkin Date: Thu, 26 Jan 2023 16:36:41 -0800 Subject: [PATCH] Moves dump one level up for ClockEventController. We need that because registering it as a dumpable is not allowed after a separate instance of the same class has already been registered. We register a second instance when we set up the clock for the lock screen preview. Bug: 202758428 Test: manually verified that the associated CL for the same bug works now Change-Id: I7568f0c096e0f3759b3ee82347cfbda2f4d66132 --- .../src/com/android/keyguard/ClockEventController.kt | 10 ---------- .../keyguard/KeyguardClockSwitchController.java | 5 +++++ .../com/android/keyguard/ClockEventControllerTest.kt | 8 ++++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt b/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt index 1680b477c7cfd..3a940e95bd12f 100644 --- a/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt +++ b/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt @@ -54,7 +54,6 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.launch -import java.io.PrintWriter import java.util.Locale import java.util.TimeZone import java.util.concurrent.Executor @@ -309,15 +308,6 @@ open class ClockEventController @Inject constructor( resources.getDimensionPixelSize(R.dimen.large_clock_text_size).toFloat()) } - /** - * Dump information for debugging - */ - fun dump(pw: PrintWriter) { - pw.println(this) - clock?.dump(pw) - regionSampler?.dump(pw) - } - @VisibleForTesting internal fun listenForDozeAmount(scope: CoroutineScope): Job { return scope.launch { diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index 71cd18dd97033..5fb75db2a9708 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -45,6 +45,7 @@ import com.android.systemui.plugins.log.LogBuffer; import com.android.systemui.plugins.log.LogLevel; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.shared.clocks.ClockRegistry; +import com.android.systemui.shared.regionsampling.RegionSampler; import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController; import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.PropertyAnimator; @@ -424,6 +425,10 @@ public class KeyguardClockSwitchController extends ViewController