Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34fa71ff authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[CS] Have ActivityStarterImpl inject display ID directly.

These were the last usages of CentralSurfacesImpl#getDisplayId, so that
method is now removed.

Bug: 277764509
Bug: 277762009
Test: restart sysui while device unfolded > verified via logging that
CentralSurfacesImpl and ActivityStarterImpl have the same display ID.
Test: restart sysui while device folded > verified same
Test: long press on lockscreen > open "Customize lock screen" > verify
customizer opens with animation
Test: long press on QR code scanner lockscreen shortcut > verify QS code
scanner opens with animation
Test: atest ActivityStarterImplTest

Change-Id: Idb054b6bd010c2f2d984db2fd64199534c6c8fbe
parent 74f9052f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.systemui.animation.DelegateLaunchAnimatorController
import com.android.systemui.assist.AssistManager
import com.android.systemui.camera.CameraIntents.Companion.isInsecureCameraIntent
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.DisplayId
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.WakefulnessLifecycle
@@ -72,6 +73,7 @@ constructor(
    private val notifShadeWindowControllerLazy: Lazy<NotificationShadeWindowController>,
    private val activityLaunchAnimator: ActivityLaunchAnimator,
    private val context: Context,
    @DisplayId private val displayId: Int,
    private val lockScreenUserManager: NotificationLockscreenUserManager,
    private val statusBarWindowController: StatusBarWindowController,
    private val wakefulnessLifecycle: WakefulnessLifecycle,
@@ -471,9 +473,7 @@ constructor(
                    intent.getPackage()
                ) { adapter: RemoteAnimationAdapter? ->
                    val options =
                        ActivityOptions(
                            CentralSurfaces.getActivityOptions(centralSurfaces!!.displayId, adapter)
                        )
                        ActivityOptions(CentralSurfaces.getActivityOptions(displayId, adapter))

                    // We know that the intent of the caller is to dismiss the keyguard and
                    // this runnable is called right after the keyguard is solved, so we tell
@@ -596,7 +596,7 @@ constructor(
                                    val options =
                                        ActivityOptions(
                                            CentralSurfaces.getActivityOptions(
                                                centralSurfaces!!.displayId,
                                                displayId,
                                                animationAdapter
                                            )
                                        )
@@ -762,7 +762,7 @@ constructor(
                TaskStackBuilder.create(context)
                    .addNextIntent(intent)
                    .startActivities(
                        CentralSurfaces.getActivityOptions(centralSurfaces!!.displayId, adapter),
                        CentralSurfaces.getActivityOptions(displayId, adapter),
                        userHandle
                    )
            }
+0 −2
Original line number Diff line number Diff line
@@ -355,8 +355,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {

    void updateNotificationPanelTouchState();

    int getDisplayId();

    int getRotation();

    @VisibleForTesting
+0 −5
Original line number Diff line number Diff line
@@ -2097,11 +2097,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        return mDisplay.getRotation();
    }

    @Override
    public int getDisplayId() {
        return mDisplayId;
    }

    @Override
    public void readyForKeyguardDone() {
        mStatusBarKeyguardViewManager.readyForKeyguardDone();
+5 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ class ActivityStarterImplTest : SysuiTestCase() {
                Lazy { notifShadeWindowController },
                activityLaunchAnimator,
                context,
                DISPLAY_ID,
                lockScreenUserManager,
                statusBarWindowController,
                wakefulnessLifecycle,
@@ -274,4 +275,8 @@ class ActivityStarterImplTest : SysuiTestCase() {
        mainExecutor.runAllReady()
        verify(statusBarStateController).setLeaveOpenOnKeyguardHide(true)
    }

    private companion object {
        private const val DISPLAY_ID = 0
    }
}