Skip to content

Commit 525b928

Browse files
committed
fix: ensure restored devices stream completes on Android
This passes an empty restored device info collection to the restored device event stream on Android to ensure the stream will emit a done event.
1 parent 1484bee commit 525b928

File tree

1 file changed

+5
-0
lines changed
  • packages/reactive_ble_mobile/android/src/main/kotlin/com/signify/hue/flutterreactiveble/channelhandlers

1 file changed

+5
-0
lines changed

packages/reactive_ble_mobile/android/src/main/kotlin/com/signify/hue/flutterreactiveble/channelhandlers/RestoredDeviceHandler.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.signify.hue.flutterreactiveble.channelhandlers
22

33
import io.flutter.plugin.common.EventChannel
4+
import com.signify.hue.flutterreactiveble.ProtobufModel as pb
45

56
class RestoredDeviceHandler() : EventChannel.StreamHandler {
67
private var sink: EventChannel.EventSink? = null
@@ -11,7 +12,11 @@ class RestoredDeviceHandler() : EventChannel.StreamHandler {
1112
) {
1213
eventSink?.let {
1314
sink = eventSink
15+
16+
val message = pb.RestoredDeviceInfoCollection.newBuilder().build()
17+
eventSink.success(message.toByteArray())
1418
}
19+
1520
}
1621

1722
override fun onCancel(objectSink: Any?) {

0 commit comments

Comments
 (0)