diff options
| author | 2023-08-29 13:09:48 -0400 | |
|---|---|---|
| committer | 2023-08-29 15:09:46 -0400 | |
| commit | 37bf7aba74260cd8a0578d475b9d74e1b046454b (patch) | |
| tree | 9587525adea5d107c66a76dfa6487ba060d3bac3 | |
| parent | 2e794c179f3f0a17ba4a73e6b7a32c13094c99c2 (diff) | |
Make NotificationShadeWindowViewController a Dumpable
Previously CentralSurfacesImpl called its dump method. It should
register itself and remove this dependency.
Bug: 277764509
Test: Manually confirmed it dumps
Change-Id: I76224aa7c04c8e07eecbc219252002c8c716633e
4 files changed, 54 insertions, 45 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java index 54b806dd8d19..0f85c7616071 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java @@ -35,6 +35,7 @@ import com.android.keyguard.AuthKeyguardMessageArea; import com.android.keyguard.KeyguardMessageAreaController; import com.android.keyguard.LockIconViewController; import com.android.keyguard.dagger.KeyguardBouncerComponent; +import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.back.domain.interactor.BackActionInteractor; import com.android.systemui.bouncer.domain.interactor.BouncerMessageInteractor; @@ -43,6 +44,7 @@ import com.android.systemui.bouncer.ui.viewmodel.KeyguardBouncerViewModel; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dock.DockManager; +import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyevent.domain.interactor.KeyEventInteractor; @@ -83,7 +85,7 @@ import javax.inject.Inject; * Controller for {@link NotificationShadeWindowView}. */ @SysUISingleton -public class NotificationShadeWindowViewController { +public class NotificationShadeWindowViewController implements Dumpable { private static final String TAG = "NotifShadeWindowVC"; private final FalsingCollector mFalsingCollector; private final SysuiStatusBarStateController mStatusBarStateController; @@ -166,6 +168,7 @@ public class NotificationShadeWindowViewController { NotificationInsetsController notificationInsetsController, AmbientState ambientState, ShadeLogger shadeLogger, + DumpManager dumpManager, PulsingGestureListener pulsingGestureListener, LockscreenHostedDreamGestureListener lockscreenHostedDreamGestureListener, KeyguardBouncerViewModel keyguardBouncerViewModel, @@ -235,6 +238,7 @@ public class NotificationShadeWindowViewController { } lockIconViewController.setLockIconView(mView.findViewById(R.id.lock_icon_view)); + dumpManager.registerDumpable(this); } /** @@ -542,6 +546,7 @@ public class NotificationShadeWindowViewController { mAmbientState.setSwipingUp(false); } + @Override public void dump(PrintWriter pw, String[] args) { pw.print(" mExpandAnimationRunning="); pw.println(mExpandAnimationRunning); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 605b3d23be2d..1c7c3107e4d3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -1947,8 +1947,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { pw.print(" mDozing="); pw.println(mDozing); pw.print(" mWallpaperSupported= "); pw.println(mWallpaperSupported); - pw.println(" ShadeWindowView: "); - getNotificationShadeWindowViewController().dump(pw, args); CentralSurfaces.dumpBarTransitions( pw, "PhoneStatusBarTransitions", mStatusBarTransitions); diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt index 2aea1f934fd0..39fe4989260e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt @@ -36,6 +36,7 @@ import com.android.systemui.bouncer.domain.interactor.CountDownTimerUtil import com.android.systemui.bouncer.ui.viewmodel.KeyguardBouncerViewModel import com.android.systemui.classifier.FalsingCollectorFake import com.android.systemui.dock.DockManager +import com.android.systemui.dump.DumpManager import com.android.systemui.dump.logcatLogBuffer import com.android.systemui.flags.FakeFeatureFlags import com.android.systemui.flags.Flags @@ -102,6 +103,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { @Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock private lateinit var keyguardUnlockAnimationController: KeyguardUnlockAnimationController @Mock private lateinit var shadeLogger: ShadeLogger + @Mock private lateinit var dumpManager: DumpManager @Mock private lateinit var ambientState: AmbientState @Mock private lateinit var keyguardBouncerViewModel: KeyguardBouncerViewModel @Mock private lateinit var stackScrollLayoutController: NotificationStackScrollLayoutController @@ -159,48 +161,49 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { fakeClock = FakeSystemClock() underTest = NotificationShadeWindowViewController( - lockscreenShadeTransitionController, - FalsingCollectorFake(), - sysuiStatusBarStateController, - dockManager, - notificationShadeDepthController, - view, - notificationPanelViewController, - ShadeExpansionStateManager(), - stackScrollLayoutController, - statusBarKeyguardViewManager, - statusBarWindowStateController, - lockIconViewController, - centralSurfaces, - dozeServiceHost, - dozeScrimController, - backActionInteractor, - powerInteractor, - notificationShadeWindowController, - unfoldTransitionProgressProvider, - keyguardUnlockAnimationController, - notificationInsetsController, - ambientState, - shadeLogger, - pulsingGestureListener, - mLockscreenHostedDreamGestureListener, - keyguardBouncerViewModel, - keyguardBouncerComponentFactory, - mock(KeyguardMessageAreaController.Factory::class.java), - keyguardTransitionInteractor, - primaryBouncerToGoneTransitionViewModel, - notificationExpansionRepository, - featureFlags, - fakeClock, - BouncerMessageInteractor( - FakeBouncerMessageRepository(), - mock(BouncerMessageFactory::class.java), - FakeUserRepository(), - CountDownTimerUtil(), - featureFlags - ), - BouncerLogger(logcatLogBuffer("BouncerLog")), - keyEventInteractor, + lockscreenShadeTransitionController, + FalsingCollectorFake(), + sysuiStatusBarStateController, + dockManager, + notificationShadeDepthController, + view, + notificationPanelViewController, + ShadeExpansionStateManager(), + stackScrollLayoutController, + statusBarKeyguardViewManager, + statusBarWindowStateController, + lockIconViewController, + centralSurfaces, + dozeServiceHost, + dozeScrimController, + backActionInteractor, + powerInteractor, + notificationShadeWindowController, + unfoldTransitionProgressProvider, + keyguardUnlockAnimationController, + notificationInsetsController, + ambientState, + shadeLogger, + dumpManager, + pulsingGestureListener, + mLockscreenHostedDreamGestureListener, + keyguardBouncerViewModel, + keyguardBouncerComponentFactory, + mock(KeyguardMessageAreaController.Factory::class.java), + keyguardTransitionInteractor, + primaryBouncerToGoneTransitionViewModel, + notificationExpansionRepository, + featureFlags, + fakeClock, + BouncerMessageInteractor( + FakeBouncerMessageRepository(), + mock(BouncerMessageFactory::class.java), + FakeUserRepository(), + CountDownTimerUtil(), + featureFlags + ), + BouncerLogger(logcatLogBuffer("BouncerLog")), + keyEventInteractor, ) underTest.setupExpandedStatusBar() diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt index 1ab613485c9c..3031658d3bcc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt @@ -35,6 +35,7 @@ import com.android.systemui.bouncer.domain.interactor.CountDownTimerUtil import com.android.systemui.bouncer.ui.viewmodel.KeyguardBouncerViewModel import com.android.systemui.classifier.FalsingCollectorFake import com.android.systemui.dock.DockManager +import com.android.systemui.dump.DumpManager import com.android.systemui.dump.logcatLogBuffer import com.android.systemui.flags.FakeFeatureFlags import com.android.systemui.flags.Flags @@ -111,6 +112,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() { @Mock private lateinit var keyguardUnlockAnimationController: KeyguardUnlockAnimationController @Mock private lateinit var ambientState: AmbientState @Mock private lateinit var shadeLogger: ShadeLogger + @Mock private lateinit var dumpManager: DumpManager @Mock private lateinit var pulsingGestureListener: PulsingGestureListener @Mock private lateinit var mLockscreenHostedDreamGestureListener: LockscreenHostedDreamGestureListener @@ -188,6 +190,7 @@ class NotificationShadeWindowViewTest : SysuiTestCase() { notificationInsetsController, ambientState, shadeLogger, + dumpManager, pulsingGestureListener, mLockscreenHostedDreamGestureListener, keyguardBouncerViewModel, |