From 44867425b0c099e8e44d2fbd5f628cf4b3e24839 Mon Sep 17 00:00:00 2001 From: Caitlin Shkuratov Date: Thu, 8 Jun 2023 13:45:19 +0000 Subject: [PATCH] [Central Surfaces] Make PulsingGestureListener a singleton. Bug: 277762009 Test: tap screen while on AOD -> verify device wakes to lockscreen Test: atest PulsingGestureListenerTest Change-Id: Iab8909c7898d7db89bb09bf6e8394e9d0981c66b --- .../src/com/android/systemui/shade/PulsingGestureListener.kt | 5 ++--- .../com/android/systemui/shade/PulsingGestureListenerTest.kt | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/PulsingGestureListener.kt b/packages/SystemUI/src/com/android/systemui/shade/PulsingGestureListener.kt index 9b797a7e2571d..ee4e98e094fcd 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/PulsingGestureListener.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/PulsingGestureListener.kt @@ -22,6 +22,7 @@ import android.provider.Settings import android.view.GestureDetector import android.view.MotionEvent import com.android.systemui.Dumpable +import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dock.DockManager import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.FalsingManager @@ -29,7 +30,6 @@ import com.android.systemui.plugins.FalsingManager.LOW_PENALTY import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.settings.UserTracker -import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent import com.android.systemui.tuner.TunerService import com.android.systemui.tuner.TunerService.Tunable import java.io.PrintWriter @@ -44,9 +44,8 @@ import javax.inject.Inject * screen is still ON and not in the true AoD display state. When the device is in the true AoD * display state, wake-ups are handled by [com.android.systemui.doze.DozeSensors]. */ -@CentralSurfacesComponent.CentralSurfacesScope +@SysUISingleton class PulsingGestureListener @Inject constructor( - private val notificationShadeWindowView: NotificationShadeWindowView, private val falsingManager: FalsingManager, private val dockManager: DockManager, private val powerInteractor: PowerInteractor, diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/PulsingGestureListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/PulsingGestureListenerTest.kt index f1d56f9e34808..a4fab1dbac575 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/PulsingGestureListenerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/PulsingGestureListenerTest.kt @@ -53,8 +53,6 @@ import org.mockito.Mockito.`when` as whenever @RunWithLooper(setAsMainLooper = true) @SmallTest class PulsingGestureListenerTest : SysuiTestCase() { - @Mock - private lateinit var view: NotificationShadeWindowView @Mock private lateinit var dockManager: DockManager @Mock @@ -87,7 +85,6 @@ class PulsingGestureListenerTest : SysuiTestCase() { powerRepository = FakePowerRepository() underTest = PulsingGestureListener( - view, falsingManager, dockManager, PowerInteractor(