diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index 630f1f43f8c75..d961263b50bf9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -24,7 +24,6 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; -import android.os.PowerManager; import android.os.UserHandle; import android.view.KeyEvent; import android.view.MotionEvent; @@ -43,7 +42,6 @@ import com.android.systemui.Dumpable; import com.android.systemui.animation.ActivityLaunchAnimator; import com.android.systemui.navigationbar.NavigationBarView; import com.android.systemui.plugins.ActivityStarter.OnDismissAction; -import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.qs.QSPanelController; import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.system.RemoteAnimationRunnerCompat; @@ -196,14 +194,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner { @Override Lifecycle getLifecycle(); - /** - * Wakes up the device if the device was dozing. - * - * @deprecated Use {@link PowerInteractor#wakeUpIfDozing(String, int)} instead. - */ - @Deprecated - void wakeUpIfDozing(long time, String why, @PowerManager.WakeReason int wakeReason); - /** */ ShadeViewController getShadeViewController(); 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 9bae739af32b8..4247c30788af0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -1597,24 +1597,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mCommandQueue.disable(mDisplayId, state1, state2, false /* animate */); } - /** - * Ask the display to wake up if currently dozing, else do nothing - * - * @deprecated Use {@link PowerInteractor#wakeUpIfDozing(String, int)} instead. - * - * @param time when to wake up - * @param why the reason for the wake up - */ - @Override - @Deprecated - public void wakeUpIfDozing(long time, String why, @PowerManager.WakeReason int wakeReason) { - if (mDozing && mScreenOffAnimationController.allowWakeUpIfDozing()) { - mPowerManager.wakeUp( - time, wakeReason, "com.android.systemui:" + why); - mFalsingCollector.onScreenOnFromTouch(); - } - } - // TODO(b/117478341): This was left such that CarStatusBar can override this method. // Try to remove this. protected void createNavigationBar(@Nullable RegisterStatusBarResult result) { @@ -2907,8 +2889,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mStatusBarHideIconsForBouncerManager.setBouncerShowingAndTriggerUpdate(bouncerShowing); mCommandQueue.recomputeDisableFlags(mDisplayId, true /* animate */); if (mBouncerShowing) { - wakeUpIfDozing(SystemClock.uptimeMillis(), "BOUNCER_VISIBLE", - PowerManager.WAKE_REASON_GESTURE); + mPowerInteractor.wakeUpIfDozing("BOUNCER_VISIBLE", PowerManager.WAKE_REASON_GESTURE); } updateScrimController(); if (!mBouncerShowing) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java index cc8324b220272..707b49c3ea960 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java @@ -29,7 +29,6 @@ import static junit.framework.TestCase.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.clearInvocations; @@ -1252,34 +1251,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase { verify(mStatusBarStateController).setState(SHADE); } - @Test - public void dozing_wakeUp() throws RemoteException { - // GIVEN can wakeup when dozing & is dozing - when(mScreenOffAnimationController.allowWakeUpIfDozing()).thenReturn(true); - setDozing(true); - - // WHEN wakeup is requested - final int wakeReason = PowerManager.WAKE_REASON_TAP; - mCentralSurfaces.wakeUpIfDozing(0, "", wakeReason); - - // THEN power manager receives wakeup - verify(mPowerManagerService).wakeUp(eq(0L), eq(wakeReason), anyString(), anyString()); - } - - @Test - public void notDozing_noWakeUp() throws RemoteException { - // GIVEN can wakeup when dozing and NOT dozing - when(mScreenOffAnimationController.allowWakeUpIfDozing()).thenReturn(true); - setDozing(false); - - // WHEN wakeup is requested - final int wakeReason = PowerManager.WAKE_REASON_TAP; - mCentralSurfaces.wakeUpIfDozing(0, "", wakeReason); - - // THEN power manager receives wakeup - verify(mPowerManagerService, never()).wakeUp(anyLong(), anyInt(), anyString(), anyString()); - } - @Test public void frpLockedDevice_shadeDisabled() { when(mDeviceProvisionedController.isFrpActive()).thenReturn(true);