Swtich to screenshot before trigger the desk launch

Bug: 400870600
Test: m
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Change-Id: I7a622a2fa865ddb26d902e0bf13f1e69257e2dfa
This commit is contained in:
minch
2025-03-28 22:21:00 +00:00
parent b5006ef5fb
commit 624f96dd72
2 changed files with 16 additions and 7 deletions
@@ -417,8 +417,22 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu
val endCallback = RunnableList()
val desktopController = recentsView.desktopRecentsController
checkNotNull(desktopController) { "recentsController is null" }
desktopController.launchDesktopFromRecents(this, animated) {
endCallback.executeAllAndDestroy()
val launchDesktopFromRecents = {
desktopController.launchDesktopFromRecents(this, animated) {
endCallback.executeAllAndDestroy()
}
}
if (enableMultipleDesktops(context) && desktopTask?.tasks?.isEmpty() == true) {
recentsView.switchToScreenshot {
recentsView.finishRecentsAnimation(
/* toRecents= */ true,
/* shouldPip= */ false,
launchDesktopFromRecents,
)
}
} else {
launchDesktopFromRecents()
}
Log.d(
TAG,
@@ -303,11 +303,6 @@ class RecentsViewUtils(private val recentsView: RecentsView<*, *>) : DesktopVisi
}
}
override fun onActiveDeskChanged(displayId: Int, newActiveDesk: Int, oldActiveDesk: Int) {
// TODO: b/400870600 - We may need to add code here to special case when an empty desk gets
// activated, since `RemoteDesktopLaunchTransitionRunner` doesn't always get triggered.
}
/**
* Gets the list of accessibility children. Currently all the children of RecentsViews are
* added, and in the reverse order to the list.