Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ The changes documented here do not include those from the original repository.

## [Unreleased]

### 01-12-2026
### 2026-12-02
- Fix: avoid a crash when the scan parameters are missing from the scanner activity's intent; the scan now fails with the "Scanning parameters are invalid" error instead of a generic scanning error (https://github.com/OutSystems/OSBarcodeLib-Android/pull/58).

### 2026-12-01
- Fix: torch, zoom and scanning state are kept when the screen rotates, and the camera permission is no longer requested again on rotation (https://outsystemsrd.atlassian.net/browse/RMET-4398).

## [2.1.2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class OSBARCController {
onError(OSBARCError.ZXING_LIBRARY_ERROR)
OSBARCError.MLKIT_LIBRARY_ERROR.code ->
onError(OSBARCError.MLKIT_LIBRARY_ERROR)
OSBARCError.INVALID_PARAMETERS_ERROR.code ->
onError(OSBARCError.INVALID_PARAMETERS_ERROR)
else -> {
Log.d(LOG_TAG, "Invalid result code")
onError(OSBARCError.SCANNING_GENERAL_ERROR)
Expand Down
14 changes: 14 additions & 0 deletions src/test/kotlin/com/outsystems/plugins/barcode/ScanCodeTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,20 @@ class ScanCodeTests {
)
}

@Test
fun givenInvalidParametersResultCodeWhenHandleScanResultThenInvalidParametersError() {
val barcodeController = OSBARCController()
barcodeController.handleActivityResult(SCAN_REQUEST_CODE, OSBARCError.INVALID_PARAMETERS_ERROR.code, mockIntent,
{
fail()
},
{
assertEquals(OSBARCError.INVALID_PARAMETERS_ERROR.code, it.code)
assertEquals(OSBARCError.INVALID_PARAMETERS_ERROR.description, it.description)
}
)
}

@Test
fun givenResultOKAndBarcodeEmptyWhenHandleScanResultThenScanningError() {
mockIntentCompat
Expand Down
Loading