diff options
5 files changed, 9 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt b/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt index 4227a7a67330..b2680950d9c5 100644 --- a/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt +++ b/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt @@ -29,12 +29,14 @@ import android.util.Log import android.view.WindowManager import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.ActivityIntentHelper +import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.plugins.ActivityStarter import com.android.systemui.settings.UserTracker import com.android.systemui.shared.system.ActivityManagerKt.isInForeground import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.phone.CentralSurfaces +import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager import com.android.systemui.statusbar.policy.KeyguardStateController import java.util.concurrent.Executor import javax.inject.Inject @@ -43,10 +45,12 @@ import javax.inject.Inject * Helps with handling camera-related gestures (for example, double-tap the power button to launch * the camera). */ +@SysUISingleton class CameraGestureHelper @Inject constructor( private val context: Context, private val centralSurfaces: CentralSurfaces, private val keyguardStateController: KeyguardStateController, + private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager, private val packageManager: PackageManager, private val activityManager: ActivityManager, private val activityStarter: ActivityStarter, @@ -133,7 +137,7 @@ class CameraGestureHelper @Inject constructor( centralSurfaces.startLaunchTransitionTimeout() // Call this to make sure the keyguard is ready to be dismissed once the next intent is // handled by the OS (in our case it is the activity we started right above) - centralSurfaces.readyForKeyguardDone() + statusBarKeyguardViewManager.readyForKeyguardDone() } /** 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 6066a11867c4..32503208c599 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -243,8 +243,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner { @Deprecated float getDisplayHeight(); - void readyForKeyguardDone(); - void showKeyguard(); boolean hideKeyguard(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt index 7f4dcbb3725a..d9ba3a72c10b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt @@ -53,7 +53,6 @@ abstract class CentralSurfacesEmptyImpl : CentralSurfaces { override fun dump(pwOriginal: PrintWriter, args: Array<String>) {} override fun getDisplayWidth() = 0f override fun getDisplayHeight() = 0f - override fun readyForKeyguardDone() {} override fun showKeyguard() {} override fun hideKeyguard() = false override fun showKeyguardImpl() {} 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 e7a45b628937..eb3ece95b598 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -2061,11 +2061,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return mDisplay.getRotation(); } - @Override - public void readyForKeyguardDone() { - mStatusBarKeyguardViewManager.readyForKeyguardDone(); - } - private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/camera/CameraGestureHelperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/camera/CameraGestureHelperTest.kt index 937a7a92ec46..037c1badf0ac 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/camera/CameraGestureHelperTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/camera/CameraGestureHelperTest.kt @@ -31,6 +31,7 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.settings.UserTracker import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.phone.CentralSurfaces +import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.util.mockito.KotlinArgumentCaptor import com.android.systemui.util.mockito.eq @@ -55,6 +56,8 @@ class CameraGestureHelperTest : SysuiTestCase() { @Mock lateinit var centralSurfaces: CentralSurfaces @Mock + lateinit var statusBarKeyguardViewManager: StatusBarKeyguardViewManager + @Mock lateinit var keyguardStateController: KeyguardStateController @Mock lateinit var packageManager: PackageManager @@ -91,6 +94,7 @@ class CameraGestureHelperTest : SysuiTestCase() { context = mock(), centralSurfaces = centralSurfaces, keyguardStateController = keyguardStateController, + statusBarKeyguardViewManager = statusBarKeyguardViewManager, packageManager = packageManager, activityManager = activityManager, activityStarter = activityStarter, |