Merge "Switch mixed-up ScreenshotRequest parameters" into tm-qpr-dev am: b791973deb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20129610

Change-Id: I8bb2c671d7dbe3e9d8369562267d82141eef0ea0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Matt Casey
2022-10-13 18:46:55 +00:00
committed by Automerger Merge Worker
2 changed files with 3 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ class RequestProcessor @Inject constructor(
)
} else {
// Create a new request of the same type which includes the top component
ScreenshotRequest(request.source, request.type, info.component)
ScreenshotRequest(request.type, request.source, info.component)
}
}

View File

@@ -99,13 +99,14 @@ class RequestProcessorTest {
policy.getDefaultDisplayId(),
DisplayContentInfo(component, bounds, UserHandle.of(USER_ID), TASK_ID))
val request = ScreenshotRequest(TAKE_SCREENSHOT_FULLSCREEN, SCREENSHOT_KEY_CHORD)
val request = ScreenshotRequest(TAKE_SCREENSHOT_FULLSCREEN, SCREENSHOT_OTHER)
val processor = RequestProcessor(imageCapture, policy, flags, scope)
val processedRequest = processor.process(request)
// Request has topComponent added, but otherwise unchanged.
assertThat(processedRequest.type).isEqualTo(TAKE_SCREENSHOT_FULLSCREEN)
assertThat(processedRequest.source).isEqualTo(SCREENSHOT_OTHER)
assertThat(processedRequest.topComponent).isEqualTo(component)
}