Skip to content

Commit

Permalink
Fix string interpolation in ViewCapture.generateBitmapFromPixelCopy
Browse files Browse the repository at this point in the history
In Kotlin string interpolation is done using `${}` not `$()`.

PiperOrigin-RevId: 674148086
  • Loading branch information
hoisie authored and copybara-androidxtest committed Sep 13, 2024
1 parent 67fa7cb commit 3f1565b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

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


**New Features**

Expand Down
4 changes: 3 additions & 1 deletion core/java/androidx/test/core/view/ViewCapture.kt
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ private suspend fun View.generateBitmapFromPixelCopy(
if (result.status == PixelCopy.SUCCESS) {
cont.resume(result.bitmap)
} else {
cont.resumeWithException(RuntimeException("PixelCopy failed: $(result.status)"))
cont.resumeWithException(
RuntimeException("PixelCopy failed with status code: ${result.status}")
)
}
}
PixelCopy.request(request, HandlerExecutor(handler), onCopyFinished)
Expand Down

0 comments on commit 3f1565b

Please sign in to comment.