Skip to content

Commit 9b5c706

Browse files
hoisiecopybara-androidxtest
authored andcommitted
Fix string interpolation in ViewCapture.generateBitmapFromPixelCopy
In Kotlin string interpolation is done using `${}` not `$()`. PiperOrigin-RevId: 674459392
1 parent 67fa7cb commit 9b5c706

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
**Bug Fixes**
88
* Fix `Rect` handling in `ViewCapture` for SDK >= 34 for non root views.
9+
* Fix bug reporting the status code when PixelCopy fails in ViewCapture.generateBitmapFromPixelCopy.
10+
911

1012
**New Features**
1113

core/java/androidx/test/core/view/ViewCapture.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ private suspend fun View.generateBitmapFromPixelCopy(
313313
if (result.status == PixelCopy.SUCCESS) {
314314
cont.resume(result.bitmap)
315315
} else {
316-
cont.resumeWithException(RuntimeException("PixelCopy failed: $(result.status)"))
316+
cont.resumeWithException(
317+
RuntimeException("PixelCopy failed with status code: ${result.status}")
318+
)
317319
}
318320
}
319321
PixelCopy.request(request, HandlerExecutor(handler), onCopyFinished)

0 commit comments

Comments
 (0)