Merge "Remove doze low light clock." into tm-qpr-dev am: 3b6bcc70c2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19535201

Change-Id: I6ba4dfa78ce042918332dcc78c611f1849d28261
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Darrell Shi
2022-09-06 19:00:16 +00:00
committed by Automerger Merge Worker
6 changed files with 0 additions and 125 deletions

View File

@@ -42,7 +42,6 @@ import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FlagsModule; import com.android.systemui.flags.FlagsModule;
import com.android.systemui.fragments.FragmentService; import com.android.systemui.fragments.FragmentService;
import com.android.systemui.log.dagger.LogModule; import com.android.systemui.log.dagger.LogModule;
import com.android.systemui.lowlightclock.LowLightClockController;
import com.android.systemui.media.dagger.MediaProjectionModule; import com.android.systemui.media.dagger.MediaProjectionModule;
import com.android.systemui.model.SysUiState; import com.android.systemui.model.SysUiState;
import com.android.systemui.navigationbar.NavigationBarComponent; 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.wallet.dagger.WalletModule;
import com.android.systemui.wmshell.BubblesManager; import com.android.systemui.wmshell.BubblesManager;
import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.bubbles.Bubbles;
import com.android.wm.shell.dagger.DynamicOverride;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
@@ -246,21 +244,6 @@ public abstract class SystemUIModule {
sysuiMainExecutor)); sysuiMainExecutor));
} }
@BindsOptionalOf
@DynamicOverride
abstract LowLightClockController optionalLowLightClockController();
@SysUISingleton
@Provides
static Optional<LowLightClockController> provideLowLightClockController(
@DynamicOverride Optional<LowLightClockController> optionalController) {
if (optionalController.isPresent() && optionalController.get().isLowLightClockEnabled()) {
return optionalController;
} else {
return Optional.empty();
}
}
@Binds @Binds
abstract FgsManagerController bindFgsManagerController(FgsManagerControllerImpl impl); abstract FgsManagerController bindFgsManagerController(FgsManagerControllerImpl impl);
} }

View File

@@ -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();
}

View File

@@ -34,7 +34,6 @@ import com.android.systemui.R;
import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dock.DockManager; import com.android.systemui.dock.DockManager;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.lowlightclock.LowLightClockController;
import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.DragDownHelper;
import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.LockscreenShadeTransitionController;
import com.android.systemui.statusbar.NotificationShadeDepthController; 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 com.android.systemui.statusbar.window.StatusBarWindowStateController;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Optional;
import javax.inject.Inject; import javax.inject.Inject;
@@ -88,7 +86,6 @@ public class NotificationShadeWindowViewController {
private final DockManager mDockManager; private final DockManager mDockManager;
private final NotificationPanelViewController mNotificationPanelViewController; private final NotificationPanelViewController mNotificationPanelViewController;
private final PanelExpansionStateManager mPanelExpansionStateManager; private final PanelExpansionStateManager mPanelExpansionStateManager;
private final Optional<LowLightClockController> mLowLightClockController;
private boolean mIsTrackingBarGesture = false; private boolean mIsTrackingBarGesture = false;
@@ -106,7 +103,6 @@ public class NotificationShadeWindowViewController {
StatusBarKeyguardViewManager statusBarKeyguardViewManager, StatusBarKeyguardViewManager statusBarKeyguardViewManager,
StatusBarWindowStateController statusBarWindowStateController, StatusBarWindowStateController statusBarWindowStateController,
LockIconViewController lockIconViewController, LockIconViewController lockIconViewController,
Optional<LowLightClockController> lowLightClockController,
CentralSurfaces centralSurfaces, CentralSurfaces centralSurfaces,
NotificationShadeWindowController controller, NotificationShadeWindowController controller,
KeyguardUnlockAnimationController keyguardUnlockAnimationController, KeyguardUnlockAnimationController keyguardUnlockAnimationController,
@@ -125,7 +121,6 @@ public class NotificationShadeWindowViewController {
mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
mStatusBarWindowStateController = statusBarWindowStateController; mStatusBarWindowStateController = statusBarWindowStateController;
mLockIconViewController = lockIconViewController; mLockIconViewController = lockIconViewController;
mLowLightClockController = lowLightClockController;
mService = centralSurfaces; mService = centralSurfaces;
mNotificationShadeWindowController = controller; mNotificationShadeWindowController = controller;
mKeyguardUnlockAnimationController = keyguardUnlockAnimationController; mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
@@ -148,8 +143,6 @@ public class NotificationShadeWindowViewController {
mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller); mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller);
mGestureDetector = new GestureDetector(mView.getContext(), mPulsingGestureListener); mGestureDetector = new GestureDetector(mView.getContext(), mPulsingGestureListener);
mLowLightClockController.ifPresent(controller -> controller.attachLowLightClockView(mView));
mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() { mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() {
@Override @Override
public Boolean handleDispatchTouchEvent(MotionEvent ev) { public Boolean handleDispatchTouchEvent(MotionEvent ev) {
@@ -434,21 +427,6 @@ public class NotificationShadeWindowViewController {
mStatusBarViewController = statusBarViewController; 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 @VisibleForTesting
void setDragDownHelper(DragDownHelper dragDownHelper) { void setDragDownHelper(DragDownHelper dragDownHelper) {
mDragDownHelper = dragDownHelper; mDragDownHelper = dragDownHelper;

View File

@@ -226,7 +226,6 @@ public final class DozeServiceHost implements DozeHost {
} }
mStatusBarStateController.setIsDozing(dozing); mStatusBarStateController.setIsDozing(dozing);
mNotificationShadeWindowViewController.setDozing(dozing);
if (mFoldAodAnimationController != null) { if (mFoldAodAnimationController != null) {
mFoldAodAnimationController.setIsDozing(dozing); mFoldAodAnimationController.setIsDozing(dozing);
} }
@@ -310,7 +309,6 @@ public final class DozeServiceHost implements DozeHost {
public void dozeTimeTick() { public void dozeTimeTick() {
mNotificationPanel.dozeTimeTick(); mNotificationPanel.dozeTimeTick();
mAuthController.dozeTimeTick(); mAuthController.dozeTimeTick();
mNotificationShadeWindowViewController.dozeTimeTick();
if (mAmbientIndicationContainer instanceof DozeReceiver) { if (mAmbientIndicationContainer instanceof DozeReceiver) {
((DozeReceiver) mAmbientIndicationContainer).dozeTimeTick(); ((DozeReceiver) mAmbientIndicationContainer).dozeTimeTick();
} }

View File

@@ -25,7 +25,6 @@ import com.android.systemui.SysuiTestCase
import com.android.systemui.classifier.FalsingCollectorFake import com.android.systemui.classifier.FalsingCollectorFake
import com.android.systemui.dock.DockManager import com.android.systemui.dock.DockManager
import com.android.systemui.keyguard.KeyguardUnlockAnimationController import com.android.systemui.keyguard.KeyguardUnlockAnimationController
import com.android.systemui.lowlightclock.LowLightClockController
import com.android.systemui.shade.NotificationShadeWindowView.InteractionEventHandler import com.android.systemui.shade.NotificationShadeWindowView.InteractionEventHandler
import com.android.systemui.statusbar.LockscreenShadeTransitionController import com.android.systemui.statusbar.LockscreenShadeTransitionController
import com.android.systemui.statusbar.NotificationShadeDepthController 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.phone.panelstate.PanelExpansionStateManager
import com.android.systemui.statusbar.window.StatusBarWindowStateController import com.android.systemui.statusbar.window.StatusBarWindowStateController
import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertThat
import java.util.Optional
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers
import org.mockito.Mock import org.mockito.Mock
import org.mockito.Mockito.anyFloat import org.mockito.Mockito.anyFloat
import org.mockito.Mockito.never import org.mockito.Mockito.never
@@ -87,8 +84,6 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() {
@Mock @Mock
private lateinit var phoneStatusBarViewController: PhoneStatusBarViewController private lateinit var phoneStatusBarViewController: PhoneStatusBarViewController
@Mock @Mock
private lateinit var lowLightClockController: LowLightClockController
@Mock
private lateinit var pulsingGestureListener: PulsingGestureListener private lateinit var pulsingGestureListener: PulsingGestureListener
private lateinit var interactionEventHandlerCaptor: ArgumentCaptor<InteractionEventHandler> private lateinit var interactionEventHandlerCaptor: ArgumentCaptor<InteractionEventHandler>
@@ -114,7 +109,6 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() {
statusBarKeyguardViewManager, statusBarKeyguardViewManager,
statusBarWindowStateController, statusBarWindowStateController,
lockIconViewController, lockIconViewController,
Optional.of(lowLightClockController),
centralSurfaces, centralSurfaces,
notificationShadeWindowController, notificationShadeWindowController,
keyguardUnlockAnimationController, keyguardUnlockAnimationController,
@@ -252,31 +246,6 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() {
verify(phoneStatusBarViewController).sendTouchToView(nextEvent) verify(phoneStatusBarViewController).sendTouchToView(nextEvent)
assertThat(returnVal).isTrue() 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) private val downEv = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)

View File

@@ -38,7 +38,6 @@ import com.android.systemui.SysuiTestCase;
import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.classifier.FalsingCollectorFake;
import com.android.systemui.dock.DockManager; import com.android.systemui.dock.DockManager;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController; import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.lowlightclock.LowLightClockController;
import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.DragDownHelper;
import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.LockscreenShadeTransitionController;
import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeDepthController;
@@ -61,8 +60,6 @@ import org.mockito.Captor;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import java.util.Optional;
@RunWith(AndroidTestingRunner.class) @RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper(setAsMainLooper = true) @TestableLooper.RunWithLooper(setAsMainLooper = true)
@SmallTest @SmallTest
@@ -86,7 +83,6 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase {
@Mock private StatusBarWindowStateController mStatusBarWindowStateController; @Mock private StatusBarWindowStateController mStatusBarWindowStateController;
@Mock private LockscreenShadeTransitionController mLockscreenShadeTransitionController; @Mock private LockscreenShadeTransitionController mLockscreenShadeTransitionController;
@Mock private LockIconViewController mLockIconViewController; @Mock private LockIconViewController mLockIconViewController;
@Mock private LowLightClockController mLowLightClockController;
@Mock private KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; @Mock private KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
@Mock private AmbientState mAmbientState; @Mock private AmbientState mAmbientState;
@Mock private PulsingGestureListener mPulsingGestureListener; @Mock private PulsingGestureListener mPulsingGestureListener;
@@ -121,7 +117,6 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase {
mStatusBarKeyguardViewManager, mStatusBarKeyguardViewManager,
mStatusBarWindowStateController, mStatusBarWindowStateController,
mLockIconViewController, mLockIconViewController,
Optional.of(mLowLightClockController),
mCentralSurfaces, mCentralSurfaces,
mNotificationShadeWindowController, mNotificationShadeWindowController,
mKeyguardUnlockAnimationController, mKeyguardUnlockAnimationController,