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
This commit is contained in:
Branden Archer
2016-01-01 01:22:20 -05:00
parent b361d56539
commit 1603ff11bb

View File

@@ -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