[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
This commit is contained in:
Caitlin Shkuratov
2023-07-10 18:03:36 +00:00
parent 74f9052fc5
commit 34fa71ff41
4 changed files with 10 additions and 12 deletions

View File

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

View File

@@ -355,8 +355,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {
void updateNotificationPanelTouchState();
int getDisplayId();
int getRotation();
@VisibleForTesting

View File

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

View File

@@ -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
}
}