Don't clobber the net hostname if it's already set. am: 82cde1324d

Original change: undetermined

Change-Id: Ia5a1375b7bc15976a2821adae1b59944eac4be76
This commit is contained in:
Robert Greenwalt
2021-05-31 04:05:20 +00:00
committed by Automerger Merge Worker

View File

@@ -264,11 +264,13 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mHandler = new MyHandler(handlerThread.getLooper());
// setup our unique device name
String id = Settings.Secure.getString(context.getContentResolver(),
Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) {
String name = new String("android_").concat(id);
SystemProperties.set("net.hostname", name);
if (TextUtils.isEmpty(SystemProperties.get("net.hostname"))) {
String id = Settings.Secure.getString(context.getContentResolver(),
Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) {
String name = new String("android_").concat(id);
SystemProperties.set("net.hostname", name);
}
}
// read our default dns server ip