Skip to content

Commit

Permalink
fix: ensure restored devices stream completes on Android
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
taylorbell committed Dec 14, 2024
1 parent 1484bee commit 525b928
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.signify.hue.flutterreactiveble.channelhandlers

import io.flutter.plugin.common.EventChannel
import com.signify.hue.flutterreactiveble.ProtobufModel as pb

class RestoredDeviceHandler() : EventChannel.StreamHandler {
private var sink: EventChannel.EventSink? = null
Expand All @@ -11,7 +12,11 @@ class RestoredDeviceHandler() : EventChannel.StreamHandler {
) {
eventSink?.let {
sink = eventSink

val message = pb.RestoredDeviceInfoCollection.newBuilder().build()
eventSink.success(message.toByteArray())
}

}

override fun onCancel(objectSink: Any?) {
Expand Down

0 comments on commit 525b928

Please sign in to comment.