am 614c653b: am 1fdb5100: Merge "Handle null values in registerService" into lmp-dev

* commit '614c653b7a2da14ded7d9c95142a5afd0b4d4722':
  Handle null values in registerService
This commit is contained in:
Christopher Lane
2014-09-14 17:25:44 +00:00
committed by Android Git Automerger

View File

@@ -716,8 +716,9 @@ public class NsdService extends INsdManager.Stub {
for (String key : txtRecords.keySet()) {
try {
// TODO: Send encoded TXT record as bytes once NDC/netd supports binary data.
byte[] recordValue = txtRecords.get(key);
cmd.appendArg(String.format(Locale.US, "%s=%s", key,
new String(txtRecords.get(key), "UTF_8")));
recordValue != null ? new String(recordValue, "UTF_8") : ""));
} catch (UnsupportedEncodingException e) {
Slog.e(TAG, "Failed to encode txtRecord " + e);
}