diff --git a/src/android/CHIPTool/app/src/main/AndroidManifest.xml b/src/android/CHIPTool/app/src/main/AndroidManifest.xml
index b54fe4b3f8edb3..f8f1c4d93156ca 100644
--- a/src/android/CHIPTool/app/src/main/AndroidManifest.xml
+++ b/src/android/CHIPTool/app/src/main/AndroidManifest.xml
@@ -8,6 +8,7 @@
+
+
+
+
+
+
QrCodeInfo(info.tag, info.type, info.data, info.int32) }
+ )
+
+ onCHIPDeviceInfoReceived(deviceInfo)
+ }
+
companion object {
var REQUEST_CODE_COMMISSIONING = 0xB003
}
diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt
index 9fd15bfb4f2f76..87a27e43de7ec9 100644
--- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt
+++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt
@@ -117,20 +117,13 @@ class BarcodeFragment : Fragment(), CHIPBarcodeProcessor.BarcodeDetectionListene
stopCamera()
val payload = SetupPayloadParser().parseQrCode(barcode.displayValue)
-
- val optionalQrCodeInfo = payload.optionalQRCodeInfo
- val qrCodeInfoMap = HashMap()
- optionalQrCodeInfo.forEach { (i, info) ->
- qrCodeInfoMap[i] = QrCodeInfo(info.tag, info.type, info.data, info.int32)
- }
-
val deviceInfo = CHIPDeviceInfo(
payload.version,
payload.vendorId,
payload.productId,
payload.discriminator,
payload.setupPinCode,
- qrCodeInfoMap
+ payload.optionalQRCodeInfo.mapValues { (_, info) -> QrCodeInfo(info.tag, info.type, info.data, info.int32) }
)
FragmentUtil.getHost(this, Callback::class.java)?.onCHIPDeviceInfoReceived(deviceInfo)
}