OSDN Git Service

Ethernet: initialize state depends on interfaces
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 25 Feb 2011 09:26:28 +0000 (17:26 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 25 Feb 2011 09:28:55 +0000 (17:28 +0800)
If no interface found, disable Ethernet on initialization.

ethernet/java/android/net/ethernet/EthernetStateTracker.java

index 61e3304..e4da512 100644 (file)
@@ -243,7 +243,7 @@ public class EthernetStateTracker extends NetworkStateTracker {
             if (state != mEM.ETHERNET_STATE_DISABLED) {
                 if (state == mEM.ETHERNET_STATE_UNKNOWN) {
                     // maybe this is the first time we run, so set it to enabled
-                    mEM.setEnabled(true);
+                    mEM.setEnabled(mEM.getDeviceNameList() != null);
                 } else {
                     try {
                         resetInterface();