Skip to content

Commit 8a7c5ed

Browse files
committed
Use the provided display number for screenshots
The screenshot host orchestrator endpoint accepts a display number as part of the request, but was not used when handling the request. Bug: b/438557268
1 parent 749da85 commit 8a7c5ed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

frontend/src/host_orchestrator/orchestrator/displayscreenshotaction.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ type DisplayScreenshotActionOpts struct {
3838
type DisplayScreenshotAction struct {
3939
req *apiv1.DisplayScreenshotRequest
4040
selector cvd.InstanceSelector
41-
paths IMPaths
4241
om OperationManager
4342
cvdCLI *cvd.CLI
4443
}
@@ -47,7 +46,6 @@ func NewDisplayScreenshotAction(opts DisplayScreenshotActionOpts) *DisplayScreen
4746
return &DisplayScreenshotAction{
4847
req: opts.Request,
4948
selector: opts.Selector,
50-
paths: opts.Paths,
5149
om: opts.OperationManager,
5250
cvdCLI: cvd.NewCLI(opts.ExecContext),
5351
}
@@ -75,7 +73,7 @@ func (a *DisplayScreenshotAction) createScreenshot(op apiv1.Operation) (*apiv1.D
7573

7674
screenshotPath := filepath.Join(tempdir, "screenshot.png")
7775

78-
if err := a.cvdCLI.LazySelectInstance(a.selector).Screenshot(0, screenshotPath); err != nil {
76+
if err := a.cvdCLI.LazySelectInstance(a.selector).Screenshot(a.req.DisplayNumber, screenshotPath); err != nil {
7977
return nil, operator.NewInternalError("cvd display screenshot failed", err)
8078
}
8179

0 commit comments

Comments
 (0)