From 1603ff11bbb0b9a55ac2fbda91b1692c12ef85c4 Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Fri, 1 Jan 2016 01:22:20 -0500 Subject: [PATCH] Replace \032 in a service name with " " Some implementations of mDNS on Android display a space as \\032 and some display it as \032 Attempt to convert both types to a " " before displaying it --- src/protect/babymonitor/DiscoverActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/protect/babymonitor/DiscoverActivity.java b/src/protect/babymonitor/DiscoverActivity.java index 3bef35b..f75565c 100644 --- a/src/protect/babymonitor/DiscoverActivity.java +++ b/src/protect/babymonitor/DiscoverActivity.java @@ -206,8 +206,13 @@ class ServiceInfoWrapper // If there is more than one service on the network, it will // have a number at the end, but will appear as the following: // "ProtectBabyMonitor\\032(number) - // Replace \\032 with a "" - return _info.getServiceName().replace("\\\\032", " "); + // or + // "ProtectBabyMonitor\032(number) + // Replace \\032 and \032 with a " " + String serviceName = _info.getServiceName(); + serviceName = serviceName.replace("\\\\032", " "); + serviceName = serviceName.replace("\\032", " "); + return serviceName; } @Override