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:
@@ -716,8 +716,9 @@ public class NsdService extends INsdManager.Stub {
|
|||||||
for (String key : txtRecords.keySet()) {
|
for (String key : txtRecords.keySet()) {
|
||||||
try {
|
try {
|
||||||
// TODO: Send encoded TXT record as bytes once NDC/netd supports binary data.
|
// 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,
|
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) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
Slog.e(TAG, "Failed to encode txtRecord " + e);
|
Slog.e(TAG, "Failed to encode txtRecord " + e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user