Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ internal class HomeAssistantSearcherImpl @Inject constructor(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
try {
nsdManager.stopServiceResolution(listener)
} catch (e: IllegalArgumentException) {
// On devices with T SDK extension < 22, NsdManager throws when the
// listener is already unregistered (which happens automatically after
// onServiceResolved/onResolveFailed fires). The call is still needed
// for devices where auto-unregistration is not guaranteed, so we keep
// it and just downgrade the expected case to a warning without a stack.
Timber.w("stopServiceResolution: listener already unregistered: ${e.message}")
Comment thread
TimoPtr marked this conversation as resolved.
Comment thread
TimoPtr marked this conversation as resolved.
} catch (e: Exception) {
Timber.e(e, "Failed to stop service resolution")
}
Expand Down
Loading