summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2010-12-06 09:30:17 -0800
committerRobert Greenwalt <rgreenwalt@google.com>2010-12-06 09:47:31 -0800
commit733c62909c1cca72be50094acb15dc1014b956ce (patch)
tree536855f6bea1e8ef151077ac84faefe3b31850cb /services
parent7c2bacf6a904f470a7e850841c306065049feedc (diff)
downloadframeworks_base-733c62909c1cca72be50094acb15dc1014b956ce.zip
frameworks_base-733c62909c1cca72be50094acb15dc1014b956ce.tar.gz
frameworks_base-733c62909c1cca72be50094acb15dc1014b956ce.tar.bz2
Don't clobber the net hostname if it's already set.
Be a good citizen. Change-Id: Ic58aeab013e2ff34201be71e01e399390edbbb5f
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ConnectivityService.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 7e76ea5..43c857a 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -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