diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index a0ecd228edb44..318529b289ecb 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -42,7 +42,6 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FlagsModule; import com.android.systemui.fragments.FragmentService; import com.android.systemui.log.dagger.LogModule; -import com.android.systemui.lowlightclock.LowLightClockController; import com.android.systemui.media.dagger.MediaProjectionModule; import com.android.systemui.model.SysUiState; import com.android.systemui.navigationbar.NavigationBarComponent; @@ -94,7 +93,6 @@ import com.android.systemui.util.time.SystemClockImpl; import com.android.systemui.wallet.dagger.WalletModule; import com.android.systemui.wmshell.BubblesManager; import com.android.wm.shell.bubbles.Bubbles; -import com.android.wm.shell.dagger.DynamicOverride; import java.util.Optional; import java.util.concurrent.Executor; @@ -246,21 +244,6 @@ public abstract class SystemUIModule { sysuiMainExecutor)); } - @BindsOptionalOf - @DynamicOverride - abstract LowLightClockController optionalLowLightClockController(); - - @SysUISingleton - @Provides - static Optional provideLowLightClockController( - @DynamicOverride Optional optionalController) { - if (optionalController.isPresent() && optionalController.get().isLowLightClockEnabled()) { - return optionalController; - } else { - return Optional.empty(); - } - } - @Binds abstract FgsManagerController bindFgsManagerController(FgsManagerControllerImpl impl); } diff --git a/packages/SystemUI/src/com/android/systemui/lowlightclock/LowLightClockController.java b/packages/SystemUI/src/com/android/systemui/lowlightclock/LowLightClockController.java deleted file mode 100644 index 0b15f4f2feed0..0000000000000 --- a/packages/SystemUI/src/com/android/systemui/lowlightclock/LowLightClockController.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.systemui.lowlightclock; - -import android.view.ViewGroup; - -/** - * A controller responsible for attaching and showing an optional low-light clock while dozing. - */ -public interface LowLightClockController { - /** - * Returns {@code true} if the low-light clock is enabled. - */ - boolean isLowLightClockEnabled(); - - /** - * Attach the low light-clock to the given parent {@link ViewGroup}. - * @param parent The parent {@link ViewGroup} to which the low-light clock view should be - * attached. - */ - void attachLowLightClockView(ViewGroup parent); - - /** - * Show or hide the low-light clock. - * @param show Whether to show the low-light clock. - * @return {@code true} if the low-light clock was shown. - */ - boolean showLowLightClock(boolean show); - - /** - * An opportunity to perform burn-in prevention. - */ - void dozeTimeTick(); -} diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java index fec76b65dd093..e93f60596280b 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java @@ -34,7 +34,6 @@ import com.android.systemui.R; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.dock.DockManager; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; -import com.android.systemui.lowlightclock.LowLightClockController; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.NotificationShadeDepthController; @@ -51,7 +50,6 @@ import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManage import com.android.systemui.statusbar.window.StatusBarWindowStateController; import java.io.PrintWriter; -import java.util.Optional; import javax.inject.Inject; @@ -88,7 +86,6 @@ public class NotificationShadeWindowViewController { private final DockManager mDockManager; private final NotificationPanelViewController mNotificationPanelViewController; private final PanelExpansionStateManager mPanelExpansionStateManager; - private final Optional mLowLightClockController; private boolean mIsTrackingBarGesture = false; @@ -106,7 +103,6 @@ public class NotificationShadeWindowViewController { StatusBarKeyguardViewManager statusBarKeyguardViewManager, StatusBarWindowStateController statusBarWindowStateController, LockIconViewController lockIconViewController, - Optional lowLightClockController, CentralSurfaces centralSurfaces, NotificationShadeWindowController controller, KeyguardUnlockAnimationController keyguardUnlockAnimationController, @@ -125,7 +121,6 @@ public class NotificationShadeWindowViewController { mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mStatusBarWindowStateController = statusBarWindowStateController; mLockIconViewController = lockIconViewController; - mLowLightClockController = lowLightClockController; mService = centralSurfaces; mNotificationShadeWindowController = controller; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; @@ -148,8 +143,6 @@ public class NotificationShadeWindowViewController { mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller); mGestureDetector = new GestureDetector(mView.getContext(), mPulsingGestureListener); - mLowLightClockController.ifPresent(controller -> controller.attachLowLightClockView(mView)); - mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() { @Override public Boolean handleDispatchTouchEvent(MotionEvent ev) { @@ -434,21 +427,6 @@ public class NotificationShadeWindowViewController { mStatusBarViewController = statusBarViewController; } - /** - * Tell the controller that dozing has begun or ended. - * @param dozing True if dozing has begun. - */ - public void setDozing(boolean dozing) { - mLowLightClockController.ifPresent(controller -> controller.showLowLightClock(dozing)); - } - - /** - * Tell the controller to perform burn-in prevention. - */ - public void dozeTimeTick() { - mLowLightClockController.ifPresent(LowLightClockController::dozeTimeTick); - } - @VisibleForTesting void setDragDownHelper(DragDownHelper dragDownHelper) { mDragDownHelper = dragDownHelper; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java index 80c3e6ce989d2..ddff7d8e32af9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java @@ -226,7 +226,6 @@ public final class DozeServiceHost implements DozeHost { } mStatusBarStateController.setIsDozing(dozing); - mNotificationShadeWindowViewController.setDozing(dozing); if (mFoldAodAnimationController != null) { mFoldAodAnimationController.setIsDozing(dozing); } @@ -310,7 +309,6 @@ public final class DozeServiceHost implements DozeHost { public void dozeTimeTick() { mNotificationPanel.dozeTimeTick(); mAuthController.dozeTimeTick(); - mNotificationShadeWindowViewController.dozeTimeTick(); if (mAmbientIndicationContainer instanceof DozeReceiver) { ((DozeReceiver) mAmbientIndicationContainer).dozeTimeTick(); } 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 6d059b1cb7873..43fc8983011d4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt @@ -25,7 +25,6 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.classifier.FalsingCollectorFake import com.android.systemui.dock.DockManager import com.android.systemui.keyguard.KeyguardUnlockAnimationController -import com.android.systemui.lowlightclock.LowLightClockController import com.android.systemui.shade.NotificationShadeWindowView.InteractionEventHandler import com.android.systemui.statusbar.LockscreenShadeTransitionController import com.android.systemui.statusbar.NotificationShadeDepthController @@ -39,12 +38,10 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager import com.android.systemui.statusbar.window.StatusBarWindowStateController import com.google.common.truth.Truth.assertThat -import java.util.Optional import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor -import org.mockito.ArgumentMatchers import org.mockito.Mock import org.mockito.Mockito.anyFloat import org.mockito.Mockito.never @@ -87,8 +84,6 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { @Mock private lateinit var phoneStatusBarViewController: PhoneStatusBarViewController @Mock - private lateinit var lowLightClockController: LowLightClockController - @Mock private lateinit var pulsingGestureListener: PulsingGestureListener private lateinit var interactionEventHandlerCaptor: ArgumentCaptor @@ -114,7 +109,6 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { statusBarKeyguardViewManager, statusBarWindowStateController, lockIconViewController, - Optional.of(lowLightClockController), centralSurfaces, notificationShadeWindowController, keyguardUnlockAnimationController, @@ -252,31 +246,6 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { verify(phoneStatusBarViewController).sendTouchToView(nextEvent) assertThat(returnVal).isTrue() } - - @Test - fun testLowLightClockAttachedWhenExpandedStatusBarSetup() { - verify(lowLightClockController).attachLowLightClockView(ArgumentMatchers.any()) - } - - @Test - fun testLowLightClockShownWhenDozing() { - underTest.setDozing(true) - verify(lowLightClockController).showLowLightClock(true) - } - - @Test - fun testLowLightClockDozeTimeTickCalled() { - underTest.dozeTimeTick() - verify(lowLightClockController).dozeTimeTick() - } - - @Test - fun testLowLightClockHiddenWhenNotDozing() { - underTest.setDozing(true) - verify(lowLightClockController).showLowLightClock(true) - underTest.setDozing(false) - verify(lowLightClockController).showLowLightClock(false) - } } private val downEv = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0) diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java index 89a251808402c..001bfeeabe6f6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java @@ -38,7 +38,6 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.dock.DockManager; import com.android.systemui.keyguard.KeyguardUnlockAnimationController; -import com.android.systemui.lowlightclock.LowLightClockController; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.NotificationShadeDepthController; @@ -61,8 +60,6 @@ import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.util.Optional; - @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper(setAsMainLooper = true) @SmallTest @@ -86,7 +83,6 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase { @Mock private StatusBarWindowStateController mStatusBarWindowStateController; @Mock private LockscreenShadeTransitionController mLockscreenShadeTransitionController; @Mock private LockIconViewController mLockIconViewController; - @Mock private LowLightClockController mLowLightClockController; @Mock private KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; @Mock private AmbientState mAmbientState; @Mock private PulsingGestureListener mPulsingGestureListener; @@ -121,7 +117,6 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase { mStatusBarKeyguardViewManager, mStatusBarWindowStateController, mLockIconViewController, - Optional.of(mLowLightClockController), mCentralSurfaces, mNotificationShadeWindowController, mKeyguardUnlockAnimationController,