Change hostname format to conform to specification

Underscore is not allowed as per RFC 952

Bug: 5348537
Change-Id: I618c137fd54ecf36cece3b9eba39c51cda3aeac3
This commit is contained in:
Irfan Sheriff
2011-09-20 15:17:07 -07:00
parent f444762587
commit 4aa0b2ece5

View File

@@ -319,7 +319,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
String id = Settings.Secure.getString(context.getContentResolver(), String id = Settings.Secure.getString(context.getContentResolver(),
Settings.Secure.ANDROID_ID); Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) { if (id != null && id.length() > 0) {
String name = new String("android_").concat(id); String name = new String("android-").concat(id);
SystemProperties.set("net.hostname", name); SystemProperties.set("net.hostname", name);
} }
} }